Rent your synology unused disk space with Storj.io on docker

in #cryptocurrencies7 years ago (edited)

1. Create Synology shared folder if necessary

This shared folder will be used to store storj config and files

 /volume1/docker

2. Create synology storj user

Create a user "storj" (or something else), who will hold the storj directories at fs level

3. Create subdirectories

cd /volume1/docker/
mkdir -p storj/config storj/data storj/logs
chown -r storj /volume1/docker/storj/*
chmod -R 755 /volume1/docker/storj/*

4. Docker Installation

Simply find and install a Docker application from the Synology Package Center.

Note: If you do not find the application in your Package Center, your Synology is most probably not supported yet:

Due to the hardware requirement, Docker will be only available on the following models:
18 series: DS3018xs, DS918+, DS718+, DS218+
17 series: FS3017, FS2017, RS18017xs+, RS4017xs+, RS3617xs+, RS3617xs, RS3617RPxs, DS3617xs, DS1817+, DS1517+
16 series: RS18016xs+, RS2416+, RS2416RP+, DS916+, DS716+II, DS716+, DS216+II, DS216+
15-series:     RC18015xs+, DS3615xs, DS2415+, DS1815+, DS1515+, RS815RP+, RS815+, DS415+
14-series:     RS3614xs+, RS3614xs, RS3614RPxs, RS2414RP+, RS2414+, RS814RP+, RS814+
13-series:     DS2413+, RS3413xs+, RS10613xs+, DS1813+, DS1513+, DS713+
12-series:     DS3612xs, RS3412xs, RS3412RPxs, RS2212RP+, RS2212+, DS1812+, DS1512+, RS812RP+, RS812+, DS412+, DS712+
11-series:     DS3611xs, DS2411+, RS3411xs, RS3411RPxs, RS2211RP+, RS2211+, DS1511+, DS411+II, DS411+
10-series:     DS1010+, RS810RP+, RS810+, DS710+(source, last updated 09-29-2017)

5. Connect as root user in ssh environment

6. Download debian base image from docker hub

docker pull debian

7. Prepare storj image dockerfile

Open new file named docker_storjshare.build with vi 

vi docker_storjshare.build 

and put the docker commands inside :

############################################################
# Dockerfile to build Storj container image
# Based on Debian
############################################################
# Set the base image to Debian
FROM debian
# File Author / Maintainer
MAINTAINER dujnoux
# Update the repository sources list
RUN apt-get update
# Install dependencies
RUN apt-get install -y wget git python build-essential
# Create storj group
RUN groupadd storj -g 1023
# create storj user 
RUN useradd storj -g 1023 -u 1031 -d /home/storj
# Create home directory
RUN mkdir /home/storj && chown storj /home/storj
# Download Node Version Manager (NVM)
RUN su - storj -c "wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.3/install.sh | bash"
# Source environment
RUN su - storj -c "echo 'export NVM_DIR="\$HOME/.nvm"' >> .profile"
RUN su - storj -c "echo '[ -s "\$NVM_DIR/nvm.sh" ] && . "\$NVM_DIR/nvm.sh" # This loads nvm' >> .profile"
# Install Node Version Manager
RUN su - storj -c "nvm install --lts"
# Install Storjshare daemon
RUN su - storj -c "npm install --global storjshare-daemon"
# Set default container command
ENTRYPOINT /bin/bash

8. Build docker image

docker build -t dujnoux/storjshare:latest -f docker_storjshare.build .

9. Create container

docker run -ti -d --name=storj --cpu-shares 50 --memory 2048M -v /volume1/docker/storj/config:/config -v /volume1/docker/storj/data:/data -v /volume1/docker/storj/logs:/logs -p 4000-4005:4000-4005/tcp dujnoux/storjshare:latest

10. Configure storjshare app

Change here the address with your ethereum / bitcoin wallet address. you can get one here : https://www.myetherwallet.com/

Do not use an exchange wallet address !

docker exec -ti storj su - storj -c "storjshare create --storj=YOURETHEREUMADDRESS --size=1TB --storage=/data  --logdir=/logs --outfile=/config/storj.json"

11. Prepare starting script

Open new file named docker_storj_start.sh with vi 

vi docker_storj_start.sh 

and put the starting commands inside :

docker exec -ti storj su - storj -c "storjshare daemon"
docker exec -ti storj su - storj -c "storjshare start --config /config/storj.json"
docker exec -ti storj su - storj -c "storjshare status"

12. Start Storjshare

chmod +x docker_storj_start.sh 
./docker_storj_start.sh 

13. It should show you something like that :

Sort:  

Congratulations @dujnoux! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Vote
You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @dujnoux! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

SteemitBoard - Witness Update

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @dujnoux! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.14
TRX 0.12
JST 0.026
BTC 54657.34
ETH 2331.85
USDT 1.00
SBD 2.14