InstallNet [2023-06-19 Testnet] [Offline]

Our next testnet, InstallNet, is a bit mundane in comparison to previous runs, but nonetheless does serve an important purpose.

We would like to introduce and test the installation processes for the new network components.

Objectives:

  • Ensure the processes function correctly on multiple platforms
  • Explore the user experience for the processes
  • Establish whether documentation for the processes is clear and helpful

Once components have been installed, you can feel free to explore other features or continue experiments from previous runs.

Spring Cleaning

We now have a new automated release process for the safe_network repository, and the safeup tool should be functional.

Bearing that in mind, take the opportunity now to manually clean out any previous safe or safenode binaries from wherever you put them.

As we move forward, we will not instruct for any previous binaries to be cleared out. We should be able to use safeup to perform rolling updates.

Linux/macOS

Make sure you don’t have any of these:

/usr/local/bin/safe
/usr/local/bin/safenode
~/.safe/cli/safe
~/.safe/node/safenode

Completely remove ~/.safe. It should not be getting used any more. This directory will be replaced in favour of directories in the XDG Base Directory Specification:

~/.local/bin # for safe, safeup, safenode, testnet binaries
~/.config/safe # for any configuration related to safe binaries
~/.local/share/safe # for data related to safe binaries, like logging

A better summary of the XDG directories is here, in the Rust crate that implements them.

The binary directory only applies if you run the install scripts without sudo. Otherwise binaries will be getting installed to /usr/local/bin.

Windows

Clear out anything at:

%USERPROFILE%\.safe

Where %USERPROFILE% will evaluate to, e.g., C:\Users\Chris\.

If you were using them, remove any %USERPROFILE%\.safe related directories from your PATH variable.

Connecting to InstallNet

Contact peers to be used for this network (more on how to use this below):

SAFE_PEERS=/ip4/68.183.44.129/tcp/38921/p2p/12D3KooWN3P9exk23WW7naW7Kb1rdzZeLpZRHXtF5ntyQtJrsiF7

----
backup peers:
/ip4/178.128.164.149/tcp/36185/p2p/12D3KooWMDds1rpbBEDXsfenn83cSEpQWq4wULo7aYzyt9jFtV1c
/ip4/138.68.184.179/tcp/39773/p2p/12D3KooWDMjoD72yGsV9a4YrBThNq7XsNMkhXuBa4iretJsNhxhA
/ip4/167.99.203.49/tcp/44783/p2p/12D3KooWNFnxKGnzjcqqm74rPyQ9NmzamSaWHXjWqAZUSnbxvrpf
/ip4/144.126.238.165/tcp/39821/p2p/12D3KooWMC19ggfNq63FfCocKdDoEkNumLoc89ZXex8DJkUgcEfs

Initial Network

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

Installing Components

Interacting with the network requires the safe client binary. Running a node requires the safenode binary.

Obtaining them depends on the operating system you’re using, but the process is almost identical for both.

The two sections below explain how to install the client on your OS. For installing the node, you just need to replace the word “client” with “node”.

Linux/macOS

The easiest way to get the latest version of safe is using the following command:

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

This installs the safeup binary, then uses it to install safe, as a single step. This command runs as sudo, so both the binaries will be installed to /usr/local/bin.

It is also possible to run this without sudo:

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

In this case, the binaries are installed to ~/.local/bin. The advantage here is you don’t need sudo, but the disadvantage is you need to start a new shell session to get ~/.local/bin on your PATH variable.

Windows

Run the following command in a Powershell session (be careful to use Powershell, not cmd):

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

Now open a new session and run:

safeup client

This will obtain the latest version of safe, which should be available immediately. Run safe --version to check.

Using the Client

Once you have the client, you need to either set the SAFE_PEERS environmental variable or use the --peer= argument with any of the above network addresses.

Now to upload a directory/file to the network, use the following command:

# using the SAFE_PEERS variable
# Linux/macOS
export SAFE_PEERS=/ip4/68.183.44.129/tcp/38921/p2p/12D3KooWN3P9exk23WW7naW7Kb1rdzZeLpZRHXtF5ntyQtJrsiF7
safe files upload -- <path>

# Windows (PowerShell)
$env:SAFE_PEERS = "/ip4/68.183.44.129/tcp/38921/p2p/12D3KooWN3P9exk23WW7naW7Kb1rdzZeLpZRHXtF5ntyQtJrsiF7"
safe files upload -- <path>

# alternatively using the --peer argument. It should be set during each command
safe --peer=/ip4/68.183.44.129/tcp/38921/p2p/12D3KooWN3P9exk23WW7naW7Kb1rdzZeLpZRHXtF5ntyQtJrsiF7 files upload -- <path>

The file-addresses of the content you’ve uploaded are saved locally and are used to enable automatic downloads. Use the following command to download them back to the ~/.safe/client/downloaded_files folder.

To download the content you’ve just uploaded:

safe files download

Running a Node

Connect your node to the network using the SAFE_PEERS environment variable or the --peer argument, similar to the client. Consider keeping your logs in a directory for convenience:

SN_LOG=all safenode --log-dir=/tmp/safenode

Windows is almost identical, but environment variables are handled a little differently:

$env:SN_LOG="all"; safenode --log-dir=$TempDir\safenode
34 Likes

Unexpected timing for a new testnet! Looking forward to seeing how this goes :slight_smile:

13 Likes

Moving right along, amazing, testnet galore. Great job, great momentum!

13 Likes

Wow, we have another TestNet and it comes with some extra instructions, great job guys! :blush: :ok_hand:

15 Likes

but but but … but I’ve just rm -rf’d ~/.safe cos


I refuse to worry about it - Avanti!
10 Likes

Nice, safeup worked seamlessly for me on ubuntu.

Are safe and safenode no longer going to be under releases on github, I only see testnet

  • 1.jpeg 361adff80ea7efb05cbf865803a7bfa134b9137fd02efec724f6cad2cf20414d
  • ant.png ad0c55da8362bbcae4e57b9158f1641033eb9590467d6d0773e46c260f443283
9 Likes

Thanks for highlighting that discrepancy.

I’m guessing both the documentation and the location the code is using need updated here.

Got a task here for myself to implement that.

8 Likes

Sorry @chriso

and thanks for all the work thats gone into this :slight_smile:

7 Likes

Unlike the previous repo, we have a separate Github Release for each binary:

A different tool is being used for doing the version bumping and releasing, and it handles things in a different way.

It’s just a much easier technical implementation in the release process to deal with separate releases.

14 Likes

Nah it’s cool, these are exactly the things we want to find out!

8 Likes

safeup testnet works just fine


willie@gagarin:~/.config/safe$ safeup testnet
**************************************
*                                    *
*          Installing testnet        *
*                                    *
**************************************
Installing testnet for x86_64-unknown-linux-musl at /home/willie/.local/bin...
  [########################################] 2.37 MiB/2.37 MiB                                                                                                               testnet 0.1.39 is now available at /home/willie/.local/bin/testnet
8 Likes

Btw, I just noticed you used safeup without sudo.

One thing we’re going to need to be careful about is the potential to inadvertently do this:

sudo safeup client
# at some point days later...
safeup client

The former will install to /usr/local/bin while the latter will install to ~/.local/bin. So you’ve now got two different binaries.

I’m going to put in some code that will track whether you used sudo or not, and warn the user on that basis that they are using a mix and ask if they really intended to not use sudo this time.

13 Likes

Yep that will avoid a lot of grief, well spotted.

6 Likes

get this right up yaa i was told i could get pissed so here it is

safe files download begblag.mp3 3eb0873bd425e5599d72c2873ca6e691d5de5c75bbc89f2e088fa95e3390927a
6 Likes

@Southside

Do you fancy checking safeup on any of your Pi machines? That would be useful.

I have a couple of them but I don’t have them running at the moment. Gonna have to dust them off soon…

4 Likes

im testing it on an arm vps right now will be back with results in a few min

7 Likes

Yeah give me a few mins and I will try a Pi4 and a BananaPi

meanwhile - despite the fact I just unmounted the SSD that ~/.safe was mouted on and rm -rf ~/.safe

this happened


willie@gagarin:~$ safe files download begblag.mp3 3eb0873bd425e5599d72c2873ca6e691d5de5c75bbc89f2e088fa95e3390927a
Removed old logs from directory: "/tmp/safe-client"
Logging to directory: "/tmp/safe-client"
Built with git version: 74528f5 / main / 74528f5
Instantiating a SAFE client...
🔗 Connected to the Network                                                                                                                                                  Downloading file "begblag.mp3" with address 3eb0873bd425e5599d72c2873ca6e691d5de5c75bbc89f2e088fa95e3390927a
Successfully got file begblag.mp3!
Writing 15766382 bytes to "/home/willie/.safe/client/begblag.mp3"
willie@gagarin:~$ ^C
willie@gagarin:~$ cd /home/willie/.safe/client/
willie@gagarin:~/.safe/client$ tree
.
├── begblag.mp3
└── downloaded_files

1 directory, 1 file
willie@gagarin:~/.safe/client$

which was nice :slight_smile:

6 Likes

OK thanks. That must be getting used as some default location or something. Will look into this too.

6 Likes

Where do chunks get stored now @chriso?

2 Likes