-
Notifications
You must be signed in to change notification settings - Fork 109
Tor broadcast method #662
Tor broadcast method #662
Conversation
joinmarket/peertopeer.py
Outdated
| else: | ||
| self.magic = 0xdab5bffa #regtest | ||
| self.closed = False | ||
| self.connection_attempts = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increase this number to about 20 or 30 since 4 is far too low, also make it a defined constant MAX_CONNECTION_ATTEMPTS
|
Came across some archival full nodes which run with -blocksonly=1 which would mean it would never ask for the transaction so my code would hang. |
|
Travis says X because there's the code in taker.py which isn't tested. It would be hard to test because it requires a socks5 host and port. Perhaps I could find some simply socks5 script that just redirects it to localhost. The rest of the tests passed. |
|
Right now this uses a user-agent of /JoinMarket:0.2.3/. I don't see any reason to try to hide by using a user agent of /Satoshi:0.13.2/ or something if all the connections will be over tor. |
|
My other question is does this diff just connect to dns seed nodes or should it be requesting nodes from the seeds by which to broadcast? |
…S seeds Includes code for connecting to a bitcoin node over p2p network which can be re-used for other features. added heartbeat and keepalive code, made tor broadcaster more robust against failures
1845918 to
bcce589
Compare
|
Thanks for testing @weex Squished commits. I believe this is ready to merge, or someone could try it on the mainnet for their own transactions? |
bcce589 Created tor broadcast method, use tx_broadcast = tor to connect to DNS seeds (chris-belcher)
Use
tx_broadcast = torin joinmarket.cfg to connect to a random bitcoin node on the network, to broadcast a transaction and then disconnect. The DNS seeds are used to find these nodes.Right now on the bitcoin network, there are an unknown number of sybil nodes which aggressively announce themselves in an effort to attract more people to connect to them. Then they spy on every newly-broadcasted transaction, tracking it as it propagates through the p2p network and giving them a good idea of the IP address that originally broadcasted that transaction.
JoinMarket already had a feature of asking a maker bot to broadcast your transaction, although this isn't as good as using tor. See issue #56 for discussion.
This PR implements #503. It includes code for connecting to a bitcoin node over p2p network which can be re-used for other features like #470 and #653.
The test uses the new
generatetoaddressRPC call from 0.13.0 and hopefully works quite well.I haven't tested on mainnet.