SunCoin Masternode Setup — Linux

Prerequisites

1. A remote server (Virtual Private Server, VPS) which will be used to host our masternode wallet.
2. PuTTY or ssh command (terminal), which will be used to setup the server (install the dependencies, the wallet itself, and configure everything) after the initial configuration.
3. 10000 SunCoin as collateral (10000 SunCoin + transaction fees).

1. Deploy VPS (Masternode Server)

A remote server is required for setting the masternode. You can choose any VPS provider. 
1.1 - I would recommend to choose a location close to you so faster connection will be established.
1.2 - Choose Ubuntu x64 as operating system .
1.3 - Once the server is deployed take note of the IP address and password. You will need them for later use.

2. Configure VPS

2.1 - Start a SSH connection with your VPS, either by using PUTTY or terminal. I will be using terminal in this guide, but feel free to use PUTTY if you need it.

2.2 - Once you have logged in, make sure your update operating system by typing:

apt-get update
apt-get upgrade
(Press Y and ENTER when prompted)
apt-get dist-upgrade
(Press Y and ENTER when prompted)

2.3 - Wait for a few minutes for the update to finish and then install required packages:

apt-get install software-properties-common nano libboost-all-dev libzmq3-dev
libminiupnpc-dev libssl-dev libevent-dev
(Press Y and ENTER when prompted)
add-apt-repository ppa:bitcoin/bitcoin
(Press ENTER when prompted)
apt-get update
apt-get install libdb4.8-dev libdb4.8++-dev
(Press Y and ENTER when prompted)
Let it work for a few minutes and you are all set with operating system.

3. Install Wallet

3.1 - Go to your SSH connection and in your local folder type:

mkdir suncoin && cd suncoin

3.2 - Download the latest wallet version:

wget
https://github.com/suncoin-network/suncoin-core/releases/download/v1.0/suncoin-1.0-linux64.tar.gz

— If main link doesn’t work, try to copy link from github:
https://github.com/suncoin-network/suncoin-core/releases/

3.3 - Extract all files from the wallet tar.gz file using the tar command, delete archive and go to suncoin folder:

tar -xvf suncoin-1.0-linux64.tar.gz && rm suncoin-1.0-linux64.tar.gz && cd
suncoincore-1.0.0/bin

— Name suncoin-1.0-linux64.tar.gz could be different. It depends on current version. Check file name on github repository first and make necessary correction in command if needed.
Extracted folder “suncoincore-1.0.0” may be diffrenent, check by typing ls and look for extracted folder name.

3.4 - Enable launch of SunCoin binaries from any directory and start SunCoin wallet:

chmod +x suncoin*
sudo cp suncoin-cli suncoin-qt suncoin-tx suncoind /usr/local/bin
cd ../..
rm -r -f suncoincore-1.0.0
cd ~
suncoind -daemon

3.5 - Make sure your wallet is syncing with the SUNCOIN network. Wait for at least 10 minutes and then type:

suncoin-cli getinfo
suncoin-cli mnsync status
This result will mean your node is synced. If not wait for a few more minutes.

4. Wallet Configuration

Now with wallet correctly installed, we will need to transfer collateral funds to setup masternode.

4.1 -First of all we will need to setup Masternode configuration in wallet. Open Debug console in Tools section and generate the private key for the masternode by typing:

masternode genkey

And copy it to notepad. Save this key for later use.

4.2 - Get SunCoin masternode address. This is address where you should send exactly 10000 SunCoin.

suncoin-cli getaccountaddress masternode

Make sure you copy it to buffer or paper and send 10000 (Exactly​) SunCoin from exchange to this address in one single transaction. Make sure you correctly set receiving address in transaction before confirming.

Wait for 15 confirmations (30 minutes approximately) and check balance in your wallet.


5. Masternode Configuration

5.1 - Stop wallet and edit suncoin.conf file:

cd ~
cd .suncoincore
suncoin-cli stop
nano suncoin.conf

5.2 - Now you should set RPCUSER(any), RPCPASSWORD(any), EXTENALIP(your VPS ip address) and MASTERNODEPRIVKEY(we got it on step 4.1). Copy text to notepad and paste it in file:

rpcuser=xgkf3DrlPwhrE6u (type a sequence of chars and numbers, something like this)
rpcpassword=PEna3Lcu0L47F24 (type a sequence of chars and numbers, something likethis)
rpcallowip=127.0.0.1
rpcport=4331
listen=1
server=1
daemon=1
logintimestamps=1
maxconnections=256
externalip=xxx.xxx.xxx.xxx (Set it to your VPS IP)
port=10332
masternode=1
masternodeprivkey=(paste here your private from step 4.1)

Change values accordingly.

5.3 - Start suncoind again and wait for full sync.

suncoind -daemon

5.4 - Get masternode collateral_output_txid and collateral_output_index by typing:

suncoin-cli masternode outputs
and save it to notepad without quotes and brackets.

5.5 - Edit masternode.conf file:

nano masternode.conf

5.6 - Add to the bottom of file your data (separated by spaces):

Masternodename — any you want
IP:port — Your VPS ip address and port 10332(port is fixed for all)
masternodeprivkey — You got it from step 4.1
collateral_output_txid — first part of masternode outputs (step 5.4)
collateral_output_index — second part of masternode outputs (usually 1 or 0)

5.7 - Save changes in masternode.conf file and exit.

5.8 - Stop and restart suncoin server by:

suncoin-cli stop
suncoind -daemon
It should return “Suncoin Core server starting”

5.9 - Make sure your wallet is syncing with the SunCoin network:

suncoin-cli getinfo
suncoin-cli mnsync status
Wait for a few minutes and if last command returns the following message, wallet is synced:
“AssetName”: “ MASTERNODE_SYNC_FINISHED “,
“IsBlockchainSynced”: true ,
“IsMasternodeListSynced”: true ,
“IsWinnersListSynced”: true ,
“IsSynced”: true ,

Check port 10332 (suncoin server port) is open in case you have deployed a firewall. Open it by typing:

sudo allow 10332/tcp
sudo ufw enable

Nodes may be added to suncoin.conf file Add these lines at the bottom of file:

addnode=54.38.53.27
addnode=151.80.177.104
addnode=208.167.249.240
addnode=185.10.57.170
addnode=208.72.56.209
addnode=45.32.179.37
addnode=121.251.136.186
addnode=149.28.45.79

6. Install Sentinel (VPS)

6.1 - Go back to your VPS connection and make sure Python version 2.7.x or above is installed:

cd ~
python — v
cd /root/suncoin

6.2 - Update and install requirements:

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

6.3 - Download and install sentinel:

git clone https://github.com/suncoin-network/sentinel && cd sentinel

6.4 - Create a Virtual Environment in python and install requirements:

apt install virtualenv 
(Press Y and ENTER when prompted)
virtualenv ./venv
./venv/bin/pip install -r requirements.txt

6.5 - Schedule execution of sentinel by setting up a crontab entry to call Sentinel every minute:

crontab -e

Copy and paste this text:

* * * * * cd /root/suncoin/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null
2>&1

6.6 - Save changes in crontab and exit. If you are using nano press CTRL+O -> ENTER ->CTRL+X.

6.7 - Configuring Sentinel:

nano sentinel.conf

6.8 - Set suncoin configuration file:

suncoin_conf=/root/.suncoincore/suncoin.conf

6.9 - Save changes in file and exit. If you are using nano press CTRL+O -> ENTER -> CTRL+X.

6.10 - Test Sentinel:

cd /root/suncoin/sentinel
SENTINEL_DEBUG=1 ./venv/bin/python bin/sentinel.py

Run command after masternode start only. It will not show sentinel status now.


7. Start Masternode

7.1 - Start masternode by typing:

suncoin-cli masternode start-all

7.2 - To check masternode status:

suncoin-cli masternode status

Your status will become “PRE_ENABLED” and then, after 30–60min, it will be changed to “ENABLED” (*)

(*) Sometimes you should wait for 1–2 hours for your masternode sync with another nodes and become ready for starting, if it not start immediately don’t worry, just try a little bit later.

If after that time your masternode status is “NEW_START_REQUIRED”, relaunch your node by repeating step.

Don’t worry if status is “WATCHDOG_EXPIRED”. It will go back to “ENABLED” in 30–60minutes.

7.3 - You can also check if masternode is properly working by checking your masternode address
in suncoin explorer https://sun.overemo.com/.


Guide created by @tipinatipi Published for SunCoinFoundation.
SCF Donation address: STLWKWEmED8DVVYVvFwXdRnoedYmPmvgei