Skip to main content

Storage Node Operators Storj V3

Awhile ago I was a node operator on Storj’s previous decentralized storage network that was meant to compete with the likes of Amazon’s storage services…

Raspberry Pi 3

Due to <insert Storj’s history> it was no longer profitable and shortly after no longer available to run your own Storj nodes as Storj itself was under going changes. Not saying it’s profitable now, not saying it isn’t. I’m doing this for the pure badassery of it all.

Edit: My memory was hazy — it was always possible to run a V2 node: “we (Storj) did limit the upload of new data and new developer accounts”

Why? To earn STORJ — an ERC-20 utility token hosted on the Ethereum blockchain.

I, myself, am in the middle of setting up my node. Currently waiting for rsync to finish so I can re-purpose my 8TB HDD for Storj.

Onward with the tutorial.

If you don’t have your official invite received in your email, you cannot currently join the network!

I’m going to make this as brief as possible, which assumes you have Networking, Linux, and various other hardware/software skills already obtained. Or you know how to Google…

Things you need:

  • Raspberry Pi 3 (sd card & power supply)
  • 8TB External HDD via USB (min 500GB needed)
  • Stable high speed internet (minimums: 25 Mbps down/5 Mbps up, 2TB bandwidth/month)

Raspberry Pi

Pi Setup

You’ll need to enable ssh access to your Pi in one of two ways:

  • Drop a sshfile under the boot partition

or

  • Login as pi:raspberry and run the command raspi-config Under Interfaces, enable ssh. sudo reboot to confirm you can ssh into your Pi.

Change your password using passwd

Install ufw

Allow the proper ports & sudo ufw enable to turn on the firewall

sudo ufw allow ssh // SSH port (default 22)

sudo ufw allow 28967 // Default Storj Port

sudo ufw allow 14002 // GUI Dashboard

(If you already turned on the firewall before running the above commands, hit your pi with this command to reload the new rules: sudo ufw reload)

At this point we have a secured (behind your router I’m assuming else you may want to dabble with ssh keys instead of plain-jane passwords) Raspberry Pi 3 Ready for some software.

Don’t forget to setup a static IP for your Pi device on the primary (ethernet > wifi recommended) network. Setup port forwarding to this IP on the port used below: 28967.

Hit your Pi with sudo apt update && sudo apt upgrade

Install Docker

curl -sSL https://get.docker.com | sh

Pull the Storj Image

docker pull storjlabs/sotragenode:beta

Create a script to run docker with proper parameters

nano storjNode.sh

Contents:

docker run -d --restart always -p 28967:28967 -p 14002:14002 \
-e WALLET="0x0000…." \
-e EMAIL="your@email.com" \
-e ADDRESS="externaladdress:28967" \
-e BANDWIDTH="32TB" \
-e STORAGE="7TB" \
--memory=800m \
--log-opt max-size=50m \ 
--log-opt max-file=10 \
--mount type=bind,source=/home/pi/.local/share/storj/identity/storagenode,destination=/app/identity \
--mount type=bind,source=/mnt/storagenode,destination=/app/config \
--name storagenode storjlabs/storagenode:beta

Hit the file with an executable permission change

sudo chmod +X storjNode.sh

Pause.
At this point we have everything but …

  1. 8TB HDD connected & configured
  2. Your Storj Node Identity files on the Pi’s SD card

HDD Setup

Make sure no important files on stored on this drive!
!!! These commands will wipe the drive !!!

Plug in your drive. Leave unmounted.

Make sure this path exists!/mnt/storagenode

mkdir /mnt/storagenode

Find your HDD: sudo fdisk -l

Wipe Partitions:

sudo fdisk /dev/sdX  // enters fdisk utility 
p // print out partition(s)
d // delete partition(s), run several times to delete all
n // new partition, (default partition number) enter, 
  // (default first sector) enter, (default last sector) enter
w // write changes to disk
// Create ext4 files system
sudo mkfs.ext4 /dev/sdXN  // Ex: /dev/sda1 (sda = device) 
                          //               (1 = partition)
// Mount device at boot
// Side Note: it's bad practice to use "/dev/sda1" to mount as these // are "pointers" to the UUID of the partition. A reboot when      // different devices are detected can change which "dev/sdXN" gets // assigned to the UUID. Breaking the configuration. 
// List UUIDs
sudo blkid 
// Copy the proper UUID listed for your partition.
// Open fstab
sudo nano /etc/fstab
// add this line, save and exit - filling the UUID with the above
UUID=3b5d3076-caa2-4ad2-9ffb-c8e6263b8e06  /mnt/storagenode ext4    defaults,nofail 0 2
sudo mount -a // mount the drive
df -h // display disk free space by Filesystem, size, used, avail,
      // use%, Mounted on

Reboot your device, re-run the last command above for a sanity check!

Bare with me, we are almost there!

Identity Setup

Look back at the storjNode.sh contents.
Near the bottom

/home/pi/.local/share/storj/identity/storagenode

Make sure this path exists!

mkdir --parents ~/.local/share/storj/identity/storagenode

Now lets create that identity!
You want to use a much more powerful computer (your desktop or laptop) as it will reportedly take the Pi device 24 hours to create.

Download the identity binary for your platform:

Assuming Windows, open cm or powershell and run

./identity_windows_amd64.exe create storagenode

These file are located here:

$Env:APPDATA/Storj/Identity/storagenode

Sign your identity with your official invite!

Format: email:key replace the text below with yours

./identity_windows_amd64.exe authorize storagenode user@example.com:ohihioHiohohIOhUyTUfyufVJHvufUyvJHvyFTYdhVJGionOoHib

Copy these files (via WinSCP) to the Pi directory we created earlier.

~/.local/share/storj/identity/storagenode

Run it!

sudo ./storjNode.sh

Check status: sudo docker ps

Navigate to the UI screen → IP:14002

#MicDrop

Raspberry Pi

Bonus Tip:
Want your docker image to update automatically?
Hit your Pi terminal with this:

sudo docker run -d --restart=always --name watchtower -v /var/run/docker.sock:/var/run/docker.sock storjlabs/watchtower storagenode watchtower --stop-timeout 300s --interval 21600
nodejsjavascriptnode-jsraspberry-pipi

Comments

Popular posts from this blog

How to use Ngx-Charts in Angular ?

Charts helps us to visualize large amount of data in an easy to understand and interactive way. This helps businesses to grow more by taking important decisions from the data. For example, e-commerce can have charts or reports for product sales, with various categories like product type, year, etc. In angular, we have various charting libraries to create charts.  Ngx-charts  is one of them. Check out the list of  best angular chart libraries .  In this article, we will see data visualization with ngx-charts and how to use ngx-charts in angular application ? We will see, How to install ngx-charts in angular ? Create a vertical bar chart Create a pie chart, advanced pie chart and pie chart grid Introduction ngx-charts  is an open-source and declarative charting framework for angular2+. It is maintained by  Swimlane . It is using Angular to render and animate the SVG elements with all of its binding and speed goodness and uses d3 for the excellent math functio...

Understand Angular’s forRoot and forChild

  forRoot   /   forChild   is a pattern for singleton services that most of us know from routing. Routing is actually the main use case for it and as it is not commonly used outside of it, I wouldn’t be surprised if most Angular developers haven’t given it a second thought. However, as the official Angular documentation puts it: “Understanding how  forRoot()  works to make sure a service is a singleton will inform your development at a deeper level.” So let’s go. Providers & Injectors Angular comes with a dependency injection (DI) mechanism. When a component depends on a service, you don’t manually create an instance of the service. You  inject  the service and the dependency injection system takes care of providing an instance. import { Component, OnInit } from '@angular/core'; import { TestService } from 'src/app/services/test.service'; @Component({ selector: 'app-test', templateUrl: './test.component.html', styleUrls: ['./test.compon...

How to solve Puppeteer TimeoutError: Navigation timeout of 30000 ms exceeded

During the automation of multiple tasks on my job and personal projects, i decided to move on  Puppeteer  instead of the old school PhantomJS. One of the most usual problems with pages that contain a lot of content, because of the ads, images etc. is the load time, an exception is thrown (specifically the TimeoutError) after a page takes more than 30000ms (30 seconds) to load totally. To solve this problem, you will have 2 options, either to increase this timeout in the configuration or remove it at all. Personally, i prefer to remove the limit as i know that the pages that i work with will end up loading someday. In this article, i'll explain you briefly 2 ways to bypass this limitation. A. Globally on the tab The option that i prefer, as i browse multiple pages in the same tab, is to remove the timeout limit on the tab that i use to browse. For example, to remove the limit you should add: await page . setDefaultNavigationTimeout ( 0 ) ;  COPY SNIPPET The setDefaultNav...