How to install a StorJ miner on Ubuntu
In this article we’ll be installing a StorJ miner on Ubuntu (specifically an instance in Azure). Start by opening a Putty session or other command shell to your Ubuntu instance. Then run these commands to install some packages:
sudo apt-get install -y build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev sudo curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential sudo wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash export NVM_DIR="/home/mytestuser/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" nvm install --lts nvm install --lts sudo apt-get update -y sudo apt-get dist-upgrade -y sudo apt-get install git python build-essential -y sudo npm install --global storjshare-daemon
After those commands complete, you should have StorJ installed. Next, we’ll start the StorJ daemon service with this command:
sudo storjshare daemon
Check which drives you want to configure StorJ storage to sit on. Run this command:
This is an example of an A0 Azure instance of Ubuntu. I think it’s the smallest and cheapest instance that Azure offers. Notice that we have 19GB free on /mnt and 27GB free on /. Let’s create folders on those two drives for StorJ:
sudo mkdir /mnt/storj sudo mkdir /storj
Configure a StorJ share location with a command like this:
sudo storjshare-create --storj 0x74e0aF0522024f2dd94F0fb9B82d13782ECCaaF5 --storage /storj --size 26GB
- The –storj 0x74e0aF0522024f2dd94F0fb9B82d13782ECCaaF5 indicates an Ethereum wallet address that you will get paid with StorJ tokens at. You’ll want to set your own Ethereum wallet address here.
- The –storage /storj indicates the path to your storage folder for this StorJ storage share.
- The –size 26GB argument indicates that we want a maximum of 26GB to be used in this StorJ storage location.
After running the storjshare-create command, it brings up an editor that lets you review and change any configuration details you need to. Just type this command to save and close the editor:
When the editor closes, you’ll see a file name and path to the configuration file that was just created during the storjshare-create command. Take note of that and make a copy. The storjshare config file will be a path like this:
Assuming your StorJ daemon service is already started via an earlier command that called “sudo storjshare daemon”, now lets add this configured StorJ path to the StorJshare daemon service with this command:
sudo storjshare start --config /home/mytestuser/.config/storjshare/configs/6f1e73719004ccfdaef6c0bd455711b2d589b0bf.json
That will start the StorJ service on the configured folder that you specify.
If you want to spin up a second configured path for StorJ, you will just run the storejshare-create command again and provide a separate path for the location. When StorJ brings up the configuration editor, change the port from 4000 to 4001 before you save and exit. If you forget to change the port, the second StorJ folder service will not be running after you start it.
You can check your StorJ service status with the storjshare status command like this:
sudo storjshare status