Просмотр исходного кода

doc: Add page on hosting anon nodes.

parazyd 3 лет назад
Родитель
Сommit
79f55c4d44
2 измененных файлов с 61 добавлено и 5 удалено
  1. 5 5
      doc/src/SUMMARY.md
  2. 56 0
      doc/src/clients/anonymous_nodes.md

+ 5 - 5
doc/src/SUMMARY.md

@@ -28,6 +28,11 @@
   - [Examples](zkas/examples.md)
     - [Anonymous voting](zkas/examples/voting.md)
     - [Anonymous payments](zkas/examples/sapling.md)
+- [Client](clients/clients.md)
+  - [darkfid JSON-RPC API](clients/darkfid_jsonrpc.md)
+  - [cashierd JSON-RPC API](clients/cashierd_jsonrpc.md)
+  - [faucetd JSON-RPC API](clients/faucetd_jsonrpc.md)
+  - [Anonymous Nodes](clients/anonymous_nodes.md)
 - [Crypto](crypto/crypto.md)
   - [FFT](crypto/fft.md)
   - [ZK explainer](crypto/zk_explainer.md)
@@ -60,11 +65,6 @@
     - [get_info](learn/dchat/network-tools/get-info.md)
     - [Using dnetview](learn/dchat/network-tools/using-dnetview.md)
     - [Debugging](learn/dchat/network-tools/debug.md)
-- [Client](clients/clients.md)
-  - [darkfid JSON-RPC API](clients/darkfid_jsonrpc.md)
-  - [cashierd JSON-RPC API](clients/cashierd_jsonrpc.md)
-  - [faucetd JSON-RPC API](clients/faucetd_jsonrpc.md)
-  - [Port ranges](clients/portranges.md)
 - [Miscellaneous tools](misc/misc.md)
   - [vanityaddr](misc/vanityaddr.md)
   - [ircd](misc/ircd/ircd.md)

+ 56 - 0
doc/src/clients/anonymous_nodes.md

@@ -0,0 +1,56 @@
+Hosting anonymous nodes
+=======================
+
+Using Tor, we can host anonymous nodes as Tor hidden services. To do
+this, we need to set up our Tor daemon and create a hidden service.
+The following instructions should work on any Linux system.
+
+## 1. **Install Tor**
+
+Tor can usually be installed with your package manager. For example
+on an `apt` based system we can run:
+
+```
+# apt install tor
+```
+
+This will install it. Now in `/etc/tor/torrc` we can set up the hidden
+service. For hosting an anonymous `ircd` node, set up the following
+lines in the file:
+
+```
+HiddenServiceDir /var/lib/tor/darkfi_ircd
+HiddenServicePort 25551 127.0.0.1:25551
+```
+
+Then restart Tor:
+
+```
+# /etc/init.d/tor restart
+```
+
+You can grab the hostname of your hidden service from the directory:
+
+```
+# cat /var/lib/tor/darkfi_ircd/hostname
+```
+
+For example purposes, let's assume it's
+`jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4p7cyd.onion`.
+
+## 2. **Setup `ircd`**
+
+After compiling `ircd`, run it once to spawn the config file. Then
+edit it to contain the following:
+
+```toml
+inbound = ["tcp://127.0.0.1:25551"]
+external_addr = ["tor://jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4p7cyd.onion:25551"]
+```
+
+Now when you start `ircd`, the hidden service will be announced as
+a peer and people will be able to connect to it when they discover
+you as a peer.
+
+These instructions are also applicable to other nodes in the DarkFi
+ecosystem, e.g. `darkfid`.