So you've heard about SibCoin (Siberian Chervonets) and masternodes and just bought some coins from the exchange, Whats next?
If you are wanting to set up a masternode, you will need a couple things.
In SibCoins case it is;
- 1000 SibCoins (buy a few extra for trade fees)
- A Server with a static IP or VPS
If you have a static IP to your house then it is possible to set up a Raspberry Pi as your server.
This guide should hopefully help you in setting up your masternode on a Raspberry Pi 3 with SibCoin. You could also use it with some variation to set up other coin masternodes on a Raspberry Pi
I've used many sources and bit of trial and error to get this working. Hopefully this works for you. I will list some of my sources at the end.
Here is a quick overview of some of the steps.
- Setting up RPi3
- RPi3 settings
- Updating RPi, setting up Firewall, swap file & disabling Screensaver
- Downloading SibCoin files
- Downloading and installing a few more dependencies
- Compiling SibCoin
- Updating SibCoin
- Installing Wallet and transferring coins on desktop PC
- Beginning masternode setup on desktop PC
- Modifying masternode.conf on desktop PC
- Adding sibcoin.conf with info on RPi3
- Installing Sentinel
- Editing sentinel.conf
- Getting Masternode fully running
- Cant Reach External IP Fix
Setting up RPi3
If you are like me, I bought a Raspberry Pi with an SD card with NOOBS pre-installed.
These are the steps I took;
- Plug peripherals into RPi 3 (I'm going to assume that you running straight off the Raspberry Pi rather than using a remote connection to it from your computer with a program like Putty)
- Start up RPi 3 (Setup wi-fi if you want)
- Install Raspbian Jessie (takes a little while)
Change a Couple Settings after First Boot
The first thing I did was set up Bluetooth for my wireless keyboard. But in this I am assuming you are using a normal USB mouse and keyboard. If you want to know how to set up Bluetooth, you can try here
- Changed some preferences under Raspberry Pi Configuration like;
- Pasword
- Hostname
- Enable "Wait for Network"
- Change keyboard layout if you need to under keyboard settings - default is UK I think.
- After this you may need to reboot.
Updating RPi3
Main Dependencies
- Open Raspian Terminal located in the top bar.
- Firstly type and let each of these commands (4) run
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential automake autoconf libssl-dev g++ libminiupnpc-dev git libboost-dev libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libtool libevent-dev -y
sudo apt-get install ufw
Swap File
Now that you are up to date, there are a few things you may want to do.
If you have a smallish sized SD card you may want to increase your swap file, a larger SD card should be fine though.
- In terminal type
sudo nano /etc/dphys-swapfile
- Nano is like a text editor. Use the arrow keys to scroll to "CONF_SWAPSIZE=100" and change to "CONF_SWAPSIZE=1024"
- To save press down "ctrl + o" then press enter
- To exit press down "ctrl + x"
Now run these two commands in terminal. (last one might not show a confirmation)
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
Screensaver
Raspian also has a screensaving function which I have found to be annoying and causes me a few issues. There appears to be a few solutions but since I am using Raspian gui this one works for me.
- In terminal type
sudo apt-get install xscreensaver
- Once installed, go to your Raspian main menu > preferences > screensaver
- On mode set to "Disable screensaver"
Firewall
You can set up your firewall now if you want or just leave it until the end. To do so you can run each of these commands in terminal. Sibcoin uses port 1945
sudo ufw allow ssh/tcp
sudo ufw allow 1945
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
*Your firewall is now active.
Downloading SibCoin Files
At this point in terminal you should still be in your user directory. "pi@(your username)" where pi is the default. If you haven't manually changed the directory, you are in the right place.
- If arent in your user directory, run
cd
- Once there, run in terminal
git clone https://github.com/ivansib/sibcoin.git
This will clone the SibCoin files into a folder in your main user folder called "sibcoin"
Downloading Dependency
Next we are going to download berkeley dependency into our SibCoin folder.
- First we need to be sitting in our SibCoin folder.
- In terminal type
cd sibcoin
*You should see something like "pi@darthfishpaste:~/sibcoin $"
- Clone berkeley files (case sensitive) and enable files. Type these commands (4) into terminal and let each run one at a time.
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
- The third command will change our directory
Compiling Berkeley
- Still in the same directory from previous steps eg. "pi@darthfishpaste:~/sibcoindb-4.8.30.NC/build_unix"
- Run in terminal
make -j4
*This took me around 5 minutes to compile
- Then run
sudo make install
*This should be under a minute.
Compiling SibCoin
- Lets go back to our SibCoin directory
cd ~/sibcoin
- Run in terminal (will take a little while)
./autogen.sh
- Run in terminal (the O in "include -O2" is a letter not number if you are typing)(will also take a little while)
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default --without-gui
- At this point I made a backup copy of my SibCoin folder and its contents as the first couple times compiling the SibCoin wallet my RPI3 froze. It does take quite a few hours to compile though, bear in mind. You may want to close any other programs you have open in pi if you are using 4 cores just in case, eg. browser.
- This is set to use default 1 core but if you want to use multiple cores to compile you can add this
"-j4"
so as to look like"make -j4"
My RPi3 appeared to hang when using more than one core for compiling SibCoin, but it may be fine for you. Just make a copy of the folder first and if it hangs try again with the backup. - Run in terminal
make
- After a few hours when it finishes type in
sudo make install
Running Sibcoin on RPi3 and Letting it Update.
First lets start sibcoin;
- Type this in terminal
cd
sibcoind &
- It will take a minute or so to start up
- Once it has you can type in
sibcoin-cli getblockcount
This will show you what blockcount it has updated to.
At the time of writing this it was about 450,000.
It will take an hour or two to update your RPi3 to get to this point, it starts out slow but picks up after a bit. You can keep running the previous command to check its progress.
It should match the current block count in the SibCoin wallet on your desktop PC. If you haven't set that up lets do that now.
If you have, you can skip these steps.
Setting up Local Sibcoin Wallet
So if you've bought some SibCoins on whichever exchange you use, you will want to transfer these and set up a Sibcoin wallet.
To set up a masternode, you will need 1000 Sibcoins; make sure you grab a couple extra so you have enough for transfer fees, and if you want, to send a couple as a test to your wallet first, before sending the bulk of them.
- Download your wallet based on your OS (for this I am using Windows 64)
- You can get the latest version here (at the time of writing - 0.16.1.1) If you are using Windows like me, grab the win64-setup.exe release.
- Install the SibCoin wallet, and remember the directory you let it install its files too. It will ask you at two different points. You can change the directories to whatever conveniences you best.
- Start the wallet up and let it update. It will also take a while to update to the latest blocks.
- Once it has finished updating you will want to encrypt your wallet. You can do this under the "settings" menu.
- Once you have typed in your passphrase it will take a little while to encrypt the first time and then it will ask to restart the wallet.
- The first thing (trust me :<) you want to do once it has encrypted and restarted the wallet is test to make sure your passphrase works by unlocking the wallet via the "settings" menu.
- Once you have confirmed it unlocks and locks with your passphrase you will want to backup your wallet.
- You can do this from the "file" menu. I save two sets of backups when I do it, one locally and one also on a flash drive which I keep a few other sensitive things.
Now that you know the passphrase works and have a backup you will want to send either first a test amount of coins like 1 or 2, or just send the lot if you are bold.
- In the "file" menu of the wallet you can click "Receiving Addresses" and generate a new address which you can send to from the exchange.
- Once you have your 1000+ SibCoins in your local wallet, you will want to backup your wallet again.
- You can also check the current blockcount by going "tools > information"
Setting up First Part of the Masternode on the Desktop PC
- In the wallet on your PC go to "Tools > Debug Console"
1.1 - In console type this command and enter. Save the generated address to a text document, we will need it soon.
getaccountaddress 0
*where "0"
is your masternode alias. You can set this to whatever you like eg. "mn01"
1.2 - Now type in console and note down in the text document and save this result as well;
masternode genkey
1.3 - Now we need to send exactly 1000 coins to the new address we generated in step 1.1;
sendtoaddress < address generated in 1.1> 1000
*Where if the address we generated in 1.1 was "abcde" our command would look like
*"sendtoaddress abcde 1000"
1.4 - Now copy down to the text document and save the tx id (first result) and index id (second result) after typing this in;
masternode outputs
*The first result will be an extremely long code, the second in the single digits. You may also want to wait for 15 confirmations of the sending of 1000 coins before getting the masternode running.
Modifying the "masternode.conf" in our SibCoin Folder on the Desktop PC
- Find the masternode.conf file in your sib folder. If you left the default location you can get to it using these steps.
- Hold down
"Windows + R" - Type in find box;
%appdata%
- Click OK
- Open SibCoin folder
- Open the "masternode.conf" file with a text editor.
- Add the below text to a new line at the bottom then save the file.
<masternode alias name used 1.1> <your house external static IP>:1945 < master node key generated in 1.2> <tx id printed in 1.4> <index id printed in 1.4>
*This is the example
mn1 119.69.69.69:1945 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
*You may want to make a backup of your masternode.conf file as well.
By this point your SibCoin wallet on your RPi3 might be finished updating, check and make sure the blockcounts match your local wallet.
sibcoin-cli getblockcount
Setting up "sibcoin.conf" on RPi3
- In terminal on your RPi3 type
cd
- You should now be at your user directory like "pi@darthfishpaste:~ $"
- Now type this, make sure you have the "." before sibcoin
cd ~/.sibcoin/
*Your path should now look like "pi@darthfishpaste:~/.sibcoin $"
- Create a new .conf document and edit it by running this;
nano sibcoin.conf
- These are the lines you will want to add to it. Then save using "ctrl + o" then enter. Exit the document using "ctrl + x"
rpcuser=<Username>
rpcpassword=<Password>
server=1
listen=1
daemon=1
masternode=1
masternodeprivkey="Key from step 1.2"
externalip="Your Home IP":1945
*Here is an example. Username and password can be anything you like.
rpcuser=darthfishpaste
rpcpassword=darthfishpasteiscool
server=1
listen=1
daemon=1
masternode=1
masternodeprivkey=3HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg
externalip=119.69.69.69:1945
Installing Sentinel
We now need to install Sentinel on the RPi3
Make sure you are in your user directory eg. "pi@darthfishpaste: ~$"
cd
- Now type in terminal
sudo apt-get -y install python-virtualenv
- Once this is done we will clone the Sentinel repo, cd into the Sentinel folder and setup up the env for Sentinel to run.
- Run each command(3) after the previous finishes
git clone https://github.com/ivansib/sentinel.git && cd sentinel
virtualenv ./venv
./venv/bin/pip install -r requirements.txt
Scheduling Sentinel
- In terminal type;
crontab -e
- Choose the second option to open with nano (2) and enter.
- Scroll to the bottom of the text document and add this line
* * * * * cd /home/pi/sentinel/ && venv/bin/python bin/sentinel.py >/dev/null 2>&1
- The the location after "cd" is the location of we have installed sentinel to. If you put sentinel in the sibcoin folder for example, it would have looked like /home/pi/sibcoin/sentinel
Editing the "sentinel.conf"
- We also need to edit our "sentinel.conf" file to find our "sibcoin.conf file", since it is saved in a location that is different to the default.
- Make sure you are in your sentinel folder
- It should look like "pi@darthfishpaste:~/sentinel $"
- If you aren't there type in console
cd
cd sentinel
- Now lets edit "sentinel.conf"
- In terminal type
nano sentinel.conf
- In the third line you will want to rename your sibcoin.conf path location to the one located on your RPi3
- It should look like this
sibcoin_conf=/home/pi/.sibcoin/sibcoin.conf
*You will need to remove the "#" at the beginning. Also remember the "." before the first "sibcoin"
- Save the file "ctrl - o" and enter then exit.
- Then reboot your RPi3
reboot
Starting the Masternode Up
Once your RPi3 has rebooted open terminal and run this;
sibcoind &
*You should get a response telling you that SibCoin is loading
- Now go to your desktop wallet on your PC
- Go to "tools>debug console"
- In the console you will want to type this;
masternode start-alias < masternode alias name used in 1.1>
*Example
masternode start-alias 0
- You should get a message in the debug window along the lines of;
"alias": "0",
"result": "successful"
On your RPi3 type this into the terminal
sibcoin-cli masternode status
- You should hopefully get this result;
"vin": "CTxIn(COutPoint(< tx id from step 1.4>, 1), scriptSig=)",
"service": "Your house external IP:1945",
"payee": "Your address from Step 1.1",
"status": "Masternode successfully started"
It may be possible you get something along the lines of;
vin": "CTxIn(COutPoint(< tx id from step 1.4>, 1), scriptSig=)",
"service": "Your house external IP:1945",
"status": cant reach "Your house external IP":1945
The next step should help you solve this.
Can't Reach External IP Fix
- In terminal on your RPi3, make sure you are in your user directory
cd
- Type this in
sudo iptables -t nat -I OUTPUT -d <IP> -p tcp --dport 1945 -j REDIRECT --to-ports 1945
Where <IP>
is your external ip address,
*Example;
sudo iptables -t nat -I OUTPUT -d 119.69.69.69 -p tcp --dport 1945 -j REDIRECT --to-ports 1945
- Reboot your RPi3
reboot
Now run the previous steps again from "Starting the masternode up"
Once this is done, you can use the "Masternodes" tab in your wallet on your desktop PC to check the status of your masternode.
Pre-Enabled - It will be like this just after you set up your masternode.
Enabled - It should switch to this after around 15 minutes if your masternode is properly set up
Watchdog-Expired - Sentinel is not working as it should
New-Start-Required- Try restarting your masternode
masternode start-alias < masternode alias name used in 1.1>
- You can test to see if your sentinel is working by going to the sentinel directory in terminal on your RPi3
cd ~/sentinel
Then running this command
venv/bin/python bin/sentinel.py
*If there is an error, it will let you know
As far as I can tell you don't need to port forward 1945 on your modem/router. If you want to though. The best thing to do is to set a static internal IP for for RPi3 and port forward 1945 on your modem to that address.
If you have any questions or possibly any suggestions, you can join the SIB Slack
sibcoin.slack.com
Big thanks to @cliff-on-crypto whose tutorial helped a lot.
As well as @mskavim SibCoin vps tutorial
More information was gathered by just googling stuff.
May i pls get an invitation to the slack group? Kindly send invite to [email protected]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @darthfishpaste! You received a personal award!
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!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit