Multi Masternode Setup (Hot) - larsen161/Lindacoin GitHub Wiki

Introduction

The following guide lets you configure 2 additional wallets running on the same VPS server using IPv6 and new ports. Vultr supports IPv6 for free and this guide has been written with specific references to using Vultr as your hosting provider.

Prep

Make sure Lindad is stopped user@server:~$ Lindad stop

Swapfile

This is imperative especially if you're running an instance with a low amount of RAM < 2GB. This swap file will help give your server more usable memory. I've used a 3GB swap and managing to run 3 concurrent wallets on a VPS with 1GB native RAM.

root@server:~ $ fallocate -l 3G /swapfile
root@server:~ $ chmod 600 /swapfile
root@server:~ $ mkswap /swapfile
root@server:~ $ swapon /swapfile
root@server:~ $ sudo echo -e "/swapfile none swap sw 0 0 \n" >> /etc/fstab

Linda -datadir Configuration

  • Move your initial folder to align with general naming convention
  • Optional: I've changed the wallet.dat file names to more easily keep track of them.
  • Copy your data into new datadir locations (repeat more times as necessary).
  • Remove the copied wallet.dat files as these will need to be generated again.
user@server:~ $ mv .Linda .Linda00
user@server:~ $ mv ~/.Linda00/wallet.dat ~/.Linda00/wallet00.dat
user@server:~ $ cp -R .Linda00 .Linda01
user@server:~ $ cp -R .Linda00 .Linda02
user@server:~ $ rm ~/.Linda01/wallet00.dat ~/.Linda02/wallet00.dat

Lindad Configuration

user@server:~ $ sudo mv /usr/local/bin/Lindad /usr/local/bin/Lindad00
user@server:~ $ sudo cp /usr/local/bin/Lindad00 /usr/local/bin/Lindad01
user@server:~ $ sudo cp /usr/local/bin/Lindad00 /usr/local/bin/Lindad02

Network Configuration

If you run multiple servers, you can benefit from running them in the same region so that you can speed up block sync time and reduce data transfer costs. When you create your 2nd server, ~/.Linda00/Linda.conf can connect directly to the the same local IP of your first server.

Enable Private Networks

After clicking into your server head to Settings > IPv4 > Public Network

Enable IPv6

Head to Settings > IPv6

Edit Network Adapter

  • Get a sample configuration by heading to the link under Settings > IPv4 > Public Network > networking configuration
  • Edit the following file. Example is below.
user@server:~ $ sudo vi /etc/network/interfaces
  • Keep adding new inet6 entries for as many IPv6 addresses as you require.
  • Use a hex calculator to increment the last part of each address.
  • Initiate a Server Restart from the Servers page once these edits are made.
auto lo
iface lo inet loopback

auto ens3
iface ens3 inet static
    address 45.32.234.119
    netmask 255.255.254.0
    gateway 45.32.234.1
    dns-nameservers 108.61.10.10
    post-up ip route add 169.254.0.0/16 dev ens3

iface ens3 inet6 static
    address 2001:19f0:5001:1fbf:5400:01ff:fe7a:7a40
    netmask 64
    dns-nameservers 2001:19f0:300:1704::6

iface ens3 inet6 static
    address 2001:19f0:5001:1fbf:5400:01ff:fe7a:7a41
    netmask 64
    dns-nameservers 2001:19f0:300:1704::6

iface ens3 inet6 static
    address 2001:19f0:5001:1fbf:5400:01ff:fe7a:7a42
    netmask 64
    dns-nameservers 2001:19f0:300:1704::6

# Private network
auto ens7
iface ens7 inet static
	address 10.0.0.1
	netmask 255.255.240.0
	mtu 1450

Linda.conf Configuration

~/.Linda00/Linda.conf

  • Only your first instance should have listen=1
  • Where you see the first bind= use your own machines local IP address.
  • Replace the 2nd bind= and the masternodeaddr= with your own machines IPv6 address.
  • Replace masternodeprivkey= with the first result for 'masternode genkey' from your Cool wallet.
#add your own rpcuser and rpcpassword values
rpcuser=yourusername
rpcpassword=yourpassword
rpcport=33821
rpcallowip=127.0.0.1

server=1
listen=1
daemon=1
logtimestamps=1
maxconnections=128

bind=10.0.0.1
bind=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a40]:33820

seednode=seed1.linda-wallet.com
seednode=seed2.linda-wallet.com
seednode=seed3.linda-wallet.com
seednode=seed4.linda-wallet.com
seednode=seed5.linda-wallet.com

#add the value generated with 'masternode genkey'
masternode=1
masternodeaddr=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a40]:33820
masternodeprivkey=MTM0YzIzMDIwMjE0MjVmMWI4OWM2NTA1ZTM1MDM2MGUyMGI5Zjgx

~/.Linda01/Linda.conf

  • Notice the rpcport= value has changed.
  • You'll point this instance to your first by using connect= and replacing with the local IP you used above.
  • The bind= is your next IPv6 address.
  • Use another value from masternode genkey from your Cool wallet.
#add your own rpcuser and rpcpassword values
rpcuser=myuser
rpcpassword=mypassword
rpcport=33831

rpcallowip=127.0.0.1
server=1
listen=0
daemon=1
logtimestamps=1
maxconnections=128

bind=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a41]:33830

connect=10.0.0.1

#add the value generated with 'masternode genkey'
masternode=1
masternodeaddr=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a41]:33830
masternodeprivkey=ZjBlNTdlMDQyMTEyODEwNDM5MjZlNjM3MGM1MWQ0MDIwMmQzMjEx

~/.Linda02/Linda.conf**

  • Notice the rpcport= value has changed again
  • Again, point this instance to your first by using connect= and replacing with the local IP you used above
  • The bind= is your next IPv6 address.
#add your own rpcuser and rpcpassword values
rpcuser=myuser
rpcpassword=mypassword
rpcport=33841

rpcallowip=127.0.0.1
server=1
listen=0
daemon=1
logtimestamps=1
maxconnections=128

bind=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a42]:33840

connect=10.0.0.1

#add the value generated with 'masternode genkey'
masternode=1
masternodeaddr=[2001:19f0:5001:1fbf:5400:01ff:fe7a:7a42]:33840
masternodeprivkey=NjU4MGM2N2Q4N2MyMTkxNzYzZWFhMzk4NzlkY2EyMDhkODViOGI4

.bash_alises

Add these to your ~/.bash_aliases file and use them to make it easier to run commands against each wallet. You then just run the command before the = to execute what is to the right. The 2nd alias for each allows you to then run commands like normal. For example you could run Lindad00 rapairwallet if needed.

Once you edit ~/.bash_aliases run source ~/.bashrc to load these into active memory.

# Lindad00
alias init00='Lindad00 -datadir=/root/.Linda00 -wallet=wallet00.dat'
alias Lindad00='Lindad00 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33821'
alias getinfo00='Lindad00 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33821 getinfo'
alias addy00='Lindad00 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33821 listreceivedbyaddress 0 true'
alias debug00='Lindad00 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33821 masternode debug'
alias stop00='Lindad00 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33821 stop'

# Lindad01
alias init01='Lindad01 -datadir=/root/.Linda01 -wallet=wallet01.dat'
alias Lindad01='Lindad01 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33831'
alias getinfo01='Lindad01 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33831 getinfo'
alias addy01='Lindad01 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33831 listreceivedbyaddress 0 true'
alias debug01='Lindad01 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33831 masternode debug'
alias stop01='Lindad01 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33831 stop'

# Lindad02
alias init02='Lindad02 -datadir=/root/.Linda02 -wallet=wallet02.dat'
alias Lindad02='Lindad02 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33841'
alias getinfo02='Lindad02 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33841 getinfo'
alias addy02='Lindad02 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33841 listreceivedbyaddress 0 true'
alias debug02='Lindad02 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33841 masternode debug'
alias stop02='Lindad02 -rpcuser=yourusername -rpcpassword=yourpassword -rpcport=33841 stop'

Running it all

Now that you have all of the above configured go ahead and initialise each of your VPS wallets.

user@server:~ $ init01
user@server:~ $ init02
user@server:~ $ init03