Browse Source

doc: split anonymous_nodes into two subsections

Dastan-glitch 3 years ago
parent
commit
3b5cad9c11

+ 2 - 0
doc/src/SUMMARY.md

@@ -33,6 +33,8 @@
   - [cashierd JSON-RPC API](clients/cashierd_jsonrpc.md)
   - [faucetd JSON-RPC API](clients/faucetd_jsonrpc.md)
   - [Anonymous Nodes](clients/anonymous_nodes.md)
+    - [Anonymous_host](clients/anonymous_host.md)
+    - [Anonymous_outbound](clients/anonymous_outbound.md)
 - [Crypto](crypto/crypto.md)
   - [FFT](crypto/fft.md)
   - [ZK explainer](crypto/zk_explainer.md)

+ 56 - 0
doc/src/clients/anonymous_host.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`.

+ 4 - 166
doc/src/clients/anonymous_nodes.md

@@ -1,167 +1,5 @@
-Hosting anonymous nodes
-=======================
+# 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`.
-
-\
-Anonymous outbound connection
-=======================
-
-Using Nym's mixnet to anonymously connect to other peers in `Darkfi` 
-network as Nym offers network-level privacy.\
-An outbound connection with peers can be done anonymously using Nym, 
-we will be proxying our packets through `SOCKS5 Client` to mixnet to
-`Network Requester` to other peers and back.\
-The following instructions should work on any Linux system.
-
-## 1. **Download**
-
-Nym binaries can be downloaded from [Nym releases](https://github.com/nymtech/nym/releases) 
-or pre-built for Ubuntu 20.04 x86-64 from [nymtech website](https://nymtech.net/download-nym-components/).\
-Download `SOCKS5 Client` and `Network Requester`.
-
-
-## 2. **Initialize**
-
-`Network Requester` makes the requests on your behalf, it is 
-recommended to run your own on a server, however for the sake of 
-example and simplicity everything is run locally.\
-We'll start by initializng the `Network Requester`:
-
-```
-% ./nym-network-requester init --id nettestnode
-```
-
-This will print some information in the terminal, what we want is the 
-client address, for example it could be something like this:
-
-```
-The address of this client is: 8hUvtEyZK8umsdxxPS2BizQhEDmbNeXEPBZLgscE57Zh.5P2bWn6WybVL8QgoPEUHf6h2zXktmwrWaqaucEBZy7Vb@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz
-```
-
-Then we'll use that address as provider for `SOCKS5 Client` 
-initialization:
-
-```
-% ./nym-socks5-client init --use-reply-surbs true --id sockstest --provider 8hUvtEyZK8umsdxxPS2BizQhEDmbNeXEPBZLgscE57Zh.5P2bWn6WybVL8QgoPEUHf6h2zXktmwrWaqaucEBZy7Vb@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz
-```
-
-We alos set `--use-reply-surbs` flag to true, this will enable 
-anonymous sender tag for communication with the service provider, 
-but it will make the actual communication slower.
-
-## 3. **Run**
-
-Now we can run `Network Requester` and then `SOCKS5 Client`:
-
-```
-% ./nym-network-requester run --id nettestnode
-```
-
-Then in another terminal run:
-
-```
-% ./nym-socks5-client run --id sockstest
-```
-
-> Adding a new domain/address to `allowed.list` while 
-`nym-network-requester` is running you must restart it to pick up the 
-new list.
-
-Both of these binaries have to be running when setting up a node.
-
-Currently connecting to other nodes might not be as dynamic as you'd 
-think, the approach used for now is whitelisted addresses, here's how 
-it works:
-
-- Initialize `nym-network-requester`
-- Initialize `nym-socks5-client`
-- Add known peers' domains/addresses to `~/.nym/service-providers/network-requester/allowed.list`
-- Run `nym-network-requester`
-- Run `nym-socks5-client`
-- Edit Darkfi node's config file (provided in the next section) so you 
-can connect to peers manually, or through seed.
-
-> Note that for peer discovery you'll have to whitelist some known 
-peers and the seed itself.
-
-## 4. **Setup `ircd`**
-
-After compiling `ircd`, run it once to spawn the config file. Then
-edit it to contain the following:
-
-```toml
-# manually
-## P2P net settings
-[net]
-outbound_connections=0
-peers = ["nym://some.whitelisted.domain:25552", "nym://someother.whitelisted.domain:25556"]
-outbound_transports = ["nym"]
-
-# automatically
-## P2P net settings
-[net]
-outbound_connections=8
-seeds = ["nym://some.whitelisted.seed:25551", "tcp://someother.whitelisted.seed:25551"]
-outbound_transports = ["nym"]
-```
-
-> The most important part that could easily be forgotten is: ```outbound_transports = ["nym"]```
-
-Now when you start `ircd`, you will be able to discover or connect 
-directly to peers and your traffic will be routed through the mixnet.
-
-These instructions are also applicable to other nodes in the DarkFi
-ecosystem, e.g. `darkfid`.
+This section provides two examples, one for hosting anonymous nodes 
+using `Tor`, and the other one for making anonymous outbound 
+connections with peers using `Nym`.

+ 109 - 0
doc/src/clients/anonymous_outbound.md

@@ -0,0 +1,109 @@
+Anonymous outbound connection
+=======================
+
+Using Nym's mixnet to anonymously connect to other peers in `Darkfi` 
+network as Nym offers network-level privacy.\
+An outbound connection with peers can be done anonymously using Nym, 
+we will be proxying our packets through `SOCKS5 Client` to mixnet to
+`Network Requester` to other peers and back.\
+The following instructions should work on any Linux system.
+
+## 1. **Download**
+
+Nym binaries can be downloaded from [Nym releases](https://github.com/nymtech/nym/releases) 
+or pre-built for Ubuntu 20.04 x86-64 from [nymtech website](https://nymtech.net/download-nym-components/).\
+Download `SOCKS5 Client` and `Network Requester`.
+
+
+## 2. **Initialize**
+
+`Network Requester` makes the requests on your behalf, it is 
+recommended to run your own on a server, however for the sake of 
+example and simplicity everything is run locally.\
+We'll start by initializng the `Network Requester`:
+
+```
+% ./nym-network-requester init --id nettestnode
+```
+
+This will print some information in the terminal, what we want is the 
+client address, for example it could be something like this:
+
+```
+The address of this client is: 8hUvtEyZK8umsdxxPS2BizQhEDmbNeXEPBZLgscE57Zh.5P2bWn6WybVL8QgoPEUHf6h2zXktmwrWaqaucEBZy7Vb@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz
+```
+
+Then we'll use that address as provider for `SOCKS5 Client` 
+initialization:
+
+```
+% ./nym-socks5-client init --use-reply-surbs true --id sockstest --provider 8hUvtEyZK8umsdxxPS2BizQhEDmbNeXEPBZLgscE57Zh.5P2bWn6WybVL8QgoPEUHf6h2zXktmwrWaqaucEBZy7Vb@5vC8spDvw5VDQ8Zvd9fVvBhbUDv9jABR4cXzd4Kh5vz
+```
+
+We alos set `--use-reply-surbs` flag to true, this will enable 
+anonymous sender tag for communication with the service provider, 
+but it will make the actual communication slower.
+
+## 3. **Run**
+
+Now we can run `Network Requester` and then `SOCKS5 Client`:
+
+```
+% ./nym-network-requester run --id nettestnode
+```
+
+Then in another terminal run:
+
+```
+% ./nym-socks5-client run --id sockstest
+```
+
+> Adding a new domain/address to `allowed.list` while 
+`nym-network-requester` is running you must restart it to pick up the 
+new list.
+
+Both of these binaries have to be running when setting up a node.
+
+Currently connecting to other nodes might not be as dynamic as you'd 
+think, the approach used for now is whitelisted addresses, here's how 
+it works:
+
+- Initialize `nym-network-requester`
+- Initialize `nym-socks5-client`
+- Add known peers' domains/addresses to `~/.nym/service-providers/network-requester/allowed.list`
+- Run `nym-network-requester`
+- Run `nym-socks5-client`
+- Edit Darkfi node's config file (provided in the next section) so you 
+can connect to peers manually, or through seed.
+
+> Note that for peer discovery you'll have to whitelist some known 
+peers and the seed itself.
+
+## 4. **Setup `ircd`**
+
+After compiling `ircd`, run it once to spawn the config file. Then
+edit it to contain the following:
+
+```toml
+# manually
+## P2P net settings
+[net]
+outbound_connections=0
+peers = ["nym://some.whitelisted.domain:25552", "nym://someother.whitelisted.domain:25556"]
+outbound_transports = ["nym"]
+
+# automatically
+## P2P net settings
+[net]
+outbound_connections=8
+seeds = ["nym://some.whitelisted.seed:25551", "tcp://someother.whitelisted.seed:25551"]
+outbound_transports = ["nym"]
+```
+
+> The most important part that could easily be forgotten is: ```outbound_transports = ["nym"]```
+
+Now when you start `ircd`, you will be able to discover or connect 
+directly to peers and your traffic will be routed through the mixnet.
+
+These instructions are also applicable to other nodes in the DarkFi
+ecosystem, e.g. `darkfid`.