Parcourir la source

doc: add nym documentation to anonymous_nodes.md

Dastan-glitch il y a 3 ans
Parent
commit
7ebbcdd544
1 fichiers modifiés avec 111 ajouts et 0 suppressions
  1. 111 0
      doc/src/clients/anonymous_nodes.md

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

@@ -54,3 +54,114 @@ 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`.