SCORECOIN MASTERNODE COMPLETE SETUP ON VULTR VPS
The VPS provider give the user and password to get access to the VPS.
1.1. Initial Setup
It is need to the the VPS up to date, to get this:
sudo apt-get update
sudo apt-get upgrade
1.2. Create a new user and get more security in SSH connection
To create a new user in the VPS with root access permission:
adduser score
adduser score sudo
Change from “root” user to the new user “score”:
sudo score
Now, we are going to generate keys to SSH connection:
ssh-keygen -b 4096
We need to install “nano”:
sudo apt-get install nano
Go to folder ssh:
cd .ssh
nano id_rsa.pub )) authorized_keys
Now save the private key “id_rsa” to your clients computer so you can authenticate to the server with the SSH Certificate. (You must convert id_rsa to a “.ppk file in order to use the privatekey with Putty).
Restart the SSH Server and test if the authentication with the private key works.
sudo service ssh restart
If it works, edit the SSH config file to disable password authentication & root login.
sudo nano /etc/ssh/sshd_config
Change following Values in the file:
PasswordAuthentication no
UsePAM no
PermitRootLogin no
More info in: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
1.3. SWAP Memory configuration
In the case the VPS has only 1GB of RAM, we need to create a 2-4GB of SWAP Memory.
Before we begin, we will take a look at our operating system to see if we already have some swap space available. We can have multiple swap files or swap partitions, but generally one should be enough.
We can see if the system has any configured swap by typing:
sudo swapon –s
Filename Type Size Used Priority
If you only get back the header of the table, as I've shown above, you do not currently have any swap space enabled.
Another, more familiar way of checking for swap space is with the free utility, which shows us system memory usage. We can see our current memory and swap usage in Megabytes by typing:
free -m
Check Available Space on the Hard Drive Partition.
The typical way of allocating space for swap is to use a separate partition devoted to the task. However, altering the partitioning scheme is not always possible. We can just as easily create a swap file that resides on an existing partition.
Before we do this, we should be aware of our current disk usage. We can get this information by typing:
df -h
As you can see on the first line, our hard drive partition has 55 Gigabytes available, so we have a huge amount of space to work with. This is on a fresh, medium-sized VPS instance, however, so your actual usage might be very different.
Although there are many opinions about the appropriate size of a swap space, it really depends on your personal preferences and your application requirements. Generally, an amount equal to or double the amount of RAM on your system is a good starting point.
Since my system has 4 Gigabytes of RAM, and doubling that would take a significant chunk of my disk space that I'm not willing to part with, I will create a swap space of 4 Gigabytes to match my system's RAM.
To create the Swap file in the root directory:
sudo fallocate -l 4G /swapfile
The prompt will be returned to you almost immediately. We can verify that the correct amount of space was reserved by typing:
ls -lh /swapfile
As you can see, our file is created with the correct amount of space set aside.
Now it is need to enable swap file.
Right now, our file is created, but our system does not know that this is supposed to be used for swap. We need to tell our system to format this file as swap and then enable it.
Before we do that though, we need to adjust the permissions on our file so that it isn't readable by anyone besides root. Allowing other users to read or write to this file would be a huge security risk. We can lock down the permissions by typing:
sudo chmod 600 /swapfile
Verify that the file has the correct permissions by typing:
As you can see, only the columns for the root user have the read and write flags enabled.
Now that our file is more secure, we can tell our system to set up the swap space by typing:
sudo mkswap /swapfile
Our file is now ready to be used as a swap space. We can enable this by typing:
sudo swapon /swapfile
We have a new swap file here. We can use the free utility again to corroborate our findings:
free -m
Our swap has been set up successfully and our operating system will begin to use it as necessary.
Now, it is need to make this swap file permanent.
We have our swap file enabled, but when we reboot, the server will not automatically enable the file. We can change that though by modifying the fstab file.
Edit the file with root privileges in your text editor:
sudo nano /etc/fstab
At the bottom of the file, you need to add a line that will tell the operating system to automatically use the file you created:
/swapfile none swap sw 0 0
Save and close the file when you are finished
2.1. Install dependencies
In the command line of VPS and with the user created before:
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install libcrypto++-dev
sudo apt-get -y install libqrencode-dev
sudo apt-get -y install libminiupnpc-dev
sudo apt-get -y install libgmp-dev
sudo apt-get -y install libgmp3-dev
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install libssl-dev
sudo apt-get install libdb++-dev
sudo apt-get install libboost-all-dev
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get install libzmq3-dev
sudo apt-get install libgmp3-dev
sudo apt-get install libboost1.55-all-dev
boost1.55 will most likely fail(Not a problem)
sudo add-apt-repository ppa:bitcoin/bitcoin
Now we need to clone the Scorecoin.git, and compile the file:
git clone https://github.com/marksteven2017/Scorecoin.git
cd /Scorecoin/src/
sudo make -f makefile.unix
This process takes some time; we need to wait to finish it. When the process is finished we need to give executable permissions:
chmod +x Scored
ls –l
2.2. Configure Score coin MN
After that we need to configure the “score-conf”:
nano $HOME/.Score/Score.conf
rpcuser=”Any user”
rpcpassword=”Any password”
Now, we need to execute the daemon:
cd ~/Scorecoin/src$/
./Scored –daemon
Wait until the blockchain is synchronized. To view this information:
./Scored getinfo
Once synced, generate the private key. “./Scored masternode genkey” save this key in a notepad because we need later:
./Scored masternode genkey
Now we have to stop the daemon:
./Scored stop
Update the “score.conf” as rpcuser=(ANY user) rpcpassword=(ANY password)
The default port is 17075.
Start the daemon again:
./Scored –daemon
To get info:
./Scored masternode status
2.3. Configure Firewall to allow the correct ports
To get more security in the VPS:
sudo ufw app list
We need to make sure that the firewall allows SSH connections so that we can log back in next time. We can allow these connections by typing:
sudo ufw allow OpenSSH
Afterwards, we can enable the firewall by typing:
sudo ufw enable
To allow the port of Scorecoin MN:
sudo ufw allow 17075
sudo ufw enable
sudo ufw status
Status: active
To Action From
22 ALLOW Anywhere
17075 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
17075 (v6) ALLOW Anywhere (v6)
- Configure Windows Cold Wallet
We need to generate a new address for MN:
Send 25000 Score coins to this new address be sure to have a few extra coins in your wallet for the fees. The exact amount of 25000 coins is required for the masternode.
Meanwhile, you have to edit your “score.conf” file which is in “%appdata%“. Open the file with notepad and filled with:
rpcuser=(any user)
rpcpassword=(any user)
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
staking=0
logtimestamps=1
Close the windows wallet and start again.
Once the transactions of 25000 Score coins reach more than 15 confirmations, go to wallet, in debug console:
And type “masternode outputs”:
You will get trx hash like this:
“aa7c6c173f7b691e5a070a37aeazd23557636ad1b4b43680ace39d522e1d4493” “1” .
The first part is your transaction hash, the “1” is the index. In case you did multiple transactions, you will get a list.
Save this values in a text file.
Now we are going to configure the Masternode. Go to Score wallet, go to MN tab and click in create a new one:
It will be appearing a window like this:
It needs to fill using the following date got before:
a) Alias - (any name eg MN1)
b) Address - (VPS IP and PORT ) X.X.X.X:17075
c) Privkey - ( private key generated on VPS)
d) TX hash - (the hash generated on windows wallet)
e) Txid -( the second part generated on windows wallet, either 0 or 1)
The last boxes will leave in blanck.
Press OK to save this and unlock the wallet before start the MN:
In the tab of My Master Nodes, click on Start All:
You get the message: “Masternode successfully started”.
The MN will be appearing in the Score Network Masternode, take into account it takes some time to sycn:
Your MN is fully configured.