Storj#
docker-compose#
Storj is a distributed filesystem where node operators are rewarded with cryptocurrency for storing data.
Vedi anche
follow the Docker instructions
create an ERC-20 compatible wallet
open the 28967 TCP and UDP ports on your firewalls. These ports are for data transfers. Port 14002 is instead used to monitor your Storj node with a web browser. Port 14002 is not required to be exposed
create the jobs directories
mkdir -p /home/jobs/scripts/by-user/root/docker/storj
create a
Docker compose file
1version: '3.2' 2 3volumes: 4 storj: 5 6services: 7 app: 8 image: storjlabs/storagenode:latest 9 restart: always 10 ports: 11 - 127.0.0.1:14002:14002 12 - 28967:28967/tcp 13 - 28967:28967/udp 14 volumes: 15 - type: bind 16 source: /home/jobs/scripts/by-user/root/docker/storj/identity 17 target: /app/identity 18 - type: bind 19 source: ${DATA_PATH} 20 target: /app/config 21 environment: 22 - SETUP=true 23 - WALLET=${WALLET_ADDRESS} 24 - ADDRESS=${MAIN_DOMAIN}:28967 25 - STORAGE=1.5TB 26 networks: 27 - mynetwork 28 29networks: 30 mynetwork: 31 driver: bridge 32 driver_opts: 33 com.docker.network.bridge.name: br_docker_storj
Nota
Replace
MAIN_DOMAIN
,WALLET_ADDRESS
andDATA_PATH
with appropriate values.download the identity executable
cd /home/jobs/scripts/by-user/root/docker/storj 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
create the authorization token from the host a node page
create and authorize the identity
./identity create storagenode ./identity authorize storagenode ${authorization_token}
move and backup the identity files
cp -aR /root/.local/share/storj/identity/storagenode identity cp -aR /root/.local/share/storj key_backup rm -rf /root/.local/share/storj
run the setup
docker-compose up --remove orphans docker-compose down --remove orphans
set the
SETUP
environment variable tofalse
in the docker-compose fileuse this
Systemd service unit file
1[Unit] 2Requires=docker.service 3Requires=network-online.target 4After=docker.service 5After=network-online.target 6 7[Service] 8Type=simple 9WorkingDirectory=/home/jobs/scripts/by-user/root/docker/storj 10 11ExecStart=/usr/bin/docker-compose up --remove-orphans 12ExecStop=/usr/bin/docker-compose down --remove-orphans 13 14Restart=always 15 16[Install] 17WantedBy=multi-user.target
fix the permissions
chmod 700 /home/jobs/scripts/by-user/root/docker/storj/docker-compose.yml chmod 700 -R /home/jobs/services/by-user/root
run the deploy script
Footnotes