Installing Storj Node on Ubuntu

[quote=“Alexey, post:53, topic:13921”]


[quote="Alexey, post:53, topic:13921"]
 1  curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip
    2  unzip -o identity_linux_amd64.zip
    3  chmod +x identity
    4  sudo mv identity /usr/local/bin/identity
    5  sudo snap install curl
    6  curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip
    7  unzip -o identity_linux_amd64.zip
    8  chmod +x identity
    9  sudo mv identity /usr/local/bin/identity
   10  identity create storagenode
   11  identity authorize storagenode 
Removed
   12  grep -c BEGIN ~/.local/share/storj/identity/storagenode/ca.cert
   13  grep -c BEGIN ~/.local/share/storj/identity/storagenode/identity.cert
   14  sudo apt-get remove docker docker-engine docker.io containerd runc
   15  sudo apt-get update
   16  sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg     lsb-release
   17  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
   18  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
   19    $(lsb_release -cs) stable"nightly | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   20  sudo apt-get update
   21  sudo apt-get install docker-ce docker-ce-cli containerd.io
   22  apt-cache madison docker-ce
   23  sudo apt-get update
   24  sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg     lsb-release
   25  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
   26  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
   27    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   28  sudo apt-get update
   29  sudo apt-get install docker-ce docker-ce-cli containerd.io
   30  apt-cache madison docker-ce
   31  sudo apt-get install docker-ce=5:20.10.6~3-0~ubuntu-focal docker-ce-cli=5:20.10.6~3-0~ubuntu-focal containerd.io
   32  sudo docker run hello-world
   33  docker run hello-world
   34  sudo groupadd docker
   35  sudo usermod -aG docker $USER
   36  newgrp docker 
   37  docker run hello-world
   38  sudo systemctl enable docker.service
   39  sudo systemctl enable containerd.service
   40  docker pull storjlabs/storagenode:latest
   41  docker run --rm -e SETUP="true"     --mount type=bind,source=/home/mario/.local/share/storj/identity/storagenode,destination=/app/identity     --mount type=bind,source=/dev/sdb1,destination=/app/config     --name storagenode storjlabs/storagenode:latest
   42  docker run --rm -e SETUP="true"     --mount type=bind,source=/usr/local/bin,destination=/app/identity     --mount type=bind,source=/dev/sdb1,destination=/app/config     --name storagenode storjlabs/storagenode:latest
   43  docker run --rm -e SETUP="true"     --mount type=bind,source=/dev/sda1,destination=/app/identity     --mount type=bind,source=/dev/sdb1,destination=/app/config     --name storagenode storjlabs/storagenode:latest
   44  docker run --rm -e SETUP="true"     --mount type=bind,source=/home/mario/.local/share/storj/identity/storagenode,destination=/app/identity     --mount type=bind,source=/dev/sdb1,destination=/app/config     --name storagenode storjlabs/storagenode:latest
   45  docker run --rm -e SETUP="true"      --mount type=bind,source=home/mario/.local/share/storj/identity/storagenode,destination=/app/identity --mount type=bind,source=/dev/sdb1,destination=/app/config --name storagenode storjlabs/storagenode:latest
   46  git clone https://github.com/konsou/storj-node-setup.git
   47  cd storj-node-setup
   48  ./storj-node-setup.sh
   49  curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip
   50  unzip -o identity_linux_amd64.zip
   51  chmod +x identity
   52  sudo mv identity /usr/local/bin/identity
   53  identity create storagenode
   54  docker pull storjlabs/storagenode:latest
   55  sudo apt-get remove docker docker-engine docker.io containerd runc
   56  sudo apt-get update
   57  sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg     lsb-release
   58  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
   59  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
   60    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   61  sudo apt-get update
   62  sudo apt-get install docker-ce docker-ce-cli containerd.io
   63  apt-cache madison docker-ce
   64  sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
   65  sudo apt-get install docker-ce= 5:20.10.6~3-0~ubuntu-focal docker-ce-cli= 5:20.10.6~3-0~ubuntu-focal containerd.io
   66  sudo apt-get install docker-ce=5:20.10.6~3-0~ubuntu-focal docker-ce-cli= 5:20.10.6~3-0~ubuntu-focal containerd.io
   67  sudo docker run hello-world
   68  sudo usermod -aG docker $USER
   69  newgrp docker 
   70  docker run hello-world
   71  sudo systemctl enable docker.service
   72  sudo systemctl enable containerd.service
   73  docker pull storjlabs/storagenode:latest
   74  df -HT
   75  lsblk
   76  lsblk -d -fs /dev/<location (example: sda2)>
   77  lsblk
   78  lsblk -d -fs /dev/sdb1
   79  sudo mkdir /mnt/storjfiles
   80  sudo nano /etc/fstab
   81  y
   82  sudo nano /etc/fstab
   83  sudo mount -a
   84  sudo nano /etc/fstab
   85  sudo mount -a
   86  sudo nano /etc/fstab
   87  sudo mount -a
   88  sudo mkdir /mnt/storjfiles
   89  lsblk -d -fs /dev/sdb1
   90  lsblk
   91  lsblk -d -fs /dev/sdb
   92  lsblk
   93  lsblk -d -fs /dev/sdb1
   94  sudo mkdir /mnt/storjfiles
   95  sudo nano /etc/fstab
   96  sudo mount -a
   97  sudo nano /etc/fstab
   98  sudo mount -a
   99  lsblk
  100  lsblk -d -fs /dev/sdb1
  101  sudo mkdir /mnt/storagefiles
  102  sudo nano /etc/fstab
  103  sudo mount -a
  104  sudo nano /etc/fstab
  105  df -HT
  106  sudo mount -a
  107  sudo mkdir /mnt/sdb1
  108  sudo mount -a
  109  df -HT
  110  docker pull storjlabs/storagenode:latest
  111  sudo mount -a
  112  docker run --rm -e SETUP="true"     --mount type=bind,source=/home/mario/.local/share/storj/identity/storagenode,destination=/app/identity     --mount type=bind,source=/mnt/sdb1,destination=/app/config     --name storagenode storjlabs/storagenode:latest
  113  ls /mnt/sdb1
  114  echo 1 > /mnt/sdb1/storagenode/1.txt
  115  cat /mnt/sdb1/storagenode/1.tx
  116  rm /mnt/sdb1/storagenode/1.txt
  117  mkdir /mnt/sdb1/storagenode
  118  rm -rf /mnt/sdb1/storage
  119  rm /mnt/sdb1/config.yaml
  120  rm -rf /mnt/sdb1/storage
  121  rm /mnt/sdb1/config.yaml
  122  sudo rm -rf /mnt/sdb1/storage
  123  /mnt/sdb1/storagenode
  124  mkdir /mnt/sdb1/storagenode
  125  echo 1 > /mnt/sdb1/storagenode/1.txt
  126  cat /mnt/sdb1/storagenode/1.txt
  127  rm /mnt/sdb1/storagenode/1.txt
  128  docker run --rm -e SETUP="true" --mount type=bind,source=/home/mario/.local/share/storj/identity/storagenode,destination=/app/identity --mount type=bind,source=/mnt/sdb1/storagenode,destination=/app/config --name storagenode storjlabs/storagenode:latest
  129  cp -r /home/mario/.local/share/storj/identity/storagenode /mnt/sdb1/identity
  130  docker run -d --restart unless-stopped --stop-timeout 300     -p 28967:28967     -p 127.0.0.1:14002:14002     -e WALLET=REMOVED     -e EMAIL=REMOVED    -e ADDRESS=removed:28967" \
  131      -e STORAGE=3.5TB \
  132      --mount type=bind,source="/mnt/sdb1/identity",destination=/app/identity \
  133      --mount type=bind,source="/mnt/sdb1/storagenode",destination=/app/config \
  134      --name storagenode storjlabs/storagenode:latest
  135  docker run -d --restart unless-stopped --stop-timeout 300     -p 28967:28967     -p 127.0.0.1:14002:14002     -e WALLET=REMOVED     -e EMAIL=REMOVED     -e ADDRESS=REMOVED:28967"     -e STORAGE=3.5TB     --mount type=bind,source="/mnt/sdb1/identity",destination=/app/identity     --mount type=bind,source="/mnt/sdb1/storagenode",destination=/app/config     --name storagenode storjlabs/storagenode:latest
  136  docker run -d --restart unless-stopped --stop-timeout 300     -p 28967:28967     -p 127.0.0.1:14002:14002     -e WALLET=Removed   -e EMAIL=Removed     -e ADDRESS=Removed:28967" \
  137      -e STORAGE=3.5TB \
  138      --mount type=bind,source="/mnt/sdb1/identity",destination=/app/identity \
  139      --mount type=bind,source="/mnt/sdb1/storagenode",destination=/app/config \
  140      --name storagenode storjlabs/storagenode:latest
  141  docker run -d --restart unless-stopped --stop-timeout 300     -p 28967:28967     -p 127.0.0.1:14002:14002     -e WALLET=removed     -e EMAIL=removed     -e ADDRESS=removed:28967"     -e STORAGE=3.5TB     --mount type=bind,source="/mnt/sdb1/identity",destination=/app/identity     --mount type=bind,source="/mnt/sdb1/storagenode",destination=/app/config     --name storagenode storjlabs/storagenode:latest
  142  docker ps -a
  143  sudo docker ps -a
  144  sudo rm -rf /mnt/sdb1/storage
  145  docker run --rm -e SETUP="true" --mount type=bind,source=/home/mario/.local/share/storj/identity/storagenode,destination=/app/identity --mount type=bind,source=/mnt/sdb1/storagenode,destination=/app/config --name storagenode storjlabs/storagenode:latest
  146  docker logs --tail 20 storagenode
  147  docker ps -a
  148  docker stop storagenode
  149  docker rm storagenode

[/quote]
Here you go hopefully i did it correct

Looks like you missed the left quote, it should be

-e ADDRESS="Removed:28967"

so i need to leave the quotes i removed them

You need it in the command when you execute it.
In your history (I removed the one remained real address in your post) all your ADDRESS parameters have missed a left quote -e ADDRESS=xxx.xxx.xxx.xxx:28967"

what about the other quotes for hdd capacity etc …put them all back?

Yes, replace only values between quotes. Or remove all quotes completely. One missed without a pair will wait when you put it and will not execute a command. It will show something like

mario@mario-System-Product-Name~$ docker run ... -e ADDRESS=redacted:28967" ...
>

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ec0aae37348 storjlabs/storagenode:latest “/entrypoint” 25 seconds ago Up 24 seconds 127.0.0.1:14002->14002/tcp, 0.0.0.0:28967->28967/tcp, :::28967->28967/tcp storagenode
ea94ca17f827 hello-world “/hello” 2 hours ago Exited (0) 2 hours ago competent_almeida
515600df2ad3 hello-world “/hello” 2 hours ago Exited (0) 2 hours ago jovial_dijkstra
15a27a41a453 hello-world “/hello” 4 hours ago Exited (0) 4 hours ago nostalgic_brahmagupta
ec4cdc6e47f1 hello-world “/hello” 4 hours ago Exited (0) 4 hours ago pensive_goodall
mario@mario-System-Product-Name:~$

Looks better
Please, try to open your dashboard http://localhost:14002

Your Storage Node Stats

STATUS

Online

UPTIME

1m

LAST CONTACT

0m ago

VERSION

v1.29.3

PERIOD

May

Choose your satellite: All Satellites

8.45KB

KB

0B*h

Bytes*h

thank you so much brother you are a rockstar

1 Like

Congratulations!
And welcome aboard!

2 Likes

thank you and have a great day

1 Like

by the way how do you save your identity to a flash drive ?

Not needed. I store identity on the drive with data. They useful only together. Either identity without data or data without identity are useless, you will be forced to start from scratch.
The backup of the identity could be useful only if disk start to die but corrupted only identity (literally 6 small files, less than a few kb is size)

ok i understand…but it wont be an issue if i decide to install and use a bigger drive ?

Then you can either migrate this one to the bigger one (and clean the old one) or just run a second node with a new identity on the next free ports. Do not copy identity for the second node, generate a new one.
To be able to do so on the same PC you can specify a new name, for example

identity create storagenode2

It will create a new identity in /home/mario/.local/share/storj/identity/storagenode2

wow thats cool i didnt think that i could have have more than one node running at the same time per machine

Yes, you can. Use different port, identities and drives.
FYI - all nodes behind the same /24 subnet of public IPs treated as a one node for uploads and as a different ones for downloads and audits. So, adding more nodes in the same subnet will not increase ingress traffic.

ok thats fine …i just checked my node and it says offline …it says last seen 6+ hrs is there any thing i can do to check why?

apparently restarting brought it back up …but is that normal?

You can check your logs (if you didn’t remove the container): https://docs.storj.io/node/resources/faq/check-logs
To keep logs even when container is removed, you can redirect logs to the file: How do I redirect my logs to a file? - Node Operator

Usually node could going offline, if your external (or internal) address is changed.
To protect your node from local IP change you can assign a static local IP either via router or on PC itself.
To protect from external address change you can register DDNS hostname and use it instead of public IP in docker run command: Port Forwarding - Node Operator