DialNet (or Are You Listening?) [31/08/23 Testnet] [Offline]

Over the past weeks we have seen some nodes that do not receive records. On further inspection, it seemed like peers of such nodes didn’t add them to their routing table. In essence this means those nodes aren’t seen as part of the network, but function like clients.

When a new node connects to its peers, those peers have to make sure that the new node is actually reachable. A connection from A to B differs from a connection from B to A, which is because of the wonderful world of firewalls, routers and TCP ports. So, with an incoming connection we need to try and establish an outgoing connection. And that’s what we do in this testnet.

Objective

Ascertain if we still see nodes idling with zero records.

Network Details

Node version: 0.88.52
Client version: 0.80.63
Faucet url: 178.128.45.252:8000
SAFE_PEERS: /ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm
Alternatives:

 "/ip4/165.232.188.170/tcp/41281/p2p/12D3KooWLaZxUymK1NHYcRs8J8sXkeH5LP13mbKHB2zJVdcv3mMz"
 "/ip4/139.59.254.28/tcp/39857/p2p/12D3KooWHd2ijijZi53Si2n8eetZH9uXauqC13oha5wYPSttaHx2"
 "/ip4/143.244.180.50/tcp/36087/p2p/12D3KooWLt3JqunUVN7SVYhg8q1L4yfExzc13wguKTUnQCcmek5i"
 "/ip4/167.99.113.190/tcp/44125/p2p/12D3KooWN6QXZsS9QDsozHNnZMcta4FTiQg14ESbN5V3X17xZ3so"
 "/ip4/146.190.148.23/tcp/43777/p2p/12D3KooWGpNDhDNyDyzMppTZP7b4JxQMya315vVrLLZaCnsytXpb"
 "/ip4/68.183.145.79/tcp/43367/p2p/12D3KooWAXG7k3D1cxy8eZXdh2HgwkpUoQ7816RKK68YXVK2z72Y"
 "/ip4/159.65.192.121/tcp/36285/p2p/12D3KooWH8t3GfKY3LZhg5wzb5x5vXyQepX1DG5UFPMdJfGk7QUh"
 "/ip4/167.99.68.228/tcp/45415/p2p/12D3KooWNzKi3djwB9tXLjMm9EdskadS1P6j1E6RtQPtXYvxn7nc"
 "/ip4/165.227.105.154/tcp/36355/p2p/12D3KooWAshU9LVKcgKiu1TSh2ehDz1q8d1FAJ7n5pvtbBPNZL7w"

We have 100 droplets running a total of 2001 nodes. One droplet has 2vcpu and 4GB of memory.


If you are a regular user, see the ‘quickstart’ section for getting up and running.

If you are a first-time user, or would like more information, see the ‘further information’ section.


Quickstart

If you already have safeup, you can obtain the client and node binaries:

safeup client --version 0.80.63
safeup node --version 0.88.52

Run a Node

Linux/macOS:

export SAFE_PEERS="/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"
SN_LOG=all safenode

Windows:

$env:SAFE_PEERS = "/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"
$env:SN_LOG = "all"; safenode

Connect to the Network

Linux/macOS:

export SAFE_PEERS="/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"
safe wallet get-faucet 178.128.45.252:8000
safe files upload <directory-path>

Windows:

$env:SAFE_PEERS = "/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"
safe wallet get-faucet 178.128.45.252:8000
safe files upload <directory-path>

Further Information

You can participate in the testnet either by connecting as a client or running your own node.

Connecting as a client requires the safe client binary; running a node requires the safenode binary.

Obtaining Binaries

We have a tool named safeup which is intended to make it easy to obtain the client, node, and other utility binaries.

Installing Safeup

On Linux/macOS, run the following command in your terminal:

curl -sSL https://raw.githubusercontent.com/maidsafe/safeup/main/install.sh | bash

On Windows, run the following command in a Powershell session (be careful to use Powershell, not cmd.exe):

iex (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/maidsafe/safeup/main/install.ps1")

On either platform, you may need to restart your shell session for safeup to become available.

Installing Binaries

After obtaining safeup, you can install binaries like so:

safeup client --version 0.80.63 # get a specific version
safeup node --version 0.88.52 # get a specific version

When participating in our testnets, it is recommended to use a specific version. In our project we release a new version of the binaries every time we merge new code. This happens frequently, so over the lifetime of a testnet, many new releases will probably occur. So for participating in this particular testnet, you may not want the latest version.

The binaries are installed to ~/.local/bin on Linux and macOS, and on Windows they go to C:\Users\<username>\safe. Windows doesn’t really have a standard location for binaries that doesn’t require elevated privileges.

The safeup tool will modify the PATH variable on Linux/macOS, or the user Path variable on Windows. The effect of this is that the installed binaries will then become available in your shell without having to refer to them with their full paths. However, if you’re installing for the first time, you may need to start a new shell session for this change to be picked up.

Running a Node

You can participate in the testnet by running your own node. At the moment, you may not be successful if you’re running the node from your home machine. This is a situation we are working on. If you run from a cloud provider like Digital Ocean or AWS, you should be able to participate.

You can run the node process like so:

# Linux/macOS
SN_LOG=all safenode

# Windows
$env:SN_LOG = "all"; safenode

This will output all the logs in the terminal.

Sometimes it will be preferable to output the logs to file. You can do this by running the node like so:

# Linux/macOS
SN_LOG=all safenode --log-output-dest data-dir

# Windows
$env:SN_LOG = "all"; safenode --log-output-dest data-dir

The location of data-dir is platform specific:

# Linux
~/.local/share/safe/node/<peer id>/logs

# macOS
/Users/<username>/Library/Application Support/safe/node/<peer id>/logs

# Windows
C:\Users\<username>\AppData\Roaming\safe\node\<peer-id>\logs

If you wish, you can also provide your own path:

# Linux/macOS
SN_LOG=all safenode --log-output-dest <path>

# Windows
$env:SN_LOG = "all"; safenode --log-output-dest <path>

The advantage of using the predefined data-dir location is you can run multiple nodes on one machine without having to specify your own unique path for each node and manage that overhead yourself.

Connecting as a Client

You can use the safe client binary to connect as a client and upload or download files to/from the network.

To connect, you must provide another peer, in the form of a multi address. You can find one in the ‘Network Details’ section at the top.

It is recommended to set the peer using the environment variable SAFE_PEERS. You can set this variable once and it will apply for the duration of your shell session:

# Linux/macOS
export SAFE_PEERS="/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"

# Windows
$env:SAFE_PEERS = "/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm"

NOTE: If you close and/or start a new shell session, you will be required to redefine this environment variable in the new session.

As an alternative to the environment variable, it’s also possible to use the --peer argument:

safe --peer="/ip4/178.128.45.252/tcp/32923/p2p/12D3KooWRokYkFYg698Wk1fm7RcDGj4tJ9dsdgDx6FgSypuhm8Pm" ...

However, this requires specifying the peer with each command.

Using the Client

You’ll first need to get some Safe Network Tokens:

safe wallet get-faucet 178.128.45.252:8000

You can now proceed to use the client, by, e.g., uploading files:

safe files upload <directory-path>

To download that same content:

safe files download

This will download the files to the default location, which is platform specific:

# Linux
~/.local/share/safe/client/downloaded_files

# macOS
/Users/<username>/Library/Application Support/safe/client/downloaded_files

# Windows
C:\Users\<username>\AppData\Roaming\safe\client\downloaded_files

To download to a particular file or directory:

safe file download [directory/filename] [XORURL]

Troubleshooting

Cleanup

If you’ve used previous versions of the network before and you find problems when running commands, you may want to consider clearing out previous data (worthless DBCs from previous runs, old logs, old keys, etc.).

# Linux
rm -rf ~/.local/share/safe

# macOS
rm -rf ~/Library/Application\ Support/safe

# Windows
rmdir /s C:\Users\<username>\AppData\Roaming\safe

If you encounter a problem running any of our binaries on Windows, it’s possible you need the Visual C++ Redistributable installed.

34 Likes

First now to get this installed now I have a new vps

14 Likes

Right from the start, my node got 3 records.
Which means no chunkless node for me this time :slight_smile:

19 Likes

mental miss fire the upload never completed

4 Likes

Did you regenerated wallet?
I forgot to do this at first and also saw hanging.

4 Likes

Ii ran rm -rf ~/.local/share/safe first that should have cleared out my old wallet.

they were large files several gigabyte images

*********edit

think its that we dont have enough nodes so storage is very expensive :slight_smile:

🔗 Connected to the Network                                                                                            Loaded wallet from "/home/ubuntu/.local/share/safe/client/wallet" with balance Token(99999999872)
Preparing (chunking) files at 'crow.mkv'...
Making payment for 4524 Chunks that belong to 1 file/s.
Error: Transfer error Not enough balance, 99.999999872 available, 636696397.319503872 required

Caused by:
    Not enough balance, 99.999999872 available, 636696397.319503872 required

Location:
    sn_cli/src/subcommands/wallet.rs:305:26
7 Likes

Delighted to report that a random 8 MB file which gave me no end of grief on a previous testnet uploaded and downloaded with no issues! Sometimes it’s the little things in life that give the most joy :smiley:

16 Likes

Interesting price there I wonder how it was arrived at (seems v high on the face of it…)

Could you give us full client logs perchance @aatonnomicc ? (ie, preface your command with SN_LOG=all and include --log-output-dir=data-dir to get client logs… full examples in the OP for that)


It’s worth noting the price per chunk changes are already in main, but not this testnet, but still good to know how we got there!

9 Likes

This equals to 0x8D6000000000000.
Divided by 4524 = 0x800000000000.

2 Likes

I’ve uploaded 0.1 GB file (0ffcbc215078bb8152c4c0fe84e4ba38e5ffa0fc55cd4befe8caadd55e2c5224).
It took 23 minutes, received 1.7 GB and sent 0.8 GB.
Price was fine: Successfully made payment of 3424 for 214 records. (At a cost per record of Token(16).)

15 Likes

Client tried to upload 89 files total of 1.9GiB (file on average 15mb) but failed:
Error: Failed to send tokens due to Network Error Not enough store cost quotes returned from the network to ensure a valid fee is paid.

2 Re-attempt, 1 file but still failed with same error.

Preparing (chunking) files at 'Unsupervised Learning Algorithms - Celebi, M. Emre;Aydin, Kemal;.pdf'...
Making payment for 25 Chunks that belong to 1 file/s.
Error: Failed to send tokens due to Network Error Not enough store cost quotes returned from the network to ensure a valid fee is paid.

Location:
    sn_cli/src/subcommands/wallet.rs:308:16

real	0m16.777s
user	0m1.590s
sys	0m0.652s

Preparing (chunking) files at 'Open Government - Daniel Lathrop.pdf'...
Making payment for 41 Chunks that belong to 1 file/s.
Error: Failed to send tokens due to Network Error Not enough store cost quotes returned from the network to ensure a valid fee is paid.

Location:
    sn_cli/src/subcommands/wallet.rs:308:16

real	0m17.383s
user	0m1.950s
sys	0m0.780s

I cleaned my files up before and also got new tokens successfully:

safe wallet balance
Built with git version: 256182b / main / 256182b
Instantiating a SAFE client...
🔗 Connected to the Network                                                                                
100.000000000
5 Likes

tried again log file

safe files download safe.log 15cbb4491996257c06857b391cd5b5f4386ad0a1dda9e019f20e528f21dfefa9
ubuntu@safe:~/safe$ SN_LOG=all safe --log-output-dest ./log files upload crow.mkv
Logging to directory: "./log"
Using SN_LOG=all
Built with git version: 794fca7 / main / 794fca7
Instantiating a SAFE client...
🔗 Connected to the Network                                                                                                                                                                     Loaded wallet from "/home/ubuntu/.local/share/safe/client/wallet" with balance Token(99999999872)
Preparing (chunking) files at 'crow.mkv'...
Making payment for 4524 Chunks that belong to 1 file/s.
Error: Transfer error Not enough balance, 99.999999872 available, 636696397.319503872 required

Caused by:
    Not enough balance, 99.999999872 available, 636696397.319503872 required

Location:
    sn_cli/src/subcommands/wallet.rs:305:26

4 Likes

--log-output-dest data-dir is needed sorry!

3 Likes

100 + 10 nodes up and running :sunglasses:

9 Likes

take two :slight_smile:

safe files download safe.log f4eb5f5ba563b3e68e9da4a21a1aaa800826bb35025b8feb64883ba8f605b08f
ubuntu@safe:~/safe$ SN_LOG=all safe --log-output-dest data-dir files upload crow.mkv
Logging to directory: "/home/ubuntu/.local/share/safe/client/logs"
Using SN_LOG=all
Built with git version: 794fca7 / main / 794fca7
Instantiating a SAFE client...
🔗 Connected to the Network                                                                                           Loaded wallet from "/home/ubuntu/.local/share/safe/client/wallet" with balance Token(99999999856)
Preparing (chunking) files at 'crow.mkv'...
Making payment for 4524 Chunks that belong to 1 file/s.
Error: Transfer error Not enough balance, 99.999999856 available, 636696397.319503872 required

Caused by:
    Not enough balance, 99.999999856 available, 636696397.319503872 required

Location:
    sn_cli/src/subcommands/wallet.rs:305:26

3 Likes

Okay, so as I said these calculations are no longer applicable to the latest codebase. But what’s running now is bugging out and I think we can expect to see more wild calculations of cost (from your logs; which: lovely to have them passed over the network :smiley: :bowing_man: ):

[2023-08-31T11:01:08.650311Z TRACE sn_client::api] Set store cost: 2
[2023-08-31T11:01:08.650319Z INFO sn_client::wallet] Storage cost per record: 140737.488355328

That cost per record makes nooo sense there. We had a hack at this point to overestimate the cost to smooth out pay disparity. It’s working a little too well here though :stuck_out_tongue:

10 Likes

Small update w/r/t the objective: I don’t see any maidsafe nodes with 0 records. So that’s a big improvement over the last testnet!

18 Likes

Rockers up first attempt! :partying_face:

Successfully stored 'Rockers1978.mp4' to f4eff9acb8d2aecb1692b5e41d14083c50b1bd60aea41f31898c46039a705ae1

Nodes all getting chunks:

6.9M    /home/ubuntu/.local/share/safe/node/12D3KooWBWimywd7ZXHDezgnfXUkqHLSC8DkC1sicq8AVtyVV8i8
3.5M    /home/ubuntu/.local/share/safe/node/12D3KooWDUWp7aTKNnzKgqmXTH3HVaYwBdkjNAVJdwnU31xmo4hs
7.9M    /home/ubuntu/.local/share/safe/node/12D3KooWE5fVQVEynLmb3BjnQr2AtRnCSURmdEU5c8Wt5PVgRS4s
2.5M    /home/ubuntu/.local/share/safe/node/12D3KooWEETCRNeaQECZDd1fd5M9P64VjCxXdtVsj5NybtDUnw1C
3.8M    /home/ubuntu/.local/share/safe/node/12D3KooWFbqgPbHWNzSjGs6vqz3ZC5a3ksAVyWnR2dTphYnBy1gK
2.2M    /home/ubuntu/.local/share/safe/node/12D3KooWFkeyAQJ5h1sBmuQBh17bKeonp8bHis6uwjuGfwZScKVi
2.0M    /home/ubuntu/.local/share/safe/node/12D3KooWG7bgE8VcNe5tnsVUEFdKQi8Bo6z4yNwAzKcwEdbTz2MR
1.5M    /home/ubuntu/.local/share/safe/node/12D3KooWHaCnEZ4uNceRa34RCU5qoBipnaYi1ycFySCF4c53gMwv
4.8M    /home/ubuntu/.local/share/safe/node/12D3KooWHpDscfahevFLKC3UKN7VCKt6NQhGEVrXHPJXsPoLZr1i
3.5M    /home/ubuntu/.local/share/safe/node/12D3KooWHwSdYnJ7ktUDrNqLbPLQ59yfsqoW3Dhh8uhXvdLnQC7Y
3.9M    /home/ubuntu/.local/share/safe/node/12D3KooWJ7NcxYZQbw91FgASeDEnSAvAJf41q1xUZ6mGBhkLp2p6
4.7M    /home/ubuntu/.local/share/safe/node/12D3KooWJk18L4jW9b6pGcNuqg187rNEwExsyRMoSayNqPGuiTAh
4.1M    /home/ubuntu/.local/share/safe/node/12D3KooWK8cJiiDbG1C7g6igXJczsfN5dtTQ1d4DSxUidyVoYM5L
3.0M    /home/ubuntu/.local/share/safe/node/12D3KooWNJwARcPb2EPdSD15PrHUHRpz57NeTbkRJeGwMHZKhtSm
2.5M    /home/ubuntu/.local/share/safe/node/12D3KooWNcZkPwvGokdFF6GfVJVVuiBzhd7HjyKsQkNeGBVbfgag
2.0M    /home/ubuntu/.local/share/safe/node/12D3KooWRRNTReAa8EbCfKgF51UK8dWazXQvLii4vDmZFGSu6797
4.0M    /home/ubuntu/.local/share/safe/node/12D3KooWRfzgPN13dga6H4gkGkeFmiZk9cyM1QctsAeNBtV9khjm
3.3M    /home/ubuntu/.local/share/safe/node/12D3KooWRqTKN2MgTn96YDxERiBwafG31RUFhMqSK6QMyHJxPmpt

I can feel it, I CAN FEEL IT, I CAN FEEL IT!!!

:rocket:

15 Likes

Just to confirm that I am not jumping through unnecessary hoops here.
Each node on the same machine needs a different port… right?
(behind nat, port forwarding)

7 Likes