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