Summary: make very useful test_framework
Python bindings reusable from outside.
Recently I’ve been interested in approaches to implement alternate P2P transports, with some prior efforts being
Facilitating a diversity of both transports and semantics in the peer-to-peer layer seems like a worthwhile effort. At the same time, I’ve grown wary of undertaking projects that would expand the scope of what Core does.
These two ideas have led me to think that one interesting avenue for doing alternative P2P networking is by running a relay program locally alongside bitcoind that can adapt whatever networking logic and protocol the user desires into bitcoin P2P. In conjunction with -noconnect
/-addnode
and such a relay, you could have a Bitcoin node that exclusively speaks an alternate network externally without any changes to Core.
Anyway, this is all a roundabout preamble for this fairly modest change, which makes the (very useful and well-maintained) Python utilities we have for interacting with bitcoind pip
installable and so usable as a library by other programs. A lot of effort has been put into things like P2P message (de)serialization and RPC communication and it would be nice to have these inherently well-maintained utilities reusable from the outside.
This is a small proof-of-concept patch that can be more polished if necessary, but as written it makes the test_framework
infrastructure more generally useful.
I intend on using this library to build some workable examples of adapting DNS and radio to Bitcoin’s P2P communications.
Even beyond alternate P2P designs, these tools would be very handy to be able to reuse; e.g. bitcoinperf
rewrites a lot of node management logic. It would be preferable to install Python dependencies from this repo, which is already trusted and maintained, than to have to copy/paste vendor code or go to third parties.