Introduction
This guide will tell you how to install a safe network node on any server computer that runs on an ARM chip. Once running, you will earn safe network tokens. Good luck!
Note: As of now, only the first half of this guide functions as intended, that is step 1 to 5, or the proper installment of the SD card. I’m still working on step 6, the proper installment of the safe application.
Note: The safe network is still in it’s testing phase, so all earned safe network tokens will be destroyed at the end of each test run.
Note: For those of you who are absolute beginners when it comes to server computers.
A server computer is not necessarily any different from a client computer. Any computer can be a server computer. What’s often different about ‘server computers’ is that they often lacks support for monitors, speakers and other components aimed at human sensors. Server computers sit in a corner and uploads data to whomever requests it.
Note: Manjaro ARM no longer supports armv7h architecture. So if you have a armv7h device, you will have to find another guide or buy a newer ARM server.
Requirements
Client computer
- A Desktop or laptop
Server computer
Minimal
- 64-bit ARM computer (Raspberry Pi 4 in picture)
- Motherboard
- Case
- Power Adapter
- SD Card - (Endurable recommended)
- SD Card reader
- Ethernet cable
Highly recommended
- A display-providing cable for your ARM server in case it loses connection:
- Monitor with HDMI cable : USB-C in to HDMI out cable
- Monitor with displayport cable : USB-C in to Disyplayport out cable (not in picture)
- No monitor : Raspberry Pi Display (not in picture)
- For those who use of the Raspberry Pi 4 as their server, the Raspberry Pi 4 Heatsink
Recommended (not in picture)
- External storage
Steps
WARNING! For Manjaro OS users that know one can skip step 1 to 3 simply by running manjaro-arm-installer straight away, it is highly recommended to follow these steps carefully as a virtual machine protects you from calamity. This tutorial writer did not follow his own advice and had accidentally deleted his entire computer. Please do not be as stupid as him.
Step 1: Download and install Libvrt, Vagrant and Manjaro OS
Windows 10/11
Recommendation: Chocolately
Chocolately is a package manager, which is like an app store full of free adless software. Go to https://chocolatey.org/ and follow the instructions. Once you have downloaded and installed chocolately, downloaded, installed and started choco-gui, you can install both Vagrant and virtualbox via Chocolately-gui, as vagrant-libvirt has so far has not been able to work with Windows.
– Todo
For Mac OS users
– Todo
For Arch Linux OS users
Open your terminal and type
sudo pacman -S vagrant virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
For Debian Linux OS users
sudo apt install vagrant virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
For Fedora Linux OS users
sudo yum install vagrant virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
Step 2: Run vagrant, download, install and run the MAI-box
Create a folder in your home directory named vagrant.
Open your terminal and navigate towards this folder.
Then type the following:
vagrant plugin install libvrt
vagrant init safenetwork-community/manjaro-arm-installer
vagrant up
Step 3: Insert SD card and run the MAI-box
Once done, start virt-machine, insert your SD card and choose
View->Add Hardware->USB host device and then choose your SD card.
Go back to the terminal and type the following:
vagrant ssh
Step 4: Install Manjaro Minimal onto your SD card
Note: There’s no need for difficult passwords right away, because we’re going to use SSH keys and then via SSH we can change those passwords.
WARNING! If you are not careful with one of the steps during the procedure and choose vda, you will overwrite your virtual machine and have to do Step 1 over again.
As in the video choose the following:
YOUR_ARM_COMPUTER_MODEL
minimal
YOUR_USERNAME
wheel,sys,audio,input,video,storage,lp,network,users,power
YOUR_FULLNAME
A_SIMPLE_PASSWORD
REPEAT
A_SIMPLE_PASSWORD
REPEAT
sda <- [READ WARNING ABOVE!]
btrfs
YOUR_TIMEZONE
YOUR_LOCALE (default: en_US)
YOUR_TTY_KEYBOARD_LAYOUT (default: us)
YOUR_HOSTNAME (default: Safenetwork-one)
Once the installment is finished, enter these commands (ROOT_MNJRO=ROOT_MNJRO):
curl https://link.tardigradeshare.io/s/julx763rsy2egbnj2nixoahpobgq/rezosur/safe_network_dev_environment_setup.sh?download -o safe_network_dev_environment_setup.sh
curl https://link.tardigradeshare.io/s/julx763rsy2egbnj2nixoahpobgq/rezosur/sshd_config?download -o sshd_config
mkdir /run/media/$USER/ROOT_MNJRO/@home/YOUR_USERNAME/{safe,safenetwork-node,.ssh}
mv safe_network_dev_environment_setup.sh /run/media/$USER/ROOT_MNJRO/@home/YOUR_USERNAME/safe/
sudo mv -b sshd_config /run/media/$USER/ROOT_MNJRO/@/ssh
ssh-keygen -t ed25519 -N <passphrase> -C "USER@HOSTNAME"
cat ~/.ssh/id_ed25519.pub | tee -a /run/media/$USER/ROOT_MNJRO/@home/YOUR_USERNAME/.ssh/authorized_keys
Step 5: Access your ARM server computer via SSH
Pull your Mirco SD card out of your reader and push it into your ARM server.
Connect the ethernet cable to your modem and turn your ARM server on.
On your client computer terminal type the following command to connect to your server:
ssh YOUR_USERNAME@YOUR_HOSTNAME
This should give you access to your server computer.
Next use a password manager (example: KeepassXC) for generating and managing passwords.
Then type these commands:
passwd
YOUR_PASSWORD
NEWLY_GENERATED_PASSWORD
REPEAT
sudo su
passwd
NEWLY_GENERATED_PASSWORD
REPEAT
exit
Run the safe network script which should download and setup docker on your server computer.
This requires a reconnect in order for Manjaro to provide new user permissions.
sudo sh ~/safe/safe_network_dev_environment_setup.sh
exit
ssh YOUR_USERNAME@YOUR_HOSTNAME
Step 6: Start the node
Note: As of now, only rootnode-ipv4 works, although only locally. I’m working on finishing the rest as soon as possible.
Pull the safenetwork-node image from docker.
It should immediately run the node once the build has been completed.
For those who want to join an existing ipv4-only safe network
docker pull ghcr.io/safenetwork-community/joinnode-ipv4:main
docker run --name safe_node -dt ghcr.io/safenetwork-community/joinnode-ipv4:main
For those who want to join an existing ipv6-only safe network
docker pull ghcr.io/safenetwork-community/joinnode-ipv6:main
docker run --name safe_node -dt ghcr.io/safenetwork-community/joinnode-ipv6:main
For those who want to start an ipv4-only safe network
docker pull ghcr.io/safenetwork-community/rootnode-ipv4:main
docker run --name safe_node -dt ghcr.io/safenetwork-community/rootnode-ipv4:main
For those who want to start an ipv6-only safe network
docker pull ghcr.io/safenetwork-community/rootnode-ipv6:main
docker run --name safe_node -dt ghcr.io/safenetwork-community/rootnode-ipv6:main
Congratulations and welcome to the club!
You can also run the safe command line interface from the server side and take a look inside at your hard earned money from running your server farm.
docker exec -it safe_node safe
Happy safe networking!
Extra: Install Lunarvim
Lunarvim is a text-based editor with a steep learning curve, but great for programmers.
bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
Fira ligatures
As a favorite font for editing in servers, choose fira-code.
sudo pacman -S yay
yay -S nerd-fonts-fira-code
Troubleshooting
In case your node unexpectedly quits you can enter the container like this:
docker commit safe_node debug/safe_node
docker run -it --entrypoint=/bin/bash --name debug_node debug/safe_node
And then run a pastebin debug command like this:
nodebin
Work needed to be done
- [Docker] Figure out how to get rootnode-ipv6 working.
- [Docker] Figure out how what networks are best to join by default.
- [Docker] Figure out how people should best join any network they want.
- [Guide] Add windows screenshots for chocolately, virtualbox and vagrant.
- [Vagrant] Set vagrant box partition table to GPT.
- [Vagrant] Set vagrant ISO firmware to EFI.
- [Vagrant] Set vagrant box firmware to EFI.
- [Vagrant] Add a post-installer dialog where one can choose a setup (nothing/{join,root}node-ipv{4,6}) which will install docker, the docker image, lunarvim and aliases (lunarvim, termbin, safe).
- [Vagrant] Replace virtualbox with libvirt on Windows once it’s possible.