Files
Obsidian-Main/00. Inbox/Linux/架站/Storj.md

4.0 KiB
Raw Blame History

步驟摘要

  1. https://www.storj.io/host-a-node申請一個auth token。
  2. 用identify產生key。
  3. 認證 key。
  4. 備份 key
  5. Setup storj docker。
  6. Run storj docker。
  7. 更新

1. 申請一個auth token

https://www.storj.io/host-a-node填入email會產生一個伴隨email的隨機碼。 !Pasted image 20240114200907.png

這一串要記下來。

用identify產生key

下載

Windows

下載 https://github.com/storj/storj/releases/latest/download/identity_windows_amd64.zip

Linux

X86

curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip  
unzip -o identity_linux_amd64.zip  
chmod +x identity  
sudo mv identity /usr/local/bin/identity

ARM

curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_arm.zip -o identity_linux_arm.zip
unzip -o identity_linux_arm.zip
chmod +x identity
sudo mv identity /usr/local/bin/identity

產生 identity

這一步會跑很久建議用CPU比較強的來跑在樹莓派上面會跑很久。

Windows

./identity.exe create storagenode

Linux

identity create storagenode

認證 Key

認證

等一下的 <email:characterstring> 就是第1步說要記起來的那一串

Windows

./identity.exe authorize storagenode <email:characterstring>

Linux

identity authorize storagenode <email:characterstring>

確認

Windows

(sls BEGIN "$env:AppData\Storj\Identity\storagenode\ca.cert").count 應該要return 2 (sls BEGIN "$env:AppData\Storj\Identity\storagenode\identity.cert").count 應該要return 3

Linux

grep -c BEGIN ~/.local/share/storj/identity/storagenode/ca.cert 應該要return 2 grep -c BEGIN ~/.local/share/storj/identity/storagenode/identity.cert 應該要return 3

備份 key

Windows 上產生的 key 會放在 %APPDATA%\Storj\Identity\storagenode。 Linux 上產生的 key 會放在 ~/.local/share/storj/identity/storagenode。 記得備份。

Setup storj docker

Do this once.

sudo docker run --rm -e SETUP="true" \
    --mount type=bind,source="/home/awin/storj/key",destination=/app/identity \
    --mount type=bind,source="/home/awin/storj/data",destination=/app/config \
    --name storagenode storjlabs/storagenode:latest

Run storj docker

sudo docker run -d --restart always --stop-timeout 300 \
    -p 28967:28967/tcp \
    -p 28967:28967/udp \
    -p 14002:14002 \
    -e WALLET="0x9Ce80345355Ad8C17991620E13d8423900CEDcd0" \
    -e EMAIL="awinhuang@gmail.com" \
    -e ADDRESS="storj.awin.one:28967" \
    -e STORAGE="1.6TB" \
    --memory=800m \
    --log-opt max-size=50m \
    --log-opt max-file=10 \
    --mount type=bind,source=/home/awin/storj/key,destination=/app/identity \
    --mount type=bind,source=/home/awin/storj/data,destination=/app/config \
    --name storagenode storjlabs/storagenode:latest

更新

更新 node 可以選擇用 docker 裝storjlabs/watchtower ,或是手動更新

watchtower

sudo docker pull storjlabs/watchtower
sudo docker run -d --restart=always --name watchtower -v /var/run/docker.sock:/var/run/docker.sock storjlabs/watchtower storagenode watchtower --stop-timeout 300s

00. Inbox/樹莓派/Watchtower 跑起來之後,可以用 sudo docker exec -it storagenode /app/dashboard.sh 來即時觀察執行流量。

手動

sudo docker stop -t 300 storagenode
sudo docker rm storagenode
sudo docker pull storjlabs/storagenode:latest

參考