]> Git Repo - VerusCoin.git/blame - doc/tor.md
Merge branch 'testmaster' into beta
[VerusCoin.git] / doc / tor.md
CommitLineData
c2b69c72 1*** Warning: Do not assume Tor support does the correct thing in Komodo; better Tor support is a future feature goal. ***
fb537854 2
85cc6f5b 3TOR SUPPORT IN ZCASH
4====================
00a88745 5
c2b69c72 6It is possible to run Komodo as a Tor hidden service, and connect to such services.
00a88745 7
ec8828af 8The 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
00a88745 9configure Tor.
10
11
c2b69c72 121. Run Komodo behind a Tor proxy
85cc6f5b 13-------------------------------
00a88745 14
c2b69c72 15The first step is running Komodo behind a Tor proxy. This will already make all
5f8be1da 16outgoing connections be anonymized, but more is possible.
00a88745 17
00a88745 18 -proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy
19 server will be used to try to reach .onion addresses as well.
4fbfebea 20
de9ca8e9 21 -onion=ip:port Set the proxy server to use for Tor hidden services. You do not
102518fd 22 need to set this if it's the same as -proxy. You can use -noonion
00a88745 23 to explicitly disable access to hidden service.
4fbfebea 24
00a88745 25 -listen When using -proxy, listening is disabled by default. If you want
26 to run a hidden service (see next section), you'll need to enable
27 it explicitly.
4fbfebea 28
00a88745 29 -connect=X When behind a Tor proxy, you can specify .onion addresses instead
30 -addnode=X of IP addresses or hostnames in these parameters. It requires
31 -seednode=X SOCKS5. In Tor mode, such addresses can also be exchanged with
32 other P2P nodes.
33
34In a typical situation, this suffices to run behind a Tor proxy:
35
f37f614e 36 ./komodod -proxy=127.0.0.1:9050
00a88745 37
38
c2b69c72 392. Run a Komodo hidden server
85cc6f5b 40----------------------------
00a88745 41
42If you configure your Tor system accordingly, it is possible to make your node also
43reachable from the Tor network. Add these lines to your /etc/tor/torrc (or equivalent
44config file):
45
85cc6f5b 46 HiddenServiceDir /var/lib/tor/zcash-service/
c2b69c72
JDL
47 HiddenServicePort 7771 127.0.0.1:7771
48 HiddenServicePort 17771 127.0.0.1:17771
00a88745 49
50The directory can be different of course, but (both) port numbers should be equal to
c2b69c72 51your komodod's P2P listen port (7771 by default).
00a88745 52
c2b69c72 53 -externalip=X You can tell Komodo about its publicly reachable address using
00a88745 54 this option, and this can be a .onion address. Given the above
55 configuration, you can find your onion address in
85cc6f5b 56 /var/lib/tor/zcash-service/hostname. Onion addresses are given
00a88745 57 preference for your node to advertize itself with, for connections
58 coming from unroutable addresses (such as 127.0.0.1, where the
59 Tor proxy typically runs).
4fbfebea 60
00a88745 61 -listen You'll need to enable listening for incoming connections, as this
62 is off by default behind a proxy.
4fbfebea 63
00a88745 64 -discover When -externalip is specified, no attempt is made to discover local
65 IPv4 or IPv6 addresses. If you want to run a dual stack, reachable
66 from both Tor and IPv4 (or IPv6), you'll need to either pass your
67 other addresses using -externalip, or explicitly enable -discover.
68 Note that both addresses of a dual-stack system may be easily
69 linkable using traffic analysis.
70
71In a typical situation, where you're only reachable via Tor, this should suffice:
72
f37f614e 73 ./komodod -proxy=127.0.0.1:9050 -externalip=zctestseie6wxgio.onion -listen
00a88745 74
7f9e7a98
M
75(obviously, replace the Onion address with your own). It should be noted that you still
76listen on all devices and another node could establish a clearnet connection, when knowing
77your address. To mitigate this, additionally bind the address of your Tor proxy:
78
bcbcf143 79 ./zcashd ... -bind=127.0.0.1
7f9e7a98
M
80
81If you don't care too much about hiding your node, and want to be reachable on IPv4
82as well, use `discover` instead:
00a88745 83
f37f614e 84 ./komodod ... -discover
00a88745 85
c2b69c72 86and open port 7771 on your firewall (or use -upnp).
00a88745 87
88If you only want to use Tor to reach onion addresses, but not use it as a proxy
89for normal IPv4/IPv6 communication, use:
90
f37f614e 91 ./komodod -onion=127.0.0.1:9050 -externalip=zctestseie6wxgio.onion -discover
85cc6f5b 92
93
2298877f
WL
943. Automatically listen on Tor
95--------------------------------
96
97Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
98API, to create and destroy 'ephemeral' hidden services programmatically.
c2b69c72 99Komodo has been updated to make use of this.
2298877f 100
44040731 101This means that if Tor is running (and proper authentication has been configured),
c2b69c72 102Komodo automatically creates a hidden service to listen on. Komodo will also use Tor
44040731
NM
103automatically to connect to other .onion nodes if the control socket can be
104successfully opened. This will positively affect the number of available .onion
105nodes and their usage.
2298877f 106
c2b69c72 107This new feature is enabled by default if Komodo is listening (`-listen`), and
5aa2365e 108requires a Tor connection to work. It can be explicitly disabled with `-listenonion=0`
109and, if not disabled, configured using the `-torcontrol` and `-torpassword` settings.
110To show verbose debugging information, pass `-debug=tor`.
2298877f 111
44040731 112Connecting to Tor's control socket API requires one of two authentication methods to be
f37f614e 113configured. For cookie authentication the user running komodod must have write access
44040731
NM
114to the `CookieAuthFile` specified in Tor configuration. In some cases this is
115preconfigured and the creation of a hidden service is automatic. If permission problems
116are seen with `-debug=tor` they can be resolved by adding both the user running tor and
f37f614e
JDL
117the user running komodod to the same group and setting permissions appropriately. On
118Debian-based systems the user running komodod can be added to the debian-tor group,
44040731
NM
119which has the appropriate permissions. An alternative authentication method is the use
120of the `-torpassword` flag and a `hash-password` which can be enabled and specified in
121Tor configuration.
122
2298877f 123
c2b69c72 1244. Connect to a Komodo hidden server
85cc6f5b 125-----------------------------------
126
1f48a340 127To test your set-up, you might want to try connecting via Tor on a different computer to just a
c2b69c72 128a single Komodo hidden server. Launch komodod as follows:
85cc6f5b 129
f37f614e 130 ./komodod -onion=127.0.0.1:9050 -connect=zctestseie6wxgio.onion
85cc6f5b 131
c2b69c72 132Now use komodo-cli to verify there is only a single peer connection.
85cc6f5b 133
c2b69c72 134 komodo-cli getpeerinfo
5b07ee59 135
85cc6f5b 136 [
137 {
138 "id" : 1,
c2b69c72 139 "addr" : "zctestseie6wxgio.onion:17770",
85cc6f5b 140 ...
5bd677f5
S
141 "version" : 170002,
142 "subver" : "/MagicBean:1.0.0/",
85cc6f5b 143 ...
144 }
145 ]
1f48a340
JG
146
147To connect to multiple Tor nodes, use:
148
f37f614e 149 ./komodod -onion=127.0.0.1:9050 -addnode=zctestseie6wxgio.onion -dnsseed=0 -onlynet=onion
This page took 0.111057 seconds and 4 git commands to generate.