Can anyone check if my safe network is running?

[update]

Currently my network died, because I don’t know how to upgrade without completely killing it.
And there’s a bug in the new sn_node version.

[/update]

Hey there.
I want to check if my first message on my self-hosted safe network is visible from the rest of the world.

Setup

sn_cli: 0.19.0

Steps

Create the following file:

~/.safe/client/sn_client.config

{
    "hard_coded_contacts": [
        "[2001:983:8610:1:854:efb1:52e6:85a3]:12000"
    ],
    "ip": "your.ip.v6.address",
    "forward_port": false,
    "fresh": true,
    "clean": true
}

Then enter this command

safe cat safe://hyryyry6xfympiygxx7p4d8puuwwy6rkqdyc5s1gdwd9cums5t5ez3dewnrnra

Please feel free to add your own files.

11 Likes
willie@gagarin:~$ safe cat safe://hy8oycycfzs8a4y4x4p31tso5ajo38xk7j1sqtfkzw6zaf3ifutnkriyh9y
[2021-02-01T01:06:40Z ERROR safe] sn_cli error: Failed to connect: [Error] ConnectionError - Failed to connect to the SAFE Network: QuicP2p(EmptyBootstrapNodesList)

In the steps listed above I think you should have

echo "\"83.163.103.119:12000\"" | tee ~/.safe/node/yrop_node_connection_info.config
as step 1

OR as I did - insert at step 2
cp ~/.safe/node/mynetwork_node_connection_info.config ~/.safe/node/yrop_node_connection_info.config

So from the error above, I cannot tell if your network is running cos I cant test ANY network.

EDIT: cannot test any at this stage possibly because I have not run safe auth restart.

BUT I thought we did not need a safe unlocked before simply reading an address on the network

7 Likes

I gave it a quick try but couldn’t bootstrap, looking at the logs the problem seems to be that the genesis Elder is returning the list of the other Elders using their LAN address and not the public IP address:

[2021-02-01T01:11:35Z TRACE sn_client::connection_manager] HandshakeResponse::Join Elders: ([(0c496e.., 192.168.178.24:12000), (6590b4.., 192.168.178.24:53624), (762921.., 192.168.178.24:48507), (f23477.., 192.168.178.24:33307), (f8bf84.., 192.168.178.24:47300)])

How did you launch the network? which tool and args you passed to it?

This is how I can see those logs with CLI:

RUST_LOG=sn_api,sn_client=trace safe cat safe://hy8oycypiop6bqnsnr5j5xda3ejsbb5hqi5u1ubq3prr9y7p83p1pgmbdga
7 Likes

returns this here

$ RUST_LOG=sn_api,sn_client=trace safe cat safe://hy8oycypiop6bqnsnr5j5xda3ejsbb5hqi5u1ubq3prr9y7p83p1pgmbdga
[2021-02-01T01:17:06Z DEBUG sn_api::api::app::safe_client] Connecting to SAFE Network...
[2021-02-01T01:17:06Z DEBUG sn_api::api::app::safe_client] Client to be instantiated with specific pk?: None
[2021-02-01T01:17:06Z DEBUG sn_api::api::app::safe_client] Bootstrap contacts list set to: None
[2021-02-01T01:17:06Z INFO  sn_client::client] Client started for new randomly created pk: PublicKey::Ed25519(376ed2..)
[2021-02-01T01:17:06Z TRACE sn_client::config_handler] Not available: /home/willie/.safe/client/sn_client.config
[2021-02-01T01:17:06Z TRACE sn_client::config_handler] Reading: /home/willie/.safe/node/node_connection_info.config
[2021-02-01T01:17:06Z INFO  sn_client::config_handler] Could not parse: invalid type: floating point `192.168`, expected socket address at line 1 column 8 (Error("invalid type: floating point `192.168`, expected socket address", line: 1, column: 8))
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Trying to bootstrap to the network with public_key: PublicKey::Ed25519(376ed2..)
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Bootstrapping with contacts...
[2021-02-01T01:17:06Z TRACE sn_client::client] Error connecting to network! Retrying... (1)
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Trying to bootstrap to the network with public_key: PublicKey::Ed25519(376ed2..)
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Bootstrapping with contacts...
[2021-02-01T01:17:06Z TRACE sn_client::client] Error connecting to network! Retrying... (2)
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Trying to bootstrap to the network with public_key: PublicKey::Ed25519(376ed2..)
[2021-02-01T01:17:06Z TRACE sn_client::connection_manager] Bootstrapping with contacts...

Your network’s contacts list is corrupted, it’s related to what you were pointing out before, but the way I did to configure it was just like @folaht did it in OP but for step 3 I ran:

$ safe networks add yrop ~/.safe/node/mynetwork_node_connection_info.config
2 Likes

OK I just checked

192.168.100.6:12000
/home/willie/.safe/node/node_connection_info.config (END)

is obviously wrong - that s not going anywhere interesting :slight_smile:

I will try as you suggest above

2 Likes

Sorry about all of this. It should be ~/.safe/node/node_connection_info.config. Edited above.

I think the networks command should have the option to add the ip and port.

3 Likes

So
echo "\"83.163.103.119:12000\"" | tee ~/.safe/node/node_connection_info.config ?

2 Likes

I see he changed the OP now, this is how I did it myself:

$ echo "\"83.163.103.119:12000\"" | tee ~/.safe/node/folaht_node_connection_info.config
$ safe networks add folaht ~/.safe/node/folaht_node_connection_info.config
$ safe networks switch folaht
$ RUST_LOG=sn_api,sn_client=trace safe cat safe://hy8oycypiop6bqnsnr5j5xda3ejsbb5hqi5u1ubq3prr9y7p83p1pgmbdga
2 Likes

I agree, we can add the possibility of adding with ip and port, it seems it’ll be helpful.

2 Likes

OK that becomes more informative

willie@gagarin:~$ RUST_LOG=sn_api,sn_client=trace safe cat safe://hy8oycypiop6bqnsnr5j5xda3ejsbb5hqi5u1ubq3prr9y7p83p1pgmbdga
[2021-02-01T01:27:00Z DEBUG sn_api::api::app::safe_client] Connecting to SAFE Network...
[2021-02-01T01:27:00Z DEBUG sn_api::api::app::safe_client] Client to be instantiated with specific pk?: None
[2021-02-01T01:27:00Z DEBUG sn_api::api::app::safe_client] Bootstrap contacts list set to: None
[2021-02-01T01:27:00Z INFO  sn_client::client] Client started for new randomly created pk: PublicKey::Ed25519(51cce6..)
[2021-02-01T01:27:00Z TRACE sn_client::config_handler] Not available: /home/willie/.safe/client/sn_client.config
[2021-02-01T01:27:00Z TRACE sn_client::config_handler] Reading: /home/willie/.safe/node/node_connection_info.config
[2021-02-01T01:27:00Z TRACE sn_client::config_handler] New contact added to the hard-coded contacts list: 83.163.103.119:12000
[2021-02-01T01:27:00Z TRACE sn_client::connection_manager] Trying to bootstrap to the network with public_key: PublicKey::Ed25519(51cce6..)
[2021-02-01T01:27:00Z TRACE sn_client::connection_manager] Bootstrapping with contacts...
[2021-02-01T01:27:00Z TRACE sn_client::connection_manager] Sending handshake request to bootstrapped node...
[2021-02-01T01:27:01Z TRACE sn_client::connection_manager] HandshakeResponse::Join Elders: ([(0c496e.., 192.168.178.24:12000), (6590b4.., 192.168.178.24:53624), (762921.., 192.168.178.24:48507), (f23477.., 192.168.178.24:33307), (f8bf84.., 192.168.178.24:47300)])
[2021-02-01T01:27:06Z WARN  sn_client::connection_manager] Failed to connect to Elder @ : Connection lost
[2021-02-01T01:27:06Z WARN  sn_client::connection_manager] Connected to only 0 elders.
[2021-02-01T01:27:12Z WARN  sn_client::connection_manager] Failed to connect to Elder @ : Connection lost
[2021-02-01T01:27:12Z WARN  sn_client::connection_manager] Connected to only 0 elders.
[2021-02-01T01:27:17Z WARN  sn_client::connection_manager] Failed to connect to Elder @ : Connection lost
[2021-02-01T01:27:17Z WARN  sn_client::connection_manager] Connected to only 0 elders.
[2021-02-01T01:27:23Z WARN  sn_client::connection_manager] Failed to connect to Elder @ : Connection lost
[2021-02-01T01:27:23Z WARN  sn_client::connection_manager] Connected to only 0 elders.
[2021-02-01T01:27:28Z WARN  sn_client::connection_manager] Failed to connect to Elder @ : Connection lost
[2021-02-01T01:27:28Z WARN  sn_client::connection_manager] Connected to only 0 elders.
[2021-02-01T01:27:28Z TRACE sn_client::client] Error connecting to network! Retrying... (1)
[2021-02-01T01:27:28Z TRACE sn_client::connection_manager] Trying to bootstrap to the network with public_key: PublicKey::Ed25519(51cce6..)
[2021-02-01T01:27:28Z TRACE sn_client::connection_manager] Bootstrapping with contacts...
[2021-02-01T01:27:28Z TRACE sn_client::connection_manager] Sending handshake request to bootstrapped node...
[2021-02-01T01:27:28Z TRACE sn_client::connection_manager] HandshakeResponse::Join Elders: ([(0c496e.., 192.168.178.24:12000), (6590b4.., 192.168.178.24:53624), (762921.., 192.168.178.24:48507), (f23477.., 192.168.178.24:33307), (f8bf84.., 192.168.178.24:47300)])

and its still running but I suspect we will learn someting from what we have so far

@bochaco - you are right - we are trying to connect to Elders that are only broadcasting an internal LAN ip

2 Likes

Yeah you got the same state as me, so it’s just that, it just needs the IPs of all elders to be shared with public ip, we’ll see what @folaht says about how he launched the network, and then it should be fine, at least we are successfully connecting to the genesis Elder.

4 Likes

Yes this looks like good progress thank you for putting this up @fohlat

2 Likes

Wait, what should the nodes be listening on?
I’ve got them listening on my LAN adress and have port 12000 forwarded.
Do all eleven of them need to opened?

[folaht@Rezosur-uq logs]$ netstat -tulpn
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
udp    80640      0 192.168.178.24:47300    0.0.0.0:*                           56915/sn_node       
udp        0      0 192.168.178.24:59761    0.0.0.0:*                           56939/sn_node       
udp        0      0 192.168.178.24:53624    0.0.0.0:*                           56947/sn_node       
udp   169728      0 192.168.178.24:33307    0.0.0.0:*                           56872/sn_node       
udp      768      0 192.168.178.24:45743    0.0.0.0:*                           56896/sn_node       
udp        0      0 192.168.178.24:60446    0.0.0.0:*                           56888/sn_node       
udp   177408      0 192.168.178.24:48507    0.0.0.0:*                           56880/sn_node       
udp        0      0 192.168.178.24:50579    0.0.0.0:*                           56906/sn_node       
udp     2304      0 0.0.0.0:42410           0.0.0.0:*                           56965/sn_authd      
udp     1536      0 0.0.0.0:48563           0.0.0.0:*                           56965/sn_authd      
udp        0      0 192.168.178.24:44597    0.0.0.0:*                           56923/sn_node       
udp     3072      0 0.0.0.0:40632           0.0.0.0:*                           56965/sn_authd      
udp      768      0 192.168.178.24:12000    0.0.0.0:*                           56864/sn_node       
udp     2304      0 0.0.0.0:59318           0.0.0.0:*                           56965/sn_authd      
udp        0      0 192.168.178.24:59447    0.0.0.0:*                           56931/sn_node       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -                   
udp6       0      0 ::1:33000               :::*                                56965/sn_authd      
udp6       0      0 :::546                  :::*                                -                   
3 Likes

Yes, all of them (Elders) need to be exposed, remember clients connect to all Elders in the section. Also, when they are joining the section they should be registering themselves with public IP so when a client requests for the list of them it gets the list of public IPs, thus you need to start each of them setting them to listen on the public IP as you did with the genesis (the on on port 12000), that’s why I was asking how you launched them?, if you are using the sn_launch_tool, I think when you pass the --ip it will set it to all of them, but if you are launching them manually and individually you’ll have to pass that to each sn_node command yourself.

4 Likes

But you were able to connect to one of them correct?
So shouldn’t it be working right now?
I’ve opened up the ports.

If it works/doesn’t work, I’ll try public ip next.

1 Like

Yes, correct, which is the one giving me the list of all Elders in the section:

[2021-02-01T01:11:35Z TRACE sn_client::connection_manager] HandshakeResponse::Join Elders: ([(0c496e.., 192.168.178.24:12000), (6590b4.., 192.168.178.24:53624), (762921.., 192.168.178.24:48507), (f23477.., 192.168.178.24:33307), (f8bf84.., 192.168.178.24:47300)])

But the list is with LAN IPs not with the public IP

No. Even that you opened up the ports now, the list the client is getting is with LAN IPs, so it won’t reach them.

2 Likes

Yes confirming that - logs look much as before

[2021-02-01T02:06:47Z TRACE sn_client::connection_manager] HandshakeResponse::Join Elders: ([(0c496e…, 192.168.178.24:12000), (6590b4…, 192.168.178.24:53624), (762921…, 192.168.178.24:48507), (f23477…, 192.168.178.24:33307), (f8bf84…, 192.168.178.24:47300)])

Quick off-topic in the help for sn_launch_tool we have

 -d, --nodes-dir <nodes-dir>    
            Path where the output directories for all the notes are written [default: ./nodes]

[default: ./nodes] ?!?!! surely ~/.safe/node Or have I missed something?

The default of the sn_launch_tool is that one, so it’s correct. It’s just that the CLI sets a diff path (~/.safe/node) for the commands it exposes, so it’s overriding the default one. I’ll send a PR to fix the typo, nice catch!

1 Like