SIBCOIN Masternode Setup: Complete Guide - Linux/Raspberry Pi 3

in sibcoin •  7 years ago  (edited)

To setup a Siberian Chervonets masternode you need:

  1. 1000 SIBCoins
  2. A Raspberry Pi 3
  3. A basic knowledge of Linux and command line
  4. A fully functional and synchronized SIBCoin GUI Wallet, for example SIBCoin QT
  5. A permanent IP address.

1) Prepare your Raspberry Pi 3:

a) Install the latest version of Raspbian Jessie Lite.
Download: https://www.raspberrypi.org/downloads/raspbian/

b) Flash it into a 32GB SD card Class 10 using a method of your choice or Etcher.
Download: https://etcher.io/

c) Access your Raspberry Pi 3 through SSH or a console cable and run [sudo raspi-config], go into “Boot Options” and “Expand File System”. You will be asked to reboot your Pi.

d) After rebooting, login as root and run [sudo passwd] to change the root user’s password, choose a secure password. Reboot your Pi once more with [sudo reboot].

e) Login as root using your new secure password and change the pi username to something different. Replace user_name with the new user name of your choice.

$ sudo usermod -l user_name -d /home/user_name -m pi
$ sudo chown user_name /home/user_name

f) Reboot again and login this time with your new user_name.

g) Update Raspberry Pi:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade

2) Securing Raspbery Pi 3 with firewall rules

a) Run the following command to install UFW, keeping open only the doors needed for the masternode

$ sudo apt-get install ufw

b) After the installation, allow and limit access to the box:

$ sudo ufw allow ssh/tcp
$ sudo ufw limit ssh/tcp
$ sudo ufw allow 1945/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo reboot

c) After rebooting, login and check the firewall status:

$ sudo ufw status → It should say active and limited to the ports we configured above (22 and 1945 TCP)

3) Installing libraries and dependencies before compiling the wallet

a) In order to successfuly compile SIB Coin Wallet, the following packages are needed:

$ sudo apt-get install dh-autoreconf
$ sudo apt-get install libboost-all-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install libevent-dev

b) Installing Berkeley 4.8.30:

$ cd ~/
$ wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
$ sudo tar -xzvf db-4.8.30.NC.tar.gz
$ cd db-4.8.30.NC/build_unix
$ ../dist/configure --enable-cxx
$ make (here you can grab a cup of coffee, it might take 30 minutes or even more)
$ sudo make install
$ export CPATH="/usr/local/BerkeleyDB.4.8/include"
$ export LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
$ sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so/usr/lib/libdb-4.8.so
$ sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so/usr/lib/libdb_cxx-4.8.so

4) Expand the swap file size before compiling the wallet

a) Edit dphys-swapfile to increase the swap size:

$ sudo nano /etc/dphys-swapfile → change CONF_SWAPSIZE from 100 to 1024 and save the file

b) Restart the service that manages the swapfile:

$ sudo /etc/init.d/dphys-swapfile stop
$ sudo /etc/init.d/dphys-swapfile start

c) You can verify the amount of memory + swap by giving the following command:

$ free -m

5) Download Siberian Chervonets wallet, compile and install

$ cd ~/
$ git clone https://github.com/ivansib/sibcoin
$ cd sibcoin
$ ./autogen.sh
$ .configure (now you can even take a nap, it will take around two hours to finish)
$ sudo make install

6) Configure the wallet at the client side

a) Open SIB Coin local wallet QT debug window and type:

  • getaccountaddress 0 → Write down the <account_address>
  • masternode genkey → Write down the <masternode_key>
  • sendtoaddress <account_address> 1000 → Write down the <output_txid>
  • masternode outputs → Write down the <masternode_hash> and <output_number>

b) Go to “Settings → Options...” and at the Wallet tab, select “Show Masternodes Tab”, click OK and restart the wallet.

7) Configure the remote server

a) At the client side create the file masternode.conf file

  • For Windows: Usually under C:\users*user_name*\appdata\roaming\sibcoin
  • For Linux: Usually under ./sibcoin

Insert the following at the end of the file:

MN1 public_ip:1945 masternode_key masternode_hash output_number

b) At the remote server create the sibcoin.conf file:

$ cd ~/
$ mkdir .sibcoin
$ cd .sibcoin
$ sudo nano sibcoin.conf

rpcuser=<choose a username without special characters such as $%/;# etc.>
rpcpassword=<choose a password without special characters such as $%/;# etc.>
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
masternodeprivkey=<masternode_key>
externalip=<public_ip>

Save the file and exit.

c) Start SIBCoin daemon with: $ sibcoind

Important: The local wallet needs to have 15 confirmations for the 1000 SIB transaction and the remote server needs to be fully synchronized.

To test if the server is synchronized: sibcoin-cli mnsync status
The expected result is supposed to be: "IsBlockchainSynced": true

d) After it is syncronized, restart a local client and a remote server

e) At the local wallet open “Tools → Debug Console” and type:

$ masternode start-all

Or you can also try:

$ masternode start-alias MN1

As a result you’ll see the following:

{
"overall" : "Successfully started 1 masternodes, failed to start 0, total 1",
"detail" : {
"status" : {
"alias" : "mn1",
"result" : "successful"
}
}
}

f) At the remote server give a command: sibcoin-cli masternode status | grep status OR sibcoin-cli masternode debug.

The expected result should be: "status": "Masternode successfully started"

g) To test if the masternode is seen by the network, give the command: masternodelist status <public_ip>

8) Install Sentinel at remote server

From 0.16.1.1 Sentinel software needs to be installed in the same server the master node is running

a) Make sure Python version 2.7.x or above is installed: python --version

b) Update system packages and ensure virtualenv is installed:

$ sudo apt-get update
$ sudo apt-get -y install python-virtualenv

c) Make sure the local Sibcoin daemon is running on at least version 16.1 (160100)

$ sibcoin-cli getinfo | grep version

d) Clone the Sentinel repo and install Python dependencies.

$ git clone https://github.com/ivansib/sentinel.git && cd sentinel
$ virtualenv ./venv
$ ./venv/bin/pip install -r requirements.txt

e) Setup a crontab entry to call Sentinel every minute

$ sudo crontab -e -u pi

          • cd /home/[your_username]/sentinel/ && venv/bin/python bin/sentinel.py >/dev/null 2>&1

f) Test the configuration

./venv/bin/py.test ./test

That’s it! You have a fully functional SIBCoin masternode running on a Raspberry Pi3!

References:

[1] https://mysibcoin.ru/threads/sibcoin-masternode-set-up.21/
[2] http://forum-nso.ru/threads/2114/#post-58956
[3] https://github.com/ivansib/sentinel
[4] https://github.com/ivansib/sibcoin
[5] http://sibcoin.org/en/download
[6] https://forum.pivx.org/t/updated-edited-raspberry-pi-masternode-setup/609
[7] https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/overview
[8] http://bittogether.com/index.php?topic=5.0

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @heshka! 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!