Bläddra i källkod

add network-troubleshooting.md

darkfi 1 år sedan
förälder
incheckning
53ab9b1e48
2 ändrade filer med 256 tillägg och 0 borttagningar
  1. 169 0
      c
  2. 87 0
      doc/src/misc/network-troubleshooting.md

+ 169 - 0
c

@@ -0,0 +1,169 @@
+## This is the darkirc configuration file.
+## Review it carefully.
+
+## JSON-RPC listen URL
+#rpc_listen = "tcp://127.0.0.1:26660"
+
+## IRC listen URL
+#irc_listen = "tcp://127.0.0.1:6667"
+
+## TLS certificate path if IRC acceptor uses TLS (optional)
+#irc_tls_cert = "/etc/letsencrypt/darkirc/fullchain.pem"
+
+## TLS secret key path if IRC acceptor uses TLS (optional)
+#irc_tls_secret = "/etc/letsencrypt/darkirc/privkey.pem"
+
+## Sets Datastore Path
+#datastore = "~/.local/darkfi/darkirc/darkirc_db"
+
+## Sets DB logs replay datastore path
+#replay_datastore = "~/.local/darkfi/darkirc/replayed_darkirc_db"
+
+## Run in replay mode to store Sled DB instructions
+## (for eventgraph debugging tool)
+#replay_mode = false
+
+## List of channels to autojoin for new client connections
+autojoin = [
+    "#dev",
+    "#memes",
+    "#philosophy",
+    "#markets",
+    "#math",
+    "#random",
+    "#lunardao",
+]
+
+## IRC server specific password
+## (optional, but once configured, it is required from the IRC client side)
+#password = "CHANGE_ME"
+
+## Number of attempts to sync the DAG.
+#sync_attempts = 5
+
+## Number of seconds to wait before trying again if sync fails.
+#sync_timeout = 10
+
+# Log to file. Off by default.
+#log = "/tmp/darkirc.log"
+# Set log level. 1 is info (default), 2 is debug, 3 is trace
+#verbose = 2
+
+# P2P network settings
+[net]
+# Path to the P2P datastore
+datastore = "~/.local/darkfi/darkirc"
+
+# Path to a configured hostlist for saving known peers
+hostlist = "~/.local/darkfi/darkirc/p2p_hostlist.tsv"
+
+## P2P accept addresses
+#inbound = ["tcp+tls://0.0.0.0:26661", "tcp+tls://[::]:26661"]
+#inbound = ["tor://127.0.0.1:26661"]
+
+## Outbound connection slots
+# outbound_connections = 8
+
+## Inbound connection slots
+#inbound_connections = 8
+
+## White connection percent
+# gold_connect_count = 2
+
+## White connection percent
+# white_connect_percent = 70
+
+## Addresses we want to advertise to peers (optional)
+## These should be reachable externally
+#external_addrs = ["tcp+tls://my.resolveable.address:26661"]
+
+## Seed nodes to connect to 
+seeds = [
+    #"tcp+tls://lilith0.dark.fi:5262",
+    "tcp+tls://lilith1.dark.fi:5262",
+    #"tor://czzulj66rr5kq3uhidzn7fh4qvt3vaxaoldukuxnl5vipayuj7obo7id.onion:5263",
+    #"tor://vgbfkcu5hcnlnwd2lz26nfoa6g6quciyxwbftm6ivvrx74yvv5jnaoid.onion:5273",
+]
+
+## Manual peers to connect to
+#peers = []
+
+# Whitelisted transports for outbound connections
+allowed_transports = ["tcp+tls"]
+#allowed_transports = ["tor"]
+#allowed_transports = ["tor", "tor+tls"]
+
+# Enable transport mixing
+# Allows mixing transports, e.g. tor+tls:// connecting to tcp+tls://
+# By default this is not allowed.
+transport_mixing = false
+
+# Nodes to avoid interacting with for the duration of the program, in the
+# format ["host", ["scheme", "scheme"], [port, port]].
+# If scheme is left empty it will default to "tcp+tls". 
+# If ports are left empty all ports from this peer will be blocked.
+#blacklist = [["example.com", ["tcp"], [8551, 23331]]]
+
+## ====================
+## IRC channel settings
+## ====================
+##
+## You can create a shared secret with `darkirc --gen-secret`.
+## Never share this secret over unencrypted channels or with someone
+## who you do not want to be able to read all the channel messages.
+## Use it like this example:
+#[channel."#foo"]
+#secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"
+#topic = "My secret channel"
+
+[channel."#dev"]
+topic = "DarkFi Development HQ"
+
+[channel."#markets"]
+topic = "Crypto Market Talk"
+
+[channel."#math"]
+topic = "Math Talk"
+
+[channel."#memes"]
+topic = "DarkFi Meme Reality"
+
+[channel."#philosophy"]
+topic = "Philosophy Discussions"
+
+[channel."#random"]
+topic = "/b/"
+
+[channel."#lunardao"]
+topic = "LunarDAO talk"
+
+## ================
+## Contact settings
+## ================
+##
+## In this section we configure our contacts and people we want to
+## have encrypted DMs with. Your contacts' public keys should be
+## retrieved manually. Whenever this is changed, you can send a
+## SIGHUP signal to the running darkirc instance to reload these.
+##
+## The secret key used to decrypt direct messages sent to your public
+## key (the counterpart to this secret key).
+## It is also recommended to paste the public key here as a comment in
+## order to be able to easily reference it for sharing.
+##
+## You can generate a keypair with: darkirc --gen-chacha-keypair
+## and replace the secret key below with the generated one.
+## **You should never share this secret key with anyone**
+#[crypto]
+#dm_chacha_secret = "AKfyoKxnHb8smqP2zt9BVvXkcN7pm9GnqqyuYRmxmWtR"
+
+## This is where you put other people's public keys. The format is:
+## [contact."nickname"]. "nickname" can be anything you want.
+## This is how they will appear in your IRC client when they send you a DM.
+##
+## Example (set as many as you want):
+#[contact."satoshi"]
+#dm_chacha_public = "C9vC6HNDfGQofWCapZfQK5MkV1JR8Cct839RDUCqbDGK"
+#
+#[contact."anon"]
+#dm_chacha_public = "7iTddcopP2pkvszFjbFUr7MwTcMSKZkYP6zUan22pxfX"

+ 87 - 0
doc/src/misc/network-troubleshooting.md

@@ -0,0 +1,87 @@
+# Network Troubleshooting
+
+If you're having network issues, refer to this page to debug various issues. If you see inconsistencies in the docs: always trust bin/darkirc/darkirc_config.toml or whichever respective apps' repo config file. Documentation updates are a current WIP.
+
+The default location for config files is `~/.config/darkfi`
+
+## Check liveness of seed nodes
+
+Use the `ping` tool to check if your node can access the seeds on the network. To access the `ping` tool, in the `~/darkfi/script/ping` directory run `cargo run main.rs`. Once completed, you can now use the `ping` tool in the `~/darkfi/script/ping/target/debug` directory. 
+
+Ping tcp seeds located in your config file
+```
+$ ./ping tcp://lilith0.dark.fi:5262
+$ ./ping tcp://lilith1.dark.fi:5262
+```
+If the tcp seeds are reachable, you'll receive a `Connected!` output
+
+ping tcp+tls seeds located in your config file
+```
+$ ./ping tcp+tls://lilith0.dark.fi:5262
+$ ./ping tcp+tls://lilith1.dark.fi:5262
+```
+If the tcp+tls seeds are reachable, you'll receive a `Connected!` output
+
+If these work, then your node is connected to seeds on the network.
+
+## dnet
+
+dnet is a simple tui to explore darkfi p2p network topology. You can use dnet to gather more network information. dnet displays:
+1. Active p2p nodes
+2. Outgoing, incoming, manual and seed sessions
+3. Each associated connection and recent messages.
+
+To install dnet, go [here](https://codeberg.org/darkrenaissance/darkfi/src/branch/master/bin/dnet/README.md#run).
+You can use dnet to view the network topology and see how your node interacts within the network. dnet log information is created in `bin/dnet/dnet.log`
+
+
+## Inbound
+
+To see if your address is reachable to others in the network, you'll need to use separate device to `ping` your external address. 
+[Generate an external address here](https://darkrenaissance.github.io/darkfi/clients/tor_inbound.html?highlight=tor#1-install-tor).
+For example purposes, let's assume your external address is `jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4p7cyd.onion`. `ping` your generated external address from a separate device. 
+```
+$ ./ping jamie3vkiwibfiwucd6vxijskbhpjdyajmzeor4mc4i7yopvpo4p7cyd.onion
+```
+If your external address is reachable, you'll receive a `Connected!` prompt
+
+## Check Tor Connection
+You can verify if your local node is running over Tor. Execute this command in `~/darkfi/script`. You'll need to install pysocks `pip install pysocks` prior to running `tor-test.py` the first time.
+```
+$ python3 tor-test.py 
+```
+If your local node is running Tor, the response should be an IP address. An error will return if Tor isn't running.
+
+### Helpful Debug Information
+
+If you're looking to debug an issue, try these helpful tools
+
+#### Logs in Debug Mode
+
+When looking for log information refer to the respective apps' config file. 
+Change the following settings in the configuration file, `~/.config/darkirc/darkirc_config.toml` in this example
+
+```toml
+# Log to file. Off by default.
+log = "/tmp/darkirc.log"
+# Set log level. 1 is info (default), 2 is debug, 3 is trace
+verbose = 2
+```
+#### Config File
+
+Your config files are generated in your `~/.config/darkirc` directory. You'll have to run each daemon once for the app to spawn a config file, which you can review and edit. There is also helpful information within the config files.
+
+#### Node Information Script
+
+If you're looking for information about your node, including inbound, outbound, and seed connections, execute this command in `~/darkfi/script`
+```
+$ python3 node_get-info.py
+```
+
+#### Hostlist Issues
+
+If you receive DAG sync issues, verify:
+1. a hostlist is set in the config file of the respective app.
+2. There are hosts in the hostlists (you should get hostlists from the default seed on the first run). You can find the hostlist files within the respective apps' repo. For example darkirc's default hostlist location is `~/.local/darkfi/darkirc/hostlist.tsv`
+
+If you are running MacOS, you should [use tor](https://darkrenaissance.github.io/darkfi/clients/tor_inbound.html?highlight=tor#hosting-anonymous-nodes).