Multiple Graphcoin Masternodes on Single Vultr VPS

in #masternodes6 years ago

Contents

Introduction
Step 1 – IPv6 Networking Setup
Step 2 – Syncing first daemon over IPv6
Step 3 – Make uniquely named copies of the chain directory (.GraphCore)
Step 4 – Make uniquely named copies of the daemon binary (graphcoind)
Step 5 – Editing the graphcoin.conf confi files in each chain directory
Step 6 – Running the daemons with a special flag
Step 7 – Rinse and Repeat
Step 8 – Running all three daemons and calling graphcoin-cli to verify each

Introduction

This document assumes you know a few things about how to setup a masternode. This document is specifically about getting three graphcoin daemons running on the same VPS over an IPv6 network. This document should apply to all bitcoin or derivative coin daemons and can also be adapted for services other than Vultr. Once you are able to setup 3 of the same daemon on the one VPS, the rest of the masternode setup is the same as if running on a single instance. Therefore, we will not cover the actual setup of the masternodes or control wallet setup herein.

Step 1 – Setup your VPS with 3 static IPv6 Ips. We do this first because if you blow it, you may have to reimage the VPS and start over. It would be a drag to have to start over after installing updates, graphcoin and configs so adjusting network for IPv6 is Step 1. Open the file /etc/network/interfaces in your favorite text editor (nano). You may need to sudo if you are not root eg. “sudo nano /etc/network/interfaces”. Edit the file to look like the below (you are changing IPv6 on the ethernet interface from dhcp to three static addresses):

interfaces.png

The ens3 is the interface name. Yours may be different. Keep what’s in your file. Replace “full:128bit:ipv6:address:inrange:0001” with the IPv6 address given in your Vultr account under Servers > Select your Server > Settings > IPv6 > Public IPv6 Network > Address. Now Vultr gives you a full /64 network of IPv6 Ips for free! So you can use any value after the fourth colon: . The first 64 bits (shown in Vultr Settings as “Network”) is your network range. Anything following that is yours. In my case I just changed the very last digit of the address given to establish the other two Ips. If your given IP address ends in a 1, make the next two end in 2 or 3. The “dns-nameservers” value is what’s listed as “Recursive DNS” in Vultr. Use the same for each static IP config. Netmask is always 64.

Now is the tricky part. You have to restart networking, while remotely logged in. Trying to restart and keep an established connection via ssh won’t work out so well. I recommend just restarting the VPS at this point after you’ve saved the interfaces file. Make sure it’s correct before restarting. There is always a chance you may need to reimage the VPS and start over if you can’t get back in.

Once the VPS is back and you are logged in. Yes, you can still ssh in via your old IPv4 address, we didn’t change any of that. You can verify your 3 new IPv6 Ips are up and configured correctly by going to: https://centralops.net/co/Ping.aspx At this URL, try pinging each of your recently setup IPv6 addresses. If success, you should have no problems going forward. If not, there is likely something wrong with the interfaces config. Double check you’ve edited the file properly. Network troubleshooting is beyond the scope of this doc. See Vultr documentation for IPv6 examples.

Step 2 – For starters, get one Graphcoin daemon working on your VPS and fully synced. It doesn’t matter over what IP it syncs at this point, we just want a full chain directory to copy in Step 3. Again, we don’t cover the basics here in this doc. If you need assistance setting up a single coin daemon please refer to this future link.

Step 3 – Once synced, you will stop the daemon and then copy the entire hidden .GraphCore directory in the user’s home directory to 2 newly named directories. In Linux CLI, while in your user’s home directory, you type:

cp .GraphCore .GraphCore2

Repeat this once more:

cp .GraphCore .GraphCore3

You’ll now have three uniquely named hidden directories, each containing the full blockchain for each daemon/node you will run.

Step 4 – Like the above step, make two copies of your Graphcoin binary (the executable). Copy this in the same place you run it from, now:

cp graphcoind graphcoind2
cp graphcoind graphcoind3

For the record, this isn’t totally necessary, however, for the eventuality that a daemon has a problem and quits, you will be able to tell at a glance which is no longer running. You do not need to make copies of the graphcoin-cli binary, just the daemon itself.

Step 5 – Get your original graphcoind running on the new IPv6 IP. Change the file /home/user/.GraphCore/graphcoin.conf to have the new IPv6 IP. Here is a .conf file for reference:

rpcuser=uniquerpcusername1
rpcpassword=uniquerandompassword!
rpcallowip=127.0.0.1
rpcport=22617
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=16
externalip=full:128bit:ipv6:address:inrange:0001
bind=[full:128bit:ipv6:address:inrange:0001]:22629
#masternodeaddr=full:128bit:ipv6:address:inrange:0001
#masternodeprivkey=masternodeprivatekeygeneratedincontrolwallet
#masternode=1

Notes: It’s a good idea to make sure that the rpcuser and rpcpassword are different for each graphcoin node in their respective graphcoin.conf files. Notice the “rpcport” entry. This will need to be different for EACH graphcoin.conf file. The example above is the default rpcport, 22617. For example however, when editing the graphcoin.conf for your second node in .Graphcoin2, make sure rpcport is different, use one number up, 22618. For .GraphCoin3/graphcoin.conf rpcport, use 22619. This is the port the daemon listens to ON your VPS on localhost (127.0.0.1). This is the port “graphcoin-cli” uses to get info out of the daemon, it’s an rpc call. If the rpcports are not different for each daemon, the daemon will fail to run. Also take note of the brackets [] around the IPv6 address in “bind”. The bind setting needs the p2p port suffixed and it expects that with a colon :. A colon has meaning in IPv6 addresses so we separate IP from port with brackets before the :port. This p2p port number, 22629, is the public internet facing p2p port. This CAN be the same for each daemon. Since each daemon has it’s own IP, this is possible.

Step 6 – Once the graphcoin.conf file is edited and saved. Run your “graphcoind” binary again but this time with a special flag:

graphcoind -datadir=/home/user/.GraphCore/

You will use this flag every time you start a daemon or use graphcoin-cli. This flag tells the daemon or -cli app which graphcoin.conf file to read from.

Step 7 – If all went well running your first graphcoin daemon, repeat the process twice more, editing the graphcoin.conf files in .GraphCore2 and .GraphCore3. Again make sure to make rpcuser and rpcpassword unique and change the rpcport for each as above. You may notice I have a # in front of the “masternode” parts of the graphcoin.conf files. A hash (#) tells apps reading this file to ignore the line. We want to make sure each daemon runs before we get to setting them up as masternodes. Once you have three running graphcoin daemons, getting them working as masternodes is identical to any masternode config, so setting up the actual maternodes and control wallet are beyond the scope of this document.

Step 8 – Start the other two graphcoind daemons. Remember to use the -datadir flag like so:

graphcoind2 -datadir=/home/user/.GraphCore2/

graphcoind3 -datadir=/home/user/.GraphCore3/

If all went well, you should now have three running daemons. To check they are running you can run top and see if you see all three. You can also, and should also, try to connect with graphcoin-cli. To check each node, run it the following way:

graphcoin-cli -datadir=/home/user/.GraphCore/
graphcoin-cli -datadir=/home/user/.GraphCore2/
graphcoin-cli -datadir=/home/user/.GraphCore3/

Notice you just need to specify which -datadir when running the same graphcoin-cli.

At this point it’s like you have three graphcoin daemons running on three different servers. The masternode setup is the same as if they were on separate servers. Each needs their own unique masternode address, masternodeprivkey. I would recommend setting them up with the control wallet one at a time.

If you have any input on how to improve this document, please post a reply. Thank you!

Sort:  

Congratulations @awoo! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemFest⁴ commemorative badge refactored
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.030
BTC 59020.34
ETH 2514.65
USDT 1.00
SBD 2.47