Raspberry Pi3 model B is a microcomputer for doing almost anything. Let's use it for installing storagenode for V3 of the Storj Network!
In this guide we assume that you have a Raspberry Pi 3 (or higher), set up with Raspberry Pi OS Lite (without Graphical User Interface). To set up Raspberry Pi OS Lite, please refer to the official documentation here.
Set up your Pi to allow SSH (it will make your life a lot easier): https://www.raspberrypi.org/documentation/remote-access/ssh/
Note. If you want to enable SSH on headless Pi, you should place an empty
ssh file in the boot partition on your SD-card. This will enable the ssh daemon on your Pi after boot.
Connect to the RPi via ssh and follow the steps below.
If your SD card is big enough, you can extend the system to use the whole available space (by default you have only a few MB in the root partition).
Run the raspi-config to extend it:
Navigate to the Advanced Options, then choose Expand Filesystem. After a while you should see a screen like this:
When you exit from the raspi-config, it will suggest you to reboot. Please do it.
It is recommended to replace the default password for the default user pi for security reasons. Please do so.
Please configure the passwordless login via ssh (see details in the section Using key-based authentication) and after that, make sure that you can login with your public key, after which you can disable the password authentication completely.
To continue with this guide, please use the
screen command, this will enable you to still reconnect to a disconnected session using the
screen -x command after logging in via ssh.
Formatting and mounting your HDD
Please do not reformat your HDD if it already contains the storage node's data and you want only to mount it after an OS reinstall!
Format your hard drive
If you just reinstalled the system on the SD card, you can skip this step and continue to Mount your hard drive below, otherwise, please proceed with:
sudo apt-get install gdisk -y
sudo gdisk /dev/sda
Enter until you exit out of the command. Write changes to the disk:
w, confirm by
Now we will format the drive to use the ext4 filesystem (do not try to use btrfs or zfs on models with RAM less than 4GiB! The exFat is strictly not recommended in any setup, the ntfs uses a lot of RAM on Linux and you can lose data, if this disk were used on Windows (modern Windows uses dedup and compress features by default and they are not fully supported under Linux)).
Find your drive and request its UUID:
sudo blkid /dev/<location (example: sda1)>
Copy UUID and open the
/etc/fstab file in a text editor:
sudo nano /etc/fstab
Then add the following line to the end (replace <your HD UUID> with the copied UUID):
Ctrl-O and confirm saving, then exit with
Check your mount:
sudo mount -a
It should not print any errors. Otherwise - please, check the UUID and the filesystem type. Do not reboot until you fix the error, otherwise your Pi may stuck on boot.
To check that all ok:
You should see your disk and free space on it, mounted to
If mount is ok, you can proceed further.
To add cgroup memory support (to prevent an OOM hang of your Pi 3 B/B+):
Note. This fix is tested only on Raspberry Pi 3 B/B+ models.
If you are using a Pi3 B/B+ please add
cgroup_enable=memory cgroup_memory=1 swapaccount=1 to the end of the line. The resulting string should look like this:
Save the file (
Ctrl-X, confirm saving) and reboot:
Create your node Identity
You can create an identity directly on your Pi. It will take at least 24 hours. But you may prefer to create the identity on a more powerful desktop or laptop where identity creation would take a lot less time, and then move the identity files to the Pi.
Create a node Identity on your PI
Download the identity binary for the RPi: identity_linux_arm.zip
Generate the Identity:
Your identity will be generated here:
Create a node Identity on your desktop
Download the identity binary for your platform:
- Mac OS: identity_darwin_amd64.zip
- Linux: identity_linux_amd64.zip
- Windows 10 Pro: identity_windows_amd64.zip
Unpack the binary to the preferred folder. Let´s suppose it is your home folder.
Then generate the Identity (this example is for Windows):
Your Identity will be generated here:
%APPDATA%\Storj\Identity\storagenodeif you use a
Note. You can also specify to place the identity files into another folder using the option
Sign your node Identity
firstname.lastname@example.org:ohihioHiohohIOhUyTUfyufVJHvufUyvJHvyFTYdhVJGionOoHib is your authorization token you received in your invitation email.
We recommend to move your signed identity from the SD card to the HDD with the storagenode data, so if the SD card fails, you will not lose your identity. In the event of a hard drive failure, your node would be lost anyway, so it is better to store identity and data together in different folders on the hard drive.
Note: You cannot authorize your identity if you have not received the invite email yet with your authentication token.
Note: The email address is a part of the auth token and should be copied including all characters.
Note: You can specify the identity folder with an
Copy your node Identity to the RPi
In case you generated and authorized your node identity on a desktop/laptop computer instead of directly on the RPi to save time, you can copy it to the RPi afterward, as follows:
Copy the Identity to the RPi from Linux or Mac
Copy your node identity from your desktop to the RPi: https://unix.stackexchange.com/questions/106480/how-to-copy-files-from-one-machine-to-another-using-ssh
Copy the Identity to the RPi from a Windows machine
Copy your node identity from your Windows machine to the RPi: https://unix.stackexchange.com/questions/92715/can-i-transfer-files-using-ssh
To install Docker on the RPi, be sure to use the following installation method:
To enable docker to start after reboot:
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
Download Docker container with storagenode
In our example, we will need to have port no. 28967 forwarded to our RPi. Use the steps for Linux OS from the article Need help port-forwarding? to perform port forwarding to your Raspberry Pi.
You can take a look at this article to learn how to install the no-ip software, if you have a dynamic public IP. Note that if you use the free version of no-ip, you will need to periodically renew it every month so it will continue working properly.
Please be sure to check that your port is open here.
Setup the storagenode before the run
Please setup your node first as described here.
docker run --rm -e SETUP="true" \
--mount type=bind,source="<identity-dir>",destination=/app/identity \
--mount type=bind,source="<storage-dir>",destination=/app/config \
--name storagenode storjlabs/storagenode:latest
For our example we will use these parameters:
- /home/pi/.local/share/storj/identity/storagenode is the location of your identity files. You can copy the absolute path from the output of the identity command you ran earlier (second to last line below). We recommend to move it to the HDD, for example, to
/mnt/storj/storagenode/identity. In this case. replace the string /home/pi/.local/share/storj/identity/storagenode with your actual path. It should contain 6 files belonging to the identity.
- /mnt/storj/storagenode: this is the local directory where you want files to be stored on your hard drive for the network.
So the initial setup command will looks like:
docker run --rm -e SETUP="true" \
--mount type=bind,source="/home/pi/.local/share/storj/identity/storagenode",destination=/app/identity \
--mount type=bind,source="/mnt/storj/storagenode",destination=/app/config \
--name storagenode storjlabs/storagenode:latest
Run the Docker container with storagenode
We recommend to create a subfolder for the storagenode on your disk, as this would prevent your node from starting in the event that the mount accidentally fails for any reason. We will assume further that this subfolder is called
Parameters used in the Docker run command:
WALLET: ERC20 compatible ethereum address for STORJ token payments (use the same payout address for all nodes if you are running multiple nodes.) If you are opting in to zkSync L2 payouts, please use your zkSync wallet address. You can read more about choosing L1 or L2 payout options and how to configure zkSync here.
ADDRESS: external IP address or the DDNS you configured and the port you opened on your router.
Note: If you are using a custom port other than 28967, then you have to change the
STORAGE: How much disk space you want to allocate to the Storj network
- /home/pi/.local/share/storj/identity/storagenode: This is the location of your identity files. You can copy the absolute path from the output of the identity command you ran earlier (second to last line below). We recommend to move it to the HDD, for example, to the
/mnt/storj/storagenode/identity. In this case replace the string /home/pi/.local/share/storj/identity/storagenode with your actual path. It should contain 6 files belonging to the identity.
- /mnt/storj/storagenode: local directory where you want files to be stored on your hard drive for the network.
Example of Docker run command: