Need help: My IPv6 test network tries to connect to

As I have an issue with IPv6 inside a podman container, I’m asked to create a test network outside of containers and see what the result is of that.
But for some reason I encounter a different issue, which is that all my nodes seem to be looking at

Anyone got any idea why that could be?

node_dir_1/sn_node.log to node_dir15/sn_node.log

 INFO 2022-03-17T07:08:37.003712Z [sn/src/node/api/]:
	 ➤ d9367e.. Bootstrapping a new node.
 ERROR 2022-03-17T07:09:13.399735Z [/cargo/registry/src/]:
	 ➤ bootstrap {bootstrap_nodes=[]}
	 ➤ Failed to bootstrap to the network, last error: timed out


 INFO 2022-03-17T22:05:38.063977Z [sn/src/node/api/]:
	 ➤ a15b0f.. Starting a new network as the genesis node (PID: 7217).
 INFO 2022-03-17T22:05:38.136114Z [sn/src/node/core/]:
	 ➤ Creating Liveness checks
 INFO 2022-03-17T22:05:38.136232Z [sn/src/node/core/]:
	 ➤ Liveness check: Liveness { unfulfilled_requests: {}, 
       closest_nodes_to: {} }
 INFO 2022-03-17T22:05:38.136387Z [sn/src/node/api/]:
	 ➤ a15b0f.. Genesis node started!. Genesis key PublicKey(00b4..13a5), 
       hex: 80b4...07e3
 INFO 2022-03-17T22:05:38.136485Z [sn/src/node/api/]:
	 ➤ Starting to probe network
 INFO 2022-03-17T22:05:38.136543Z [sn/src/node/api/]:
	 ➤ Starting cleaning up network links
 INFO 2022-03-17T22:05:38.136561Z [sn/src/node/api/]:
	 ➤ Writing our PrefixMap to disk
 INFO 2022-03-17T22:05:38.136566Z [sn/src/node/core/]:
	 ➤ Writing our latest PrefixMap to disk
 INFO 2022-03-17T22:05:38.140426Z [sn/src/node/api/]:
	 ➤ Node PID: 7217, prefix: Prefix(), name: a15b0f(10100001).., 
       age: 255, connection info: "[x:x:x:x:x:x:x:x]:12000"


HOST_IP=[$(ip -6 -o addr show up primary scope global | while read -r num dev fam addr rest; do echo ${addr%/*}; done | head -n 1)]

sn_node $VERBOSE \
  --idle-timeout-msec 5500 \
  --keep-alive-interval-msec 4000 \
  --skip-auto-port-forwarding \
  --local-addr $HOST_IP:$PORT \
  --public-addr $HOST_IP:$PORT \
  --log-dir $NODE_PATH/node_dir_0 \
  --root-dir $NODE_PATH/node_dir_0 \
  --first &

sleep 10

safe networks add sjefolaht
safe networks switch sjefolaht

for (( i = 1; i <= NUM_NODES; i++ ))
  PORT=$(($PORT_BASE + $i))
  sudo sn_node $VERBOSE \
    --idle-timeout-msec 5500 \
    --keep-alive-interval-msec 4000 \
    --skip-auto-port-forwarding \
    --local-addr $HOST_IP:$PORT \
    --public-addr $HOST_IP:$PORT \
    --log-dir $NODE_PATH/node_dir_$i \
    --root-dir $NODE_PATH/node_dir_$i &
  sleep 5

/home/folaht/.safe/cli/networks/sjefolaht_node_connection_info.config & /home/folaht/.safe/node/node_connection_info.config


Not sure if that can explain the problem you came across but I see a potential problem: I suspect that safe networks commands need that source node_connection_info.config exists and it’s possible that genesis node hasn’t created it yet.

Try adding sleep 10 after launching genesis node to give it some time to create this file.

1 Like

I see there is no set $HOST_PORT_BASE?


Good catch.

This means that ports used by non genesis nodes are 1, 2, 3, … This is probably not what was intended but I am not sure this is the source of problem.

If a port number is already in use by another program, there should be a more explicit error (something like port already in use).


sure, just an error I spotted


Great observations guys!

Unfortunetaly, neither of those solved my issue.

1 Like

Does sn_node look at the .safe/cli/networks directory at all? I am not so sure sn_node has any knowledge of the CLI. Maybe by setting the logging to debug you can see what configuration is actually loaded. From what I quickly can gather, if --hard-coded-contacts is not provided, it will search for .safe/node/node_connection_info.config?

Else, it might be a better solution to pass --hard-coded-contacts to sn_node in scripts…


Yes indeed, but we need to know beforehand just what is the contents of --hard-coded-contacts. That will require another discovery step at least. Hints welcome :slight_smile:

The run-baby-fleming option does this but it is entirely local so we know the hard-coded-contacts before we start. For long-running networks also this will not be a problem. But for wee ad-hoc testnets as we have now its not always trivial. To me anyway. Educate me folks :slight_smile:

1 Like

That config is the same as cli/networks one.


I found out what I was doing wrong.
I got confused over which user needed to run the script as in the test network it’s run as user/root as the safe nodes are run in the container as root and so I replicated that as user/root in the other shell scrip, but it needs to be run as just root.

This topic was automatically closed after 60 days. New replies are no longer allowed.