ClientImprovementNet [22/09/23 Testnet] [Offline]

After the last IntolerantNodeNet, we’re looking more concretely at the client. One part of the last testnet was aiming to see how clients performed with the concurrency and batch-size arguments, but a bug in StoreCost retrieval largely scuppered that effort.

Here we want to:

  • Confirm our fix is in place for that.
  • Further explore how concurrency and batch size affect uploads.
  • Start to look at how kad caching affects downloads of popular data.

In addition to some smaller fixes, we now have a new human readable client uploads file, which should make it clearer where your files live on the network

Network Details

Node version: 0.90.34
Client version: 0.82.3
Faucet url: 139.59.175.64:8000
SAFE_PEERS: /ip4/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA
Alternatives:

 "/ip4/142.93.232.219/tcp/38095/p2p/12D3KooWLAX6Z1m5gNxPGZQRV6VEzCtipNGcP1YhrAYNYT3yq5mv"
 "/ip4/64.227.158.176/tcp/34893/p2p/12D3KooWG3cHz8aM9Zf2Gyar7NBb2BZ2wfcBf1zY7PHuUtn3EkvL"
 "/ip4/147.182.237.224/tcp/46429/p2p/12D3KooWFCbRRe6GoyTvgbVqDK7VnD3TwEsM2876pBzuB1G3KHKj"
 "/ip4/139.59.125.187/tcp/33641/p2p/12D3KooWNUNgbhC2zEUNVJzn72BxD4ooZ7kTE4NSa3pCmcGobGQj"
 "/ip4/142.93.76.173/tcp/41717/p2p/12D3KooWJ51eYsdyksy87PazS3M7wRVdPNJWfH58u8fxBk2Y9hdp"
 "/ip4/142.93.76.173/tcp/46229/p2p/12D3KooWQi1eeRbwtRWRvYTSQ2gSKt6M8QjseS65Hwzb7PDGKghE"

We have 101 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.82.3
safeup node --version 0.90.34

Run a Node

Linux/macOS:

export SAFE_PEERS="/ip4/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA"
SN_LOG=all safenode

Windows:

$env:SAFE_PEERS="/ip4/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA"
$env:SN_LOG = "all"; safenode

Check local node’s reward balance

Your local node’s peer id will be printed to the terminal on startup with an example command). (You can also retrieve this from the node directory.)

safe wallet balance --peer-id="<local-node-peer-id>"

Connect to the Network as a Client

Linux/macOS:


safe wallet get-faucet 139.59.175.64:8000
safe files upload <directory-path>

Windows:


safe wallet get-faucet 139.59.175.64:8000
safe files upload <directory-path>

[ In case of failure to connect to the network you may need to set the peers with:
$env:SAFE_PEERS =  "/ip4/64.227.158.176/tcp/34893/p2p/12D3KooWG3cHz8aM9Zf2Gyar7NBb2BZ2wfcBf1zY7PHuUtn3EkvL" ]

To do this with non-default concurrency or batch-sizes (along with SAFE_PEERS set as above):

safe files upload -c 10 --batch-size 40 <directory-path> 

10 and 40 being the integer values you want to set for each


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 # get the latest version of the client
safeup client --version 0.82.3 # get a specific version

safeup node # get the latest version of the node
safeup node --version 0.90.33 # get a specific version

safeup update # update all installed components to latest versions

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/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA"

# Windows
$env:SAFE_PEERS = "/ip4/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA"

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/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA" ...

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 139.59.175.64: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.

28 Likes

Wow. These testnets coming thick and fast. Maybe one day I’ll be clever enough to join in.

9 Likes

But think I will try a bit later on today

9 Likes

I’m having issues getting tokens from the faucet:

Error:
0: Could not deserialize specified hex string to a DBC: deserialized bytes don’t encode a group element

Have cleared down the old safe wallet folder and used safeup to update the client to the correct version using

safeup client --version 0.81.64

7 Likes

Same

root@localhost:~# export SAFE_PEERS="/ip4/139.59.125.187/tcp/35163/p2p/12D3KooWE75czdXUnZJ59gtMDwNZCyBx24whf9WXbNTmEoCaiUrA"
root@localhost:~# safe wallet get-faucet 139.59.175.64:8000                     Built with git version: 800753c / main / 800753c
Requesting token for wallet address: aee5fa4ed441f935cd6605404bf7368d3b0a2b70a87288c8a72f827ef145e2592a359ebc45b19391eb112d09fcae8159...
Error:
   0: Could not deserialize specified hex string to a DBC: deserialized bytes don't encode a group element

Location:
   sn_cli/src/subcommands/wallet.rs:224

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

With backtrace

Summary
root@localhost:~# RUST_BACKTRACE=full safe wallet get-faucet 139.59.175.64:8000
Built with git version: 800753c / main / 800753c
Requesting token for wallet address: aee5fa4ed441f935cd6605404bf7368d3b0a2b70a87288c8a72f827ef145e2592a359ebc45b19391eb112d09fcae8159...
Error:
   0: Could not deserialize specified hex string to a DBC: deserialized bytes don't encode a group element

Location:
   sn_cli/src/subcommands/wallet.rs:224

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮
   4: safe::subcommands::wallet::deposit_from_dbc_hex::h3a7623826dd1f0ab
      at <unknown source file>:<unknown line>
   5: safe::main::{{closure}}::h951771ea960389bd
      at <unknown source file>:<unknown line>
   6: tokio::runtime::park::CachedParkThread::block_on::hc596760f6880a856
      at <unknown source file>:<unknown line>
   7: tokio::runtime::context::runtime::enter_runtime::hed60a0af2dcb531a
      at <unknown source file>:<unknown line>
   8: tokio::runtime::runtime::Runtime::block_on::h37e208f1333b6d2a
      at <unknown source file>:<unknown line>
   9: safe::main::hf21cbf444c0888d4
      at <unknown source file>:<unknown line>
  10: std::sys_common::backtrace::__rust_begin_short_backtrace::h758888956679f2fb
      at <unknown source file>:<unknown line>
  11: std::rt::lang_start::{{closure}}::h98aaa41b9982b19f
      at <unknown source file>:<unknown line>
  12: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2565476b49fcd7dc
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:284
  13: std::panicking::try::do_call::ha1014e3bb8270d94
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500
  14: std::panicking::try::h47374bd91e24ad1c
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464
  15: std::panic::catch_unwind::h8a54a4989bd6bf92
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142
  16: std::rt::lang_start_internal::{{closure}}::hb8b1292915cb49e2
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148
  17: std::panicking::try::do_call::h46799a8db12eba03
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500
  18: std::panicking::try::h902bd23c128df220
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464
  19: std::panic::catch_unwind::h5775836cd784f100
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142
  20: std::rt::lang_start_internal::hbfa2424132dddc00
      at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148
  21: main<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

7 Likes

Same here…
Ouch, shortest testnet ever?
Small thing I guess, devs will fix it soon and start it again.

3 Likes

Very odd, i’ve had no problems there. what does safe -V say ?

3 Likes

Same here.

sn_cli 0.81.64

2 Likes

Yes sn_cli 0.81.64.

I thought DBCs were out? Why does the error mention it?

2 Likes

They are, something is wrong in the build process here I think. I’m not sure why my test didnt pick this up :thinking:

Well, perhaps we can test the client upgradeability right off the bat…


Edit: a cli release did not go out for the last client update. Argh. I must have used a build instead of the compiled bin to get tokens :man_facepalming: :coffee: .

I’ll kick off another cli build now to hopefully straighten things out.

10 Likes

sn_cli 0.81.64

(sorry late to reply, but thought it would be rude not to answer :-D. )

3 Likes

Okay, new build in, should kick off a new CLI release now which should hopefully unblock us here.

I’ll report back when that’s out (~30 mins or so).

Sorry/thanks for your patience! :bow: !

9 Likes

Don’t forget to update the version number in the OP :slightly_smiling_face:

5 Likes

First!

safe -V
sn_cli 0.82.0
ubuntu@instance-20211208-1104:~$ safe wallet get-faucet 139.59.175.64:8000
Built with git version: 2c47455 / main / 2c47455
Requesting token for wallet address: abfe66bd6b5c3eb702629cf82e624fbe1d04e3349bb8955d66f6a34a2839a7106837145c36a3ee7419b941e192d18148...
Successfully stored cash_note to wallet dir.
Old balance: 0.000000000
New balance: 100.000000000
Successfully got tokens from faucet.

Great to see live update works!

Uploaded spiral.gif to c924f02c7223e9273ddb594921abdbecbd72debb3e8c609761b829776533760f
7 Likes

I’ll update the op for this. thanks @stout77 :male_detective:


Op updated. Testnet back on track! Thanks early testnet divers! :diving_mask: :bowing_man:

9 Likes

You just wanted to test the upgrade feature didn’t you :stuck_out_tongue_winking_eye:

5 Likes

Seems to be working well. Have had a couple of uploads requiring repayment but went through smoothly. Will experiment with batch-size and concurrency later.

Edit: Uploads are much quicker this time too.

12 Likes

I’m going to see if I can get on to TestNet this time, the last two times I tried there were constant errors and I couldn’t test. I hope it will work now.

6 Likes

50 meg random file that was failing to upload to the prevous testnet uploaded successfully here!

I changed the batch settings to 5 (file size was 101 chunks) to get more rapid feedback on what was being uploaded.

There were a couple of “cannot get storecost blah…” errors, and a couple of upload verification failures, but everything automatically retried as expected, and uploaded in about 20 mins.

Downloaded absolutely fine in a couple of mins.

This looks like great progress.

12 Likes