RSTR Multi-node Setup Guide

This guide will help to set up multiple master nodes on the same VPS with IPv6 (free when enabled on Vultr). In this guide we will set up three nodes on a single VPS, however, more can be set up by following the same steps for each additional node.

What you need:

  • - 3,000,000 RST for each MN
  • - Main computer (MAIN wallet)
  • - Masternode Server (This will be on 24/7)
  • - Unique IP address for EACH MN
  • - Notepad or text editor to store your info

Create VPS 

Go to Vultr and create the server.
https://www.vultr.com/?ref=7498627

For this guide we will choose IPv6 because it is provided free of charge whereas IPv4 is charged per IP. This may be different on other providers so be sure to DYOR. 

Assigning IPv6 on Vultr

If IPv6 was not chosen upon creation, visit Vultr web console to enable IPv6 for the VPS by going to:

  • Settings > IPv6

Click on: 

  • Assign IPv6 Network

On the popup, click: 

  • Assign IPv6 

Allow the VPS to reboot and remain on the Vultr web console for the next step.

Configuring IPv6 Adresses

We will now edit our Network Configuration to add our IPv6 addresses.

A sample configuration is available from Vultr under: 

  • Settings > IPv6

Click configuration examples and scroll down to ‘Ubuntu 16.xx, Ubuntu 17.04'. Keep this page open for reference.

Login into the VPS via putty (or Terminal). Enter the below command and hit ‘enter’ to edit the interfaces:

  • sudo nano /etc/network/interfaces
  • Enter

This will bring up an editable file. We will copy and use the configuration example that is provided from Vultr and will add additional IPv6 addresses.

  • Copy the provided Vultr configure example.
  • In editable file, replace the one provided under the all the # lines. 

Next we will need to copy/paste the last section of the provided configuration for each of our extra nodes.

iface ens3 inet6 static

address 2001:0000:0000:0000:0000:0000:0000:11aa*

netmask 64

dns-nameservers 2001:19f0:300:1704::6

We add these additional IPv6 below the one we have in the editable file at the bottom. We will do this for each additional IPv6 we’d like to have.

You’ll notice we change each additional address by 1.

iface ens3 inet6 static

address 2001:0000:0000:0000:0000:0000:0000:11a1*

netmask 64

dns-nameservers 2001:19f0:300:1704::6

*Note the address must be increased by one - do not include the asterisk*

If your first address was: 

2001:0000:0000:0000:0000:0000:0000:11aa

You’ll need to change that line for the second IPv6 to: 

2001:0000:0000:0000:0000:0000:0000:11a1

And it will be changed again by 1 for the third IPv6:

2001:0000:0000:0000:0000:0000:0000:11a2

And so on.

When you are finished editing the /etc/network/interfaces, it should look similar:

iface ens3 inet6 static

address 2001:0000:0000:0000:0000:0000:0000:11aa

netmask 64

dns-nameservers 2001:1111:111:1111::6

iface ens3 inet6 static

address 2001:0000:0000:0000:0000:0000:0000:11a1

netmask 64

dns-nameservers 2001:1111:111:1111::6

iface ens3 inet6 static

address 2001:0000:0000:0000:0000:0000:0000:11a2

netmask 64

dns-nameservers 2001:1111:111:1111::6

Once we have completed this, we must save our edits and reboot. 

  • ctrl+x, Y, Exit

Reboot: 

  • sudo reboot

Give it a few minutes to reboot and login via putty again.

RSTR Core MN Script

Now, if you used the rstr.sh script in the initial guide that we provided, then you must safely stop your rstrd upon reboot (as it has been added as a cron/startup job).

Enter:

  • rstr-cli stop

If you have not installed our rstr.sh script yet, we will do so now:

Run the "RSTR Core MN Script”:

  • wget https://raw.githubusercontent.com/ondori-project/masternode-script/master/rstr.sh
  • chmod +x rstr.sh
  • ./rstr.sh

Note. You will have 2 options. Option 1 to clone and build, or option 2 to download executable: (1 to clone, 2 to download when prompted).

Choose 2 for quicker download.

Note. When prompted during the download, ‘The file /etc/rc.local already exists and will be replaced.

'Do you agree?’, Select: NO

  • Enter the your first ‘Masternode Private Key’
  • Enter: Yes

Your server is now set up.

Now we must safely stop your rstrd.

Enter:

  • rstr-cli stop

Installing RSTR Executables

Now moving along, we will copy the rstrd over to be named rstrd00, rstrd01, and rstrd02.

  • sudo mv /usr/local/bin/rstrd /usr/local/bin/rstrd00
  • sudo cp /usr/local/bin/rstrd00 /usr/local/bin/rstrd01
  • sudo cp /usr/local/bin/rstrd00 /usr/local/bin/rstrd02

We will do the same for rstr-cli.

  • sudo mv /usr/local/bin/rstr-cli /usr/local/bin/rstr-cli00
  • sudo cp /usr/local/bin/rstr-cli00 /usr/local/bin/rstr-cli01
  • sudo cp /usr/local/bin/rstr-cli00 /usr/local/bin/rstr-cli02

Updating RSTR Data Directories

Next we will need to move your initial RSTR data directory to .RSTRCore00, and then copy it to .RSTRCore01 and .RSTRCore02. 

  • mv .RSTRCore .RSTRCore00
  • mv ~/.RSTRCore00/wallet.dat ~/.RSTRCore00/wallet00.dat
  • cp -R .RSTRCore00 .RSTRCore01
  • cp -R .RSTRCore00 .RSTRCore02
  • rm ~/.RSTRCore01/wallet00.dat ~/.RSTRCore02/wallet00.dat
  • rstrd01 -daemon -datadir=/root/.RSTRCore01
  • killall rstrd01 -w
  • rstrd02 -daemon -datadir=/root/.RSTRCore02
  • killall rstrd02 -w
  • mv ~/.RSTRCore01/wallet.dat ~/.RSTRCore01/wallet01.dat
  • mv ~/.RSTRCore02/wallet.dat ~/.RSTRCore02/wallet02.dat

Now that we have the executables and folders setup, we can now edit our Conf files.

Editing RSTR Configurations

To access RSTR.conf Configuration:

  • nano ~/.RSTRCore00/rstr.conf

Where you see the first ‘externalip=‘ , ‘bind=‘ and the ‘masternodeaddr=' replace with your own machines IPv6 address.

Replace ‘masternodeprivkey=‘ with the first result for 'masternode private key' from your Cool wallet.

Add your own ‘rpcuser=‘ and ‘rpcpassword=‘ values

Be sure ‘rpcport=22620’, set listen=0 and daemon=1.

rpcuser=YourRPCUser

rpcpassword=YourRPCPass

rpcport=22620

rpcallowip=127.0.0.1

listen=0

server=1

daemon=1

logtimestamps=1

maxconnections=256

bind=[2001:1111:1111:1111:1111:1111:1111:1111]:22620

masternode=1

masternodeaddr=[2001:1111:1111:1111:1111:1111:1111:1111]:22620

externalip=[2001:1111:1111:1111:1111:1111:1111:1111]:22620

masternodeprivkey=yourMasternodeGenkey

datadir=/root/.RSTRCore00

wallet=wallet00.dat

  • ctrl+x, Y, Exit

Now you need to modify RSTRCore01/rstr.conf

  • nano ~/.RSTRCore01/rstr.conf

Notice below the ‘rpcport=‘ is changed to 22621

Your ‘externalip=‘ ‘bind=‘ and ‘masternodeaddr=‘ is your next IPv6 address.

You will use the 2nd masternode genkey from your Cool wallet.

Again add your own rpcuser and rpcpassword values.

Be sure to set listen=0 and daemon=1.

rpcuser=YourRPCUser

rpcpassword=YourRPCPass

rpcport=22621

rpcallowip=127.0.0.1

listen=0

server=1

daemon=1

logtimestamps=1

maxconnections=256

bind=[2001:1111:1111:1111:1111:1111:1111:1112]:22620

masternode=1

masternodeaddr=[2001:1111:1111:1111:1111:1111:1111:1112]:22620

externalip=[2001:1111:1111:1111:1111:1111:1111:1112]:22620

masternodeprivkey=your2ndMasternodeGenkey

datadir=/root/.RSTRCore01

wallet=wallet01.dat

  • ctrl+x, Y, Exit

Now you need to modify RSTRCore02/rstr.conf

  • nano ~/.RSTRCore02/rstr.conf

Notice below the ‘rpcport=‘ is changed to 22622

You will use the 3rd masternode genkey from your Cool wallet.

rpcuser=YourRPCUser

rpcpassword=mypassword

rpcport=22622

rpcallowip=127.0.0.1

listen=0

server=1

daemon=1

logtimestamps=1

maxconnections=256

bind=[2001:1111:1111:1111:1111:1111:1111:1113]:22620

masternode=1

masternodeaddr=[2001:1111:1111:1111:1111:1111:1111:1113]:22620

externalip=[2001:1111:1111:1111:1111:1111:1111:1113]:22620

masternodeprivkey=your3rdMasternodeGenkey

datadir=/root/.RSTRCore02

wallet=wallet02.dat

  • ctrl+x, Yes, Enter

MAIN Wallet masternode.conf

In the MAIN wallet, your masternode.conf should look like this for IPv6:

YourMNname1 [IPv6IP]:22620 masternodePrivKey1 TrxHash IndexUsage 

YourMNname2 [IPv6IP1]:22620 masternodePrivKey2 TrxHash IndexUsage

YourMNname3 [IPv6IP2]:22620 masternodePrivKey3 TrxHash IndexUsage

Shortcuts for ~/.bash_aliases

We will add some shortcuts in our ~/.bash_aliases file by entering this in the VPS terminal:

  • sudo nano ~/.bash_aliases

then copy/paste the following into the file (replace the rpc user/pw):

# rstrd00
alias init00='rstrd00 -datadir=/root/.RSTRCore00 -wallet=wallet00.dat'
alias rescan00='rstrd00 -datadir=/root/.RSTRCore00 -wallet=wallet00.dat -rescan'
alias rstrd00='rstrd00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620'
alias getinfo00='rstr-cli00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620 getinfo'
alias masternodestatus00='rstr-cli00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620 getmasternodestatus'
alias addy00='rstrd00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620 listreceivedbyaddress 0 true'
alias debug00='rstrd00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620 masternode debug'
alias stop00='rstr-cli00 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22620 stop'

# rstrd01
alias init01='rstrd01 -datadir=/root/.RSTRCore01 -wallet=wallet01.dat'
alias rescan01='rstrd01 -datadir=/root/.RSTRCore01 -wallet=wallet01.dat -rescan'
alias rstrd01='rstrd01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621'
alias getinfo01='rstr-cli01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621 getinfo'
alias masternodestatus01='rstr-cli01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621 getmasternodestatus'
alias addy01='rstrd01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621 listreceivedbyaddress 0 true'
alias debug01='rstrd01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621 masternode debug'
alias stop01='rstr-cli01 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22621 stop'

# rstrd02
alias init02='rstrd02 -datadir=/root/.RSTRCore02 -wallet=wallet02.dat'
alias rescan02='rstrd02 -datadir=/root/.RSTRCore02 -wallet=wallet02.dat -rescan'
alias rstrd02='rstrd02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622'
alias getinfo02='rstr-cli02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622 getinfo'
alias masternodestatus02='rstr-cli02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622 getmasternodestatus'
alias addy02='rstrd02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622 listreceivedbyaddress 0 true'
alias debug02='rstrd02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622 masternode debug'
alias stop02='rstr-cli02 -rpcuser=YourRPCUser -rpcpassword=YourRPCPass -rpcport=22622 stop'

  • ctrl+x, Y, Exit

This will now make it easier to run commands per wallet. You will then just run need to run the alias before the = to execute what is to the right of it. For example you could run rstrd00 repairwallet if needed to repair the first wallet, rstrd01 repairwallet for the 2nd, and rstrd02 repairwallet for the 3rd.

Now we run the following command to load these into active memory:

  • source ~/.bashrc

Configuring Cron

Next, we'll add and configure the cron job by entering this in the VPS Terminal (note: this will overwrite your rc.local file):

Enter: 

  • nano cron.sh

Copy and paste: 

username=`id -un`

sudo rm -f /etc/rc.local

sudo echo "#!/bin/bash" > /etc/rc.local

sudo echo "sleep 1" >> /etc/rc.local

sudo echo "sudo -u $username -H /usr/local/bin/rstrd00 -datadir=/root/.RSTRCore00 -wallet=wallet00.dat" >> /etc/rc.local

sudo echo "sudo -u $username -H /usr/local/bin/rstrd01 -datadir=/root/.RSTRCore01 -wallet=wallet01.dat" >> /etc/rc.local

sudo echo "sudo -u $username -H /usr/local/bin/rstrd02 -datadir=/root/.RSTRCore02 -wallet=wallet02.dat" >> /etc/rc.local

sudo echo "exit 0" >> /etc/rc.local

chmod +x /etc/rc.local

  • ctrl+x, Yes, Enter

Next:

  • chmod +x cron.sh && ./cron.sh
  • Enter

Now we add some peers:

  • cd .RSTRCore00
  • rm -rf peers.dat
  • wget https://github.com/ondori-project/masternode-script/raw/master/peers.dat
  • cd
  • cd .RSTRCore01
  • rm -rf peers.dat
  • wget https://github.com/ondori-project/masternode-script/raw/master/peers.dat
  • cd
  • cd .RSTRCore02
  • rm -rf peers.dat
  • wget https://github.com/ondori-project/masternode-script/raw/master/peers.dat
  • cd

Now you just need to start your servers:

  • init00
  • Enter
  • init01
  • Enter
  • init02
  • Enter

You are now set up. Make sure your masternodes are started in your MAIN wallet and check your VPS 'masternodestatus00' (01 or 02) to verify activity. Please allow your VPS to sync by following up on 'getinfo00' (01 or 02) to ensure your specific node is at the current block. Enjoy your rewards!