Share storage space on Storj with the Linux daemon

in #utopian-io8 years ago (edited)

Share unused space disk on Storj with the Linux daemon

storj.jpg

What Will I Learn ?

  • You will learn to share a unused space disk on Storj with Linux
  • You will learn to connect you node with a web interface for monitoring
  • You will learn to create a basique bash script for launch you StorjShare Node

Requirements

  • Basic knowledge of the Linux console
  • A machine that will act as server (VPS, old recycled PC in local server, Raspberry Pi) with at least 1 GB of ram.
  • Space disk reserved for Storj
  • Ethereum wallet supporting the ERC20 tokens

Difficulty

  • Easy (if you know Linux)
  • Middle ( if you don't know Linux )

Tutorial Contents

Hello, in this tutorial i will show you how to set up a StorjShare node under Linux on the command line.
As a reminder, Storj wants to be a decentralized alternative to Dropbox, OneDrive, Google Drive, etc ..

The files stored by Storj users are hosted on multiple StorjShare nodes that will be rewarded in Storj for their contributions.

Our goal is to host a StorjShare node to share the disk space of your choice. We will do all this under Linux, more precisely under Ubuntu Server 16.04, and without using a graphical user interface.

Installation of the programs

We're going to start from the fact that we have a working Ubuntu Server 16.04 machine (in my case a KVM virtual machine) with remote access via SSH.

Let's start by installing all the dependancy :

sudo apt update && sudo apt install git python build-essential python3-pip python3-setuptools python3-wheel

Now we will proceed with the installation of Node. JS and NPM, for that we will need NVM. Enter this command in your device to download and run the NVM installation script:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

NVM is now installed but the' nvm' command will not be recognized. So we need to update the ~/. bashrc file with the following command:

source ~/.bashrc

NVM is now usable, we will be able to install Node. JS and NPM with this command:

nvm install --lts

We can now install StorjShare with the NPM package manager:

npm install --global storjshare-daemon

Now we're done with this first step, which was to install everything necessary.

Preparation of folder

Prepare the folder in which you will store the data hosted by your Storj node and another folder for scripts and configuration files. In my case, I would store the data hosted by Storj in /home/LOGIN/StorjData and the start/configuration files in /home/LOGIN/Storj which gives us the following command:

mkdir ~/StorjData && mkdir ~/Storj

Also provide a folder for the logs, I put it in /home/LOGIN/Storj/logs for my part.

mkdir ~/Storj/logs
Configuration of StorjShare node

With StorjShare installed, we have access to its dedicated command. You can see the options available with the command storjshare --help .

To create our configuration for StorjShare we are interested in the' create' function of storjshare. Display the list of options with storjshare create --help.

To create your StorjShare node configuration, enter this command by changing the parameters marked with a star (*):

storjshare create --storj 0x4238498BeA0c72E56c617ed8D61E723D1F568214* --storage /home/wargof/StorjData* --size 55GB* --tunnelportmin 4000 --tunnelportmax 4003 --noedit --manualforwarding --logdir /home/wargof/Storj/logs* --outfile /home/wargof/Storj/config.json*

For the option --storj simply enter your Ethereum address.
It is mandatory to indicate an ETH address whose private keys you own!**

For the option --storage, specify the path of the directory where StorjShare must store the hosted data.

Complete the option --size with the maximum weight that you allocate to StorjShare (GB for Go and TB for To).

The parameters --tunnelportmin and --tunnelportmax indicate the row of ports that will be used to communicate with peers. You will need to redirect this port row to your StorjShare node from your Internet box.

Specify the folder that should contain the logs with -logdir /YOUR/DOSSIER/DOSSIER/LOGS and then specify where to save the StorjShare configuration file with --outfile /VOTRE/DOSSIER/NOM_CONFIG.json.

Once you have customized and executed the command in your console, your configuration for your StorjShare node is ready !

Opening and redirecting ports

In order for the outside to communicate with your Storj node, you need to open a few network ports. If you are using a VPS or a dedicated server, skip this step directly.

To work, Storj needs ports 4000,4001,4002 and 4003 open and redirected to the ip of the node.

I'll leave you a few links that will show you the process according to the french ISP :

Redirecting of ports at SFR

Redirecting of ports at Bouygues

Redirecting of ports at Orange

Redirecting of ports at Free

Creating the StorjShare startup script

Instead of starting our StorjShare node in several commands, we will make a very small script.
Create a .sh file in console, we will call it StorjShare_start.sh :

nano ~/Storj/StorjShare_start.sh

Copy and paste this line at the beginning of your file #!/bin/bash.

Paste the following line to start the StorjShare daemon : storjshare daemon.

Return to the line and copy and paste this line by changing the location of the configuration file : storjshare start --config /home/LOGIN/Storj/config.json.

Make your script executable with chmod +x ~/Storj/StorjShare_start.sh and execute it with this command : bash ~/Storj/StorjShare_start.sh.

Your node is now launched ! Check its status with the command storjshare status.

Monitor its StorjShare node with StorjDash

Let's take the last step, which will allow you to follow the state of your node. For this we will use the StorjDash service.
Start by creating an account there and then install StorjDash using pip3 :

sudo pip3 install storjdash

Once StorjDash is installed, let's start its configuration with the command:

sudo register_storjdash

Follow the instructions and enter your StorjDash account email address and password. You will be asked for a name, between what you want, it will be used to identify your node.

Last question, you are asked in which folder your configuration file is located, in my case it's /home/LOGIN/Storj.

And it's almost over! To send the status of your node to StorjDash, just execute this command: send_storj_reports &.
To make our life easier, we will automate the launch of this command every hour using cron.

Let's add the scheduled task in cron, for that we have to edit the list of tasks with crontab -e and add this line at the end:

0 * * * * /usr/bin/send_storj_reports

This line indicates that the command /usr/bin/send_storj_reports will be run every hour, at the first minute. Thanks to this, you will no longer need to access the machine that hosts the node to see the status of StorjShare, just log in to StorjDash.

Curriculum

I don't have yet any tutorials on Utopian to my credit but articles in French about Storj on Steemit.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @wargof I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Congratulations, you were selected for a random upvote! Follow @resteemy and upvote this post to increase your chance of being upvoted again!
Read more about @resteemy here.

yeah nice work man.

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly � Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.077
BTC 65451.14
ETH 1716.20
USDT 1.00
SBD 0.41