Masternode Setup

Local Wallet with VPS Server

Prerequisites:

1)      Local computer windows 7-10

2)      Remote server – VPS [vultr.com]

3)      PuTTY to configure and setup VPS

4)      2000 GENT Coins

If you want to signup to Vultr through the referral link below, any funds generated will be used to buy GENT and added to the Development fund: https://www.vultr.com/?ref=7333723

Register an account with Vultr. Once you’ve done that, create your first server:

 

1.jpg

Select server location - you have multiple options to choose from. All are perfectly fine.

2.jpg

Next server type: Select Ubuntu 16.4 x64

3.jpg

Server size, select min. the 1GB option

4.jpg

You can setup a SSH key so you don’t need to use the password every time to login to the server. But to keep things simple for the moment we are just going to use the standard password given after the server is ready.

Last thing server hostname & label

 

Next we’re going to install PuTTY while the server is being setup.

Download from here: http://putty.org

 

Once you install that, back to our Vultr account to grab the login details.

Now open PuTTY to add the server

5.jpg

Enter the IP address in the Host Name, and enter the server name to Saved Sessions. Click save.

Click the open button. Now the console has opened, click yes.

6.png

Then enter your server login details provided in your Vultr account.

Now you cannot ctrl+V to paste in the console. Either right click on mouse or shift+insert (sometimes on keyboard it will just be INS key)

User: root

Password: when you paste it will not display. So don’t try and paste again. Just paste once and click keyboard enter.

Now the first thing we are going to do are a few updates to the server and install the required dependencies for the wallet to run…

Run these commands in order, one at a time:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install nano htop git
sudo apt-get install software-properties-common
sudo apt-get install build-essential libtool autotools-dev pkg-config libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install autoconf
sudo apt-get install automake
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils

Now we have server updated and all the dependencies installed we can move on to the next part and that’s installing a firewall…

apt-get install ufw
ufw allow ssh/tcp
ufw limit ssh/tcp
ufw allow 11771/tcp
ufw logging on
ufw enable

Check your firewall status using the following command:

ufw status

Onto the next step, setting up a swap file… Again just follow each one in order:

cd /var
sudo touch swap.img
sudo chmod 600 swap.img
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=2000
mkswap /var/swap.img
sudo swapon /var/swap.img
sudo free
sudo echo "/var/swap.img none swap sw 0 0" >> /etc/fstab cd
reboot

After the reboot you will need to log back into the server. Once you login again, let’s install and compile the Gents wallet…

sudo git clone https://github.com/gentlemencoin/gentlemencoin.git
chmod +x gentlemencoin/autogen.sh
chmod +x gentlemencoin/share/genbuild.sh
chmod +x gentlemencoin/src/leveldb/build_detect_platform 
cd gentlemencoin
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install
cd src
mv gentsd gents-cli gents-tx ~/
cd

Now if you plan to setup multiple masternodes, we can go back to our Vultr account and create a snapshot of the server we just setup. It will save us time, no requirement to compile again. Unless we have a wallet update, then need to start from scratch again for any new MN’s and update the ones already running.

If you only intend to run one MN, run this command to remove the Gents source files, as they are no longer required.

rm -rf Gents

Let’s fire up the daemon on the server, it will give us an error about missing rpc password. We will come back to this later.

gentsd -daemon

Next if you intend to run multiple masternodes we can create the snapshot. Skip this if only intend to run one mastermode.

7.jpg

Click add snapshot and select the server from the dropdown and add a label. Click take snapshot

8.png

This will take a while, grab a cup of tea!

Once it’s finished we can continue…

 

Step 1

We can fire up the qt wallet on your local computer. Generate a new address

Enter a label and click Request payment button.

Copy the address

9.png

And now go to the send tab

Enter the copied address and send exactly 2000 GENT. No more, no less in a single transaction. Wait for it to confirm on the blockchain.  

10.png

Now create a new .txt file on your computer, to store the data used for the masternode:

Can use this format:

+++++++++++++++++
MN Label:
Collateral address:
Masternode Key:
Public IP:
MN conf line:
+++++++++++++++++

Go to the [Tools > Debug Console] and enter these commands below:

 

Step 2

masternode genkey
11.png

Copy that into into the .txt file. Masternode Key

 

Step 3:

masternode outputs
12.png

 

Now we need to format the masternode config line:

<Name of Masternode> <VPS IP address>:11771 <Result of Step 2> <Result of Step 3> <The number after the long string in Step 3> mn01 107.131.25.434:11771 88xrxxxxxxxxxxxxxxxxxxxxxxx7K 6b4c9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ee23 0

 

You can add this to the .txt file. MN conf line

 

Edit the local wallet masternode.conf file. Tools > Open Masternode Configuration File

Add the MN conf line, like the example below to the masternode.conf file. Save it, and close the file.

mn01 107.191.55.244:11771 88xrxxxxxxxxxxxxxxxxxxxxxxx7K 6b4c9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ee23 0

 

Now we need to edit the gents.conf file in the local wallet. [Tools > Open Wallet Configuration File]

 

rpcuser=<long random username>
rpcpassword=<longer random password>
rpcallowip=127.0.0.1
listen=0
server=1
daemon=1
logtimestamps=1
maxconnections=256

 

Save it, close the file and restart the wallet.

 

Now back to PuTTY and we need to edit the gents.conf on the VPS server.

cd
nano .gents/gents.conf

Enter the following:

rpcuser=<long random username>
rpcpassword=<longer random password>
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip=<VPS IP address>
bind=<VPS IP address>
masternodeaddr=<VPS IP address>:11771
masternodeprivkey=Result of Step 1
13.png

Press ctrl+X

Then Y to save, press enter to exit

Let’s fire up the daemon on the server:

gentsd –daemon

We need to let it fully sync, give it a couple of minutes and enter:

gents-cli getinfo

If the wallet has opened, it will give you smth like the following:

{
"version" : 1000000,
"protocolversion" : 70001,
"walletversion" : 61000,
"balance" : 0.00000000,
"obfuscation_balance" : 0.00000000,
"blocks" : 0,
"timeoffset" : 0,
"connections" : 10,
"proxy" : "",
"difficulty" : 8637.53453585,
"testnet" : false,
"keypoololdest" : 1506625556,
"keypoolsize" : 1001,
"paytxfee" : 0.00000000,
"relayfee" : 0.00010000,
"staking status" : "Staking Not Active",
"errors" : ""
}

We’re looking at the blocks. You can check your local wallet to see the current block height. By hovering over the tick.

 

14.png

Once your server has synced up, back to the local wallet and click the Masternode tab. You should see your MN listed.

Click the masternode to highlight then

Click Start alias or Start MISSING. Then click yes in the popup.

15.png

If you receive an error message, go to the debug console and enter:

startmasternode alias true MN1

Alias being what you setup previously in the masternode.conf. And is listed on the Masternode tab. or

masternode start-missing

 

You may need to unlock the wallet

If everything was setup correctly, after entering the command you will see something like this:

 

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

You can now close the debug, and return the masternode tab and check the status:

16.png

Check your Collateral is locked. First let’s enable coin control: [Settings > Options > Wallet]

17.png

Then go back to the Send tab. And you have a new Inputs option:

18.png

If it’s not locked, right click and select Lock Unspent

45.77.52.108 (Masternode 2) - Remote Desktop Connection Manager v2.png

You now have Gents masternode setup! 

Repeat for multiple masternodes, using a Vultr snapshot can save a lot of the setup time. Remember each one requires a unique IP address.

And watch the rewards come in…

+++++++++++++++++++++++++++++

For better security the .txt we created to make a note of our MN details. Should now be deleted or stored in a safe place, password protected, encrypted, whatever so it’s not a plain txt that can be easily accessed!

While using PuTTY – if anytime you need to check what's the last command you entered, type history and will display all the previous commands.

logo_web_dark.png