These instructions are intended to be generic over any safe
version and any testnet-name
. Below you can replace <version>
with the expected version, and <testnet-name>
with the testnet you are trying to connect to.
Instructions and examples are provide for Linux, Mac and Windows.
Uploading/downloading
To upload and download (PUT and GET) data to the test network, you just need to install the safe
binary on your operating system.
Linux and macOS
Installation
On Linux:
curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | sudo bash
safe --version # should be <version> ## should be current version, see above
On macOS:
# switch to sudo shell
sudo su
# run install script
curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash
# return to your own user profile
exit
safe --version # should be <version> ## should be current version, see above
All subsequent instructions are the same for both operating systems.
Join latest testnet
To join the latest testnet, download the contacts file and switch to the current testnet (change as appropriate).
safe networks add <testnet-name> https://sn-node.s3.eu-west-2.amazonaws.com/testnet_tool/<testnet-name>/network-contacts
safe networks switch <testnet-name>
Uploading
Uploading a file
# Upload a file in your current directory
safe files put [filename]
e.g. safe files put examplePic.jpg
Uploading a container (a directory plus contents)
Choose a directory (e.g. /home/[yourUserName]/Pictures
) or make a new one and add some files. Then cd to the parent directory (e.g. /home/[yourUserName]/
) and run:
safe files put ./[directory] --recursive
e.g. safe files put ./Pictures --recursive
Downloading
Downloading a file
Use safe cat safe://[address] > filename.txt
to download a file:
Downloading container (directory plus contents)
safe files get safe://[address?v=version]
# For example this will download the container to your current directory. This is just an example, it's not live data)
safe files get safe://hyryyryikpk16oxay7wa1midtbkibxoec6eg4fsgd853gx5xuhs19ujmgzwnra?v=hc7xjae7f8o96xk9446gzyy13j9z7es47rpqdcu81iap61jdcu6no
Windows
Installation
Press the Windows key or click on the Start button and type “Powershell”. Then right click on the Windows Powershell
entry on the menu and select Run as administrator
.
Paste the following text into the terminal by right clicking on the bar at the top of the window, then select edit → paste:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/maidsafe/safe_network/main/resources/scripts/install.ps1'))
Now hit enter to run the install. If you have a previously installed binary, you’ll be asked if you want to overwrite it. Say yes. Now exit the session.
Start a new session without administrator privileges.
safe --version # should be <version> ## should be current version, see above
Join latest testnet
To join the latest testnet, download the contacts file and switch to the current testnet (change as appropriate).
safe networks add <testnet-name> https://sn-node.s3.eu-west-2.amazonaws.com/testnet_tool/<testnet-name>/network-contacts
safe networks switch <testnet-name>
Downloading
Downloading files
safe cat safe://address > filename
e.g.
safe cat safe://hygoygym7tsj5hhyyykd1aqpw3djxea6om6xku568ahm7hy7gfn6q5gy7xr > coast.jpg
Note: Problems have been reported with using PowerShell for downloading. If the downloaded file is unreadable try using cmd
instead.
Downloading container (directory plus contents)
# For example this will download the container to your current directory. This is just an example, it's not live data)
safe files get safe://hyryyryikpk16oxay7wa1midtbkibxoec6eg4fsgd853gx5xuhs19ujmgzwnra?v=hc7xjae7f8o96xk9446gzyy13j9z7es47rpqdcu81iap61jdcu6no
Uploading
Uploading file
# Upload a file in your current directory
safe files put [filename]
e.g.
safe files put examplePic.jpg
Uploading a container (directory plus contents)
Choose a directory (e.g. /home/[yourUserName]/Picture
s) or make a new one and add some files.
Then cd to the parent directory (e.g. C:\Users\[your username]\
) and run:
safe files put .\[directory] --recursive
e.g.
safe files put .\Pictures --recursive