A little while ago I was wrestling with getting my node to get a decent pool of Tor connections -- it would basically get like 13 and then just sit there; whereas, when I ran the thing on clearnet, it would get whatever the max I set was, 50 or whatever. So people helped me and I wrote a script that jumped randomly through candidate Tor nodes that @emmanuelrosa had found and tried to add them. With this method I could get as many as I wanted.
So I did another very basic experiment: add nodes till I get sixty, and then turn off my monitoring script, and see what happened. Well, what happened every time was steady attrition -- once I stop the script that actively cultivates new Tor connections to keep the number of peers at a set point, they just drain away. I started at 60, and five or so days later, I'm at ... 35.
I'm just screwing around here, but is this normal? Is the Tor btc network this flaky and terrible for other people? I note that my MyNode node (running on a raspberry pi) which is also Tor-only has a total of 21 peers, after running for months, and when I checked five days ago, it was at 13, so at least that one has gained peers.
Basically, I'm curious if this scenario seems weird to anyone who actually knows what they're doing; or if anyone can offer insights into Tor peering. Like I said earlier, I can solve this through external means, but I'd like to understand better the trouble w/ peerage because I am curious and obsessive.
-onlynet=onion
, right? If so, then all 10 of the outbound connections will be made to Tor peers. Here is a an example command to see your connections:.onion
address is propagated into other peers' databases and the overall demand for Tor peers..onion
addresses are in a node's address database:bitcoin-cli addnode ...onion:8333 add
orbitcoin-cli addnode ...onion:8333 onetry
? I guess what you are observing is that you are adding manually outbound peers and then over time some of those connections are dropped which is normal and are not reestablished.onlynet=onion
andonetry
vsadd
- I don't want to waste time trying to reconnect a million times given the attrition I'm seeing.-onlynet=onion
- this way the node is more likely to fall victim of a sybil attack - because it is cheap to create.onion
addresses somebody may create a lot of them and the victim's node to make all 10 outbound connection to the attacker. To avoid sybil just one connection to a honest node suffices. Now, unless there is a very specific reason for-onlynet=onion
you may configure Bitcoin Core to connect also to clearnet peers via the Tor network. This will protect your nodes' whereabouts and will use the Tor exit nodes to connect to clearnet nodes. To sybil that one would need to control Tor exit nodes as well, or a lot of clearnet nodes.-proxy=127.0.0.1:9050
(assuming this is where your Tor SOCKS5 proxy is listening) and omit the-onlynet=onion
option. Then Bitcoin Core will be able to connect to IPv4, IPv6 and Tor peers, all via the Tor network, so the IPv4/6 peers pose no threat to revealing your IP address. This actually uses the entire Tor network as one big VPN with multiple exit points (the Tor exit nodes), also used by many others with the added benefit of being able to connect to.onion
addresses without exiting the "VPN" ;).onion
address), then probably it is the same:.onion
address, so it should be well propagated.