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

doc: setting up i2p node guide

oars 1 год назад
Родитель
Сommit
38e05e32ad
3 измененных файлов с 188 добавлено и 2 удалено
  1. 1 0
      doc/src/SUMMARY.md
  2. 137 0
      doc/src/misc/nodes/i2p-guide.md
  3. 50 2
      doc/src/misc/nodes/public-guide.md

+ 1 - 0
doc/src/SUMMARY.md

@@ -21,6 +21,7 @@
 - [Node Configurations](misc/nodes/node-configurations.md)
     - [Public Node Configurations](misc/nodes/public-guide.md)
     - [Tor Nodes](misc/nodes/tor-guide.md)
+    - [I2p Nodes](misc/nodes/i2p-guide.md)
 - [Network Troubleshooting](misc/network-troubleshooting.md)
 
 # Developer Doc

+ 137 - 0
doc/src/misc/nodes/i2p-guide.md

@@ -0,0 +1,137 @@
+# Set-up an I2p-enabled node
+
+_To connect to I2p network we use the socks5 proxy provided by [I2pd](https://i2pd.website/)_
+
+<u><b>Note</b></u>: This page is a general guide for `i2p` nodes in the DarkFi 
+ecosystem and is applicable to other apps such as `taud` and `darkfid`. We use 
+`darkirc` as our main example throughout this guide. Commands such as `./darkirc`
+and configuration filenames need to be adjusted if using different apps.
+If you're using another app, the network configurations remain the same except 
+for the seed nodes you connect to.
+
+## Generating configuration files
+
+After compiling, you can start the application so it can spawn its configuration 
+file. We use `darkirc` as the application example going forward.
+
+```shell
+% ./darkirc
+```
+
+`darkirc` creates a configuration file `darkirc_config.toml` by default in 
+`~/.config/darkfi/`. You will review and edit this configuration file for your 
+preferred network settings. 
+
+## Configure network settings
+
+Modify the network settings located in the `~/.config/darkfi` directory. This 
+configuration allows your node to send and receive traffic only via I2p.
+
+<u><b>Note</b></u>: As you modify the file, if you notice some settings are missing, 
+simply add them. Some settings may be commented-out by default. In the example 
+configurations below, you will find the a placeholder `youraddress.b32.i2p` which 
+indicates you should replace them with your i2p address.
+
+First, you must install [I2pd](https://i2pd.readthedocs.io/en/latest/user-guide/install/). It can usually be
+installed with your package manager. For example on an `apt` based system we can run:
+
+```
+% sudo apt install apt-transport-https
+% wget -q -O - https://repo.i2pd.xyz/.help/add_repo | sudo bash -s -
+% sudo apt update
+% sudo apt install i2pd
+```
+
+### Outbound node settings
+
+These outbound node settings for your i2p node configuration is only for
+connecting to the network. You will not advertise an external address.
+Make sure `i2pd` is running, and it's `socks5` proxy is listening on `127.0.0.1:4447`
+before running `darkirc`.
+
+<!-- TODO: replace the i2p seed address with an official one-->
+
+```toml
+## connection settings
+outbound_connect_timeout = 60
+channel_handshake_timeout = 55
+channel_heartbeat_interval = 90
+outbound_peer_discovery_cooloff_time = 60
+
+## Whitelisted transports for outbound connections
+allowed_transports = ["i2p", "i2p+tls"]
+
+## Seed nodes to connect to 
+seeds = [
+    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
+]
+
+## Outbound connection slots
+outbound_connections = 8
+
+## I2p Socks5 proxy
+i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+```
+
+### Inbound node settings
+
+With these settings your node becomes an I2p inbound node. The `inbound` 
+settings are optional, but enabling them will increase the strength and 
+reliability of the network. Using I2p, we can host anonymous nodes as I2p eepsites(hidden 
+services). To do this, we need to set up our I2p daemon and create a hidden service.
+The following instructions should work on any Linux system.
+
+After installing `I2pd`, Now we can set up the hidden service. 
+For hosting an anonymous `darkirc` node, go to `/var/lib/i2pd/tunnels.d`
+and create a file `darkirc.conf` with the following contents:
+
+```
+[darkirc]
+type = server
+host = 127.0.0.1
+port = 25551
+keys = darkirc.dat
+```
+
+Then restart i2pd:
+
+```
+% systemctl restart i2pd
+```
+
+Find the hostname of your hidden service by running the following command:
+
+```
+% curl -s http://127.0.0.1:7070/?page=i2p_tunnels | grep -Eo "[a-zA-Z0-9./?=_%:-]*" | grep "25551"
+```
+
+The above configuration saves the `i2p` hidden service key in `/var/lib/i2pd/darkirc.dat`,
+you might want to back it up.
+
+Note your `.b32.i2p` address and the ports you used while setting up the
+hidden service, and add the following settings to your configuration file:
+
+```toml
+## Addresses we want to advertise to peers
+external_addrs = ["i2p://youraddress.b32.i2p:25551"]
+
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:25551"]
+
+## Inbound connection slots
+inbound_connections = 64
+```
+
+## Connect and test your node
+
+Run `./darkirc`. Welcome to the dark forest.
+
+You can test if your node is configured properly on the network. Use 
+[Dnet](../../learn/dchat/network-tools/using-dnet.md) and the 
+[ping-tool](../network-troubleshooting.md#ping-tool) to test your node 
+connections. You can view if your node is making inbound and outbound connections.
+
+## Troubleshooting
+
+Refer to [Network troubleshooting](../network-troubleshooting.md)
+for further troubleshooting resources.

+ 50 - 2
doc/src/misc/nodes/public-guide.md

@@ -114,6 +114,48 @@ inbound_connections = 64
 transport_mixing = false
 ```
 
+### Fully anonymous I2p-enabled node
+
+An I2p-enabled node routes traffic over `i2p`. You can find a complete example config
+file for `darkirc-i2p.toml` in `${DARKFI_REPO}/bin/darkirc/config`. This node
+configuration is for users that would like to support `darkirc` over the I2p
+network.
+
+You need to configure I2p and launch your eepsite(hidden service) prior to running your
+public node over I2p. Please refer to
+[I2p Nodes](i2p-guide.md#inbound-node-settings).
+
+```toml
+## connection settings
+outbound_connect_timeout = 60
+channel_handshake_timeout = 55
+channel_heartbeat_interval = 90
+outbound_peer_discovery_cooloff_time = 60
+
+## Whitelisted transports for outbound connections
+allowed_transports = ["i2p", "i2p+tls"]
+
+## Addresses we want to advertise to peers
+external_addrs = ["i2p://youraddress.b32.i2p:25551"]
+
+## Seed nodes to connect to
+seeds = [
+    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
+]
+
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:25551"]
+
+## Outbound connection slots
+outbound_connections = 8
+
+## Inbound connection slots
+inbound_connections = 64
+
+## I2p Socks5 proxy
+i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+```
+
 ### Bridge node
 
 A bridge node is a node that offers connectivity via multiple transport layers. 
@@ -123,6 +165,7 @@ find a complete example config file for `darkirc-mixed.toml` in
 `${DARKFI_REPO}/bin/darkirc/config`. Refer to 
 [Tor Nodes](tor-guide.md#inbound-node-settings) to configure Tor.
 
+<!-- TODO: replace the i2p seed address with an official one-->
 ```toml
 ## connection settings
 outbound_connect_timeout = 60
@@ -131,16 +174,18 @@ channel_heartbeat_interval = 90
 outbound_peer_discovery_cooloff_time = 60
 
 ## Whitelisted transports for outbound connections
-allowed_transports = ["tcp+tls", "tor"]
+allowed_transports = ["tcp+tls", "tor", "i2p"]
 
 ## Addresses we want to advertise to peers
-external_addrs = ["tcp+tls://MY_IP_V4:26661", "tcp+tls://MY_IP_V6:26661", "tcp+tls://my.resolveable.address:26661", "tor://youraddress.onion:25551"]
+external_addrs = ["tcp+tls://MY_IP_V4:26661", "tcp+tls://MY_IP_V6:26661", "tcp+tls://my.resolveable.address:26661",
+    "tor://youraddress.onion:25551", "i2p://youraddress.b32.i2p"]
 
 ## Seed nodes to connect to 
 seeds = [
     "tcp+tls://lilith1.dark.fi:5262",
     "tor://czzulj66rr5kq3uhidzn7fh4qvt3vaxaoldukuxnl5vipayuj7obo7id.onion:5263",
     "tor://vgbfkcu5hcnlnwd2lz26nfoa6g6quciyxwbftm6ivvrx74yvv5jnaoid.onion:5273",
+    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
 ]
 
 ## P2P accept addresses
@@ -154,6 +199,9 @@ inbound_connections = 64
 
 ## Enable transport mixing
 transport_mixing = true
+
+## I2p Socks5 proxy
+i2p_socks5_proxy = "socks5://127.0.0.1:4447"
 ```
 
 ## Test your node