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

doc: DEP-0007: update docs with changes to net settings

oars 1 год назад
Родитель
Сommit
c2904cdbaf

+ 7 - 3
doc/src/learn/dchat/creating-dchatd/accept-addr.md

@@ -26,6 +26,13 @@ rpc_listen = "tcp://127.0.0.1:51054"
 #rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Whitelisted network transports for outbound connections
+active_profiles = ["tcp"]
+
+[net.profiles."tcp"]
 ## P2P accept addresses Required for inbound nodes.
 inbound=["tcp://127.0.0.1:51554"]
 
@@ -34,9 +41,6 @@ external_addr=["tcp://127.0.0.1:51554"]
 
 ## Seed nodes to connect to. Required for inbound and outbound nodes.
 seeds=["tcp://127.0.0.1:50515"]
-
-## Outbound connect slots. Required for outbound nodes.
-outbound_connections = 5
 ```
 
 Regenerate the config by deleting the previous one, rebuilding and

+ 7 - 5
doc/src/learn/dchat/deployment/settings.md

@@ -11,8 +11,14 @@ place specified in `CONFIG_FILE_CONTENTS`.
 
 ```toml
 # dchatd toml
-
 [net]
+## Outbound connect slots. Required for outbound nodes.
+outbound_connections = 5
+
+# Whitelisted network transports for outbound connections
+active_profiles = ["tcp"]
+
+[net.profiles."tcp"]
 ## P2P accept addresses Required for inbound nodes.
 inbound=["tcp://127.0.0.1:51554"]
 
@@ -21,10 +27,6 @@ external_addr=["tcp://127.0.0.1:51554"]
 
 ## Seed nodes to connect to. Required for inbound and outbound nodes.
 seeds=["tcp://127.0.0.1:50515"]
-
-## Outbound connect slots. Required for outbound nodes.
-outbound_connections = 5
-
 ```
 
 Inbound nodes specify an external address and an inbound address: this is

+ 13 - 14
doc/src/misc/nodes/i2p-guide.md

@@ -53,24 +53,22 @@ before running `darkirc`.
 
 ```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
 
+## Whitelisted transports for outbound connections
+active_profiles = ["i2p"]
+
 ## I2p Socks5 proxy
 i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+
+[net.profiles."i2p"]
+## Seed nodes to connect to
+seeds = [
+    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
+]
 ```
 
 ### Inbound node settings
@@ -112,14 +110,15 @@ 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
+## Inbound connection slots
+inbound_connections = 64
+
+[net.profiles."i2p"]
 ## 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

+ 6 - 14
doc/src/misc/nodes/nym-guide.md

@@ -71,27 +71,19 @@ 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 = ["socks5+tls", "tcp+tls"]
-
-## Transports to be mixed
-mixed_transports = ["tcp+tls"]
-
-## Seed nodes to connect to 
-seeds = [
-    "tcp+tls://lilith1.dark.fi:5262"
-]
-
 ## Outbound connection slots
 outbound_connections = 8
 
 ## Nym Socks5 proxy
 nym_socks5_proxy = "socks5://127.0.0.1:1080"
+
+[net.profiles."socks5+tls"]
+## Seed nodes to connect to
+seeds = [
+    "socks5+tls://127.0.0.1:1080/lilith1.dark.fi:25551"
+]
 ```
 
 ## Connect and test your node

+ 104 - 66
doc/src/misc/nodes/public-guide.md

@@ -34,7 +34,8 @@ Edit your `darkirc_config.toml` file to reflect the network settings you want
 to support. Listed below are different `darkirc_config.toml` configurations. You 
 can choose between a clearnet node, a fully anonymous Tor node, or a bridge 
 node which runs over clearnet & Tor, and is most beneficial for the health of 
-the network.
+the network. Each mode can be activated by adding the appropriate profile to
+`active_profiles` net setting.
 
 <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 
@@ -45,35 +46,43 @@ have some of them (for example: IPv6 or domain) remove the values entirely.
 
 ### Clearnet node
 
-A clearnet node routes traffic over `tcp+tls`. You can find a complete example config 
+A clearnet node routes traffic over `tcp+tls`. It is enabled by adding
+`tcp+tls` to the `active_profiles` list. You can find a complete example config
 file for `darkirc-clearnet.toml` in `${DARKFI_REPO}/bin/darkirc/config`.
 
 ```toml
+## Outbound connection slots
+outbound_connections = 8
+
+## Inbound connection slots
+inbound_connections = 64
+
 ## Whitelisted transports for outbound connections
-allowed_transports = ["tcp+tls"]
+active_profiles = ["tcp+tls"]
+
+## Transports to be mixed
+mixed_profiles = []
+
+[net.profiles."tcp+tls"]
+## Seed nodes to connect to
+seeds = ["tcp+tls://lilith1.dark.fi:25551"]
 
 ## 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"]
 
-## Seed nodes to connect to 
-seeds = ["tcp+tls://lilith1.dark.fi:5262"]
-
 ## P2P accept addresses
 inbound = ["tcp+tls://0.0.0.0:26661", "tcp+tls://[::]:26661"]
 
-## Outbound connection slots
-outbound_connections = 8
-
-## Inbound connection slots
-inbound_connections = 64
-
-## Transports to be mixed
-mixed_transports = []
+## Connection settings with default values applicable for each profile separately
+#outbound_connect_timeout = 15
+#channel_handshake_timeout = 10
+#channel_heartbeat_interval = 30
 ```
 
 ### Fully anonymous Tor-enabled node
 
-A Tor-enabled node routes traffic over `tor`. You can find a complete example config 
+A Tor-enabled node routes traffic over `tor`. It is enabled by adding
+`tor` to the `active_profiles` list. You can find a complete example config
 file for `darkirc-tor.toml` in `${DARKFI_REPO}/bin/darkirc/config`. This node 
 configuration is for users that would like to support `darkirc` over the Tor 
 network. A Tor node provides the best anonymity on the network.
@@ -84,39 +93,43 @@ public node over Tor. Please refer to
 
 ```toml
 ## connection settings
-outbound_connect_timeout = 60
-channel_handshake_timeout = 55
-channel_heartbeat_interval = 90
 outbound_peer_discovery_cooloff_time = 60
 
+## Outbound connection slots
+outbound_connections = 8
+
+## Inbound connection slots
+inbound_connections = 64
+
 ## Whitelisted transports for outbound connections
-allowed_transports = ["tor", "tor+tls"]
+active_profiles = ["tor"]
 
-## Addresses we want to advertise to peers
-external_addrs = ["tor://youraddress.onion:25551"]
+## Transports to be mixed
+mixed_profiles = []
 
-## Seed nodes to connect to 
+[net.profiles."tor"]
+## Seed nodes to connect to
 seeds = [
     "tor://g7fxelebievvpr27w7gt24lflptpw3jeeuvafovgliq5utdst6xyruyd.onion:25552",
     "tor://yvklzjnfmwxhyodhrkpomawjcdvcaushsj6torjz2gyd7e25f3gfunyd.onion:25552",
 ]
 
-## P2P accept addresses
-inbound = ["tcp://127.0.0.1:25551"]
-
-## Outbound connection slots
-outbound_connections = 8
+## Addresses we want to advertise to peers
+external_addrs = ["tor://youraddress.onion:26661"]
 
-## Inbound connection slots
-inbound_connections = 64
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:26661"]
 
-## Transports to be mixed
-mixed_transports = []
+## Connection settings with default values applicable for each profile separately
+#outbound_connect_timeout = 60
+#channel_handshake_timeout = 55
+#channel_heartbeat_interval = 90
 ```
 
 ### Fully anonymous I2p-enabled node
 
-An I2p-enabled node routes traffic over `i2p`. You can find a complete example config
+An I2p-enabled node routes traffic over `i2p`. It is enabled by adding
+`i2p` to the `active_profiles` list. 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.
@@ -127,40 +140,44 @@ public node over I2p. Please refer to
 
 ```toml
 ## connection settings
-outbound_connect_timeout = 60
-channel_handshake_timeout = 55
-channel_heartbeat_interval = 90
 outbound_peer_discovery_cooloff_time = 60
 
+## Outbound connection slots
+outbound_connections = 8
+
+## Inbound connection slots
+inbound_connections = 64
+
 ## Whitelisted transports for outbound connections
-allowed_transports = ["i2p", "i2p+tls"]
+active_profiles = ["i2p"]
 
-## Addresses we want to advertise to peers
-external_addrs = ["i2p://youraddress.b32.i2p:25551"]
+## I2p Socks5 proxy
+i2p_socks5_proxy = "socks5://127.0.0.1:4447"
 
+[net.profiles."i2p"]
 ## 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
+## Addresses we want to advertise to peers
+external_addrs = ["i2p://youraddress.b32.i2p:26661"]
 
-## Inbound connection slots
-inbound_connections = 64
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:26661"]
 
-## I2p Socks5 proxy
-i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+## Connection settings with default values applicable for each profile separately
+#outbound_connect_timeout = 60
+#channel_handshake_timeout = 55
+#channel_heartbeat_interval = 90
 ```
 
 ### Bridge node
 
 A bridge node is a node that offers connectivity via multiple transport layers. 
 This provides the most benefit for the health of the network. This is the most 
-maximally compatible node for people that wish to support the network. You can 
+maximally compatible node for people that wish to support the network. It can
+be enabled by adding multiple profiles to the `active_profiles` list. You can
 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.
@@ -168,40 +185,61 @@ find a complete example config file for `darkirc-mixed.toml` in
 <!-- 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
 
+## Outbound connection slots
+outbound_connections = 8
+
+## Inbound connection slots
+inbound_connections = 64
+
+## I2p Socks5 proxy
+i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+
 ## Whitelisted transports for outbound connections
-allowed_transports = ["tcp+tls", "tor", "i2p"]
+active_profiles = ["tcp+tls", "tor", "i2p"]
+
+## Transports to be mixed
+mixed_profiles = []
+
+[net.profiles."tcp+tls"]
+## Seed nodes to connect to
+seeds = ["tcp+tls://lilith0.dark.fi:25551", "tcp+tls://lilith1.dark.fi:25551"]
+
+## P2P accept addresses
+inbound = ["tcp+tls://0.0.0.0:26661", "tcp+tls://[::]:26661"]
 
 ## 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", "i2p://youraddress.b32.i2p"]
+external_addrs = ["tcp+tls://MY_IP_V4:26661", "tcp+tls://MY_IP_V6:26661", "tcp+tls://my.resolveable.address:26661"]
 
-## Seed nodes to connect to 
+[net.profiles."tor"]
+## Seed nodes to connect to
 seeds = [
-    "tcp+tls://lilith1.dark.fi:5262",
     "tor://g7fxelebievvpr27w7gt24lflptpw3jeeuvafovgliq5utdst6xyruyd.onion:25552",
     "tor://yvklzjnfmwxhyodhrkpomawjcdvcaushsj6torjz2gyd7e25f3gfunyd.onion:25552",
-    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
 ]
 
 ## P2P accept addresses
-inbound = ["tcp://127.0.0.1:25551", "tcp+tls://0.0.0.0:26661", "tcp+tls://[::]:26661"]
+inbound = ["tcp://127.0.0.1:26662"]
 
-## Outbound connection slots
-outbound_connections = 8
+## Addresses we want to advertise to peers
+external_addrs = ["tor://youraddress.onion:26662"]
 
-## Inbound connection slots
-inbound_connections = 64
+[net.profiles."i2p"]
+## Seed nodes to connect to
+seeds = [
+    ##TODO: replace with an official seed address
+    "i2p://6l2rdfriixo2nh5pr5bt555lyz56qox2ikzia4kuzm4okje7gtmq.b32.i2p:5262"
+]
 
-## Transports to be mixed
-mixed_transports = ["tcp+tls", "tcp"]
+## Manual peers to connect to
+#peers = []
 
-## I2p Socks5 proxy
-i2p_socks5_proxy = "socks5://127.0.0.1:4447"
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:26663"]
+
+## Addresses we want to advertise to peers
+external_addrs = ["i2p://youraddress.b32.i2p:26663"]
 ```
 
 ## Test your node

+ 30 - 22
doc/src/misc/nodes/tor-guide.md

@@ -42,45 +42,52 @@ connecting to the network. You will not advertise an external address.
 
 ```toml
 ## connection settings
-outbound_connect_timeout = 60
-channel_handshake_timeout = 55
-channel_heartbeat_interval = 90
 outbound_peer_discovery_cooloff_time = 60
 
+## Outbound connection slots
+outbound_connections = 8
+
 ## Whitelisted transports for outbound connections
-allowed_transports = ["tor", "tor+tls"]
+active_profiles = ["tor"]
+
+## Transports to be mixed
+mixed_profiles = []
 
-## Seed nodes to connect to 
+[net.profiles."tor"]
+## Seed nodes to connect to
 seeds = [
     "tor://g7fxelebievvpr27w7gt24lflptpw3jeeuvafovgliq5utdst6xyruyd.onion:25552",
     "tor://yvklzjnfmwxhyodhrkpomawjcdvcaushsj6torjz2gyd7e25f3gfunyd.onion:25552",
 ]
-
-## Outbound connection slots
-outbound_connections = 8
-
-## Transports to be mixed
-mixed_transports = []
 ```
 
 #### Socks5 proxy node settings
-If we want to route all our connections through the `socks5` proxy provided by Tor, we can enable the Socks5 proxy 
-transport in our settings.
+If we want to route all our connections through the `socks5` proxy provided by Tor,
+we can add the `socks5` and `socks5+tls` profiles to `active_profiles` and enable
+transport mixing by adding `tor` and `tcp+tls` to `mixed_profiles`. Enabling
+transport mixing helps us to connect to `tor` and `tcp+tls` endpoints through
+our socks5 proxy.
 
 When using `Whonix`, this configuration helps prevent the `Tor over Tor` issue.
-Ensure that the `tor_socks5_proxy` field is correctly set, if your tor socks5 proxy is running on a different 
-host or port.
+Ensure that the `tor_socks5_proxy` field is correctly set.
 
-<u><b>Note</b></u>: With this setup, our node will connect to both Tor and clearnet nodes through the Socks5 proxy.
+<u><b>Note</b></u>: With this setup, our node will connect to both Tor and clearnet
+nodes through the Socks5 proxy.
 ```toml
 ## Whitelisted transports for outbound connections
-allowed_transports = ["socks5", "socks5+tls", "tcp+tls", "tor"]
+active_profiles = ["socks5", "socks5+tls", "tcp+tls", "tor"]
 ## Transports to be mixed
-mixed_transports = ["tor", "tcp+tls"]
+mixed_profiles = ["tor", "tcp+tls"]
 ## Tor Socks5 proxy
 tor_socks5_proxy = "socks5://127.0.0.1:9050"
 ```
-If you prefer to connect only to `tor` nodes, remove `tcp+tls` from both allowed and mixed transports.
+If you prefer to connect only to `tor` nodes, modify the above config like below.
+```toml
+## Whitelisted transports for outbound connections
+active_profiles = ["socks5", "tor"]
+## Transports to be mixed
+mixed_profiles = ["tor"]
+```
 
 ### Inbound node settings
 
@@ -150,14 +157,15 @@ Note your `.onion` address and the ports you used while setting up the
 hidden service, and add the following settings to your configuration file:
 
 ```toml
+## Inbound connection slots
+inbound_connections = 64
+
+[net.profiles."tor"]
 ## Addresses we want to advertise to peers
 external_addrs = ["tor://youraddress.onion:25551"]
 
 ## P2P accept addresses
 inbound = ["tcp://127.0.0.1:25551"]
-
-## Inbound connection slots
-inbound_connections = 64
 ```
 
 ## Connect and test your node