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