Skip to content

Commit 7ef6b1c

Browse files
committed
Merge #19961: doc: tor.md updates
a34eceb doc: update -externalip documentation in tor.md (Jon Atack) dc8a591 doc: add tor.md section on how to get tor info via bitcoind (Jon Atack) e1765d8 doc: update tor.md address examples from onion v2 to v3 (Jon Atack) Pull request description: It looks like `doc/tor.md` could use some updates and improvements, not only for Tor v3, but also for setting multiple addresses with `-externalip` (see the conversation from http://www.erisian.com.au/bitcoin-core-dev/log-2020-09-16.html#l-39), how to see information about your Tor config via Bitcoin Core, and other improvements. Closes #19924. ACKs for top commit: laanwj: ACK a34eceb Tree-SHA512: 3197cdca1188dbd645c8f9e6ed7c023da5ad9bcf246a6bcbfbe6078f40c01c563032b4906736cde253a2daf71aaed28a659121628891a5d0bf6e89f821a17a28
2 parents d0e76b5 + a34eceb commit 7ef6b1c

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

doc/tor.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ It is possible to run Bitcoin Core as a Tor onion service, and connect to such s
55
The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly
66
configure Tor.
77

8+
## How to see information about your Tor configuration via Bitcoin Core
9+
10+
There are several ways to see your local onion address in Bitcoin Core:
11+
- in the debug log (grep for "tor:" or "AddLocal")
12+
- in the output of RPC `getnetworkinfo` in the "localaddresses" section
13+
- in the output of the CLI `-netinfo` peer connections dashboard
14+
15+
You may set the `-debug=tor` config logging option to have additional
16+
information in the debug log about your Tor configuration.
17+
818

919
## 1. Run Bitcoin Core behind a Tor proxy
1020

@@ -51,14 +61,19 @@ The directory can be different of course, but virtual port numbers should be equ
5161
your bitcoind's P2P listen port (8333 by default), and target addresses and ports
5262
should be equal to binding address and port for inbound Tor connections (127.0.0.1:8334 by default).
5363

54-
-externalip=X You can tell bitcoin about its publicly reachable address using
55-
this option, and this can be a .onion address. Given the above
56-
configuration, you can find your .onion address in
64+
-externalip=X You can tell bitcoin about its publicly reachable addresses using
65+
this option, and this can be an onion address. Given the above
66+
configuration, you can find your onion address in
5767
/var/lib/tor/bitcoin-service/hostname. For connections
5868
coming from unroutable addresses (such as 127.0.0.1, where the
59-
Tor proxy typically runs), .onion addresses are given
69+
Tor proxy typically runs), onion addresses are given
6070
preference for your node to advertise itself with.
6171

72+
You can set multiple local addresses with -externalip. The
73+
one that will be rumoured to a particular peer is the most
74+
compatible one and also using heuristics, e.g. the address
75+
with the most incoming connections, etc.
76+
6277
-listen You'll need to enable listening for incoming connections, as this
6378
is off by default behind a proxy.
6479

@@ -71,7 +86,7 @@ should be equal to binding address and port for inbound Tor connections (127.0.0
7186

7287
In a typical situation, where you're only reachable via Tor, this should suffice:
7388

74-
./bitcoind -proxy=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -listen
89+
./bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
7590

7691
(obviously, replace the .onion address with your own). It should be noted that you still
7792
listen on all devices and another node could establish a clearnet connection, when knowing
@@ -89,7 +104,7 @@ and open port 8333 on your firewall (or use -upnp).
89104
If you only want to use Tor to reach .onion addresses, but not use it as a proxy
90105
for normal IPv4/IPv6 communication, use:
91106

92-
./bitcoind -onion=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -discover
107+
./bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
93108

94109
## 3. Automatically create a Bitcoin Core onion service
95110

0 commit comments

Comments
 (0)