-
Notifications
You must be signed in to change notification settings - Fork 3
Multi Masternode Single VPS Setup (Hot Cool)
The following is based on a server setup using Vultr and Ubuntu 16.04. Other VPS providers and OS configurations will be different. I am running 3 wallets currently on the $5, 1024MB, 1vCPU instance.
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
- 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.
root@server:~ $ mv .Linda .Linda00
root@server:~ $ mv ~/.Linda00/wallet.dat ~/.Linda00/wallet00.dat
root@server:~ $ cp -R .Linda00 .Linda01
root@server:~ $ cp -R .Linda00 .Linda02
root@server:~ $ rm ~/.Linda01/wallet00.dat ~/.Linda02/wallet00.dat
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
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.
After clicking into your server head to Settings > IPv4 > Public Network
Head to Settings > IPv6
- 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
On your Cool wallet, you will need to create multiple values for each instance of the masternode outputs. Run masternode genkey
from the Debug Console so you get 3 results.
> masternode genkey
MTM0YzIzMDIwMjE0MjVmMWI4OWM2NTA1ZTM1MDM2MGUyMGI5Zjgx
> masternode genkey
ZjBlNTdlMDQyMTEyODEwNDM5MjZlNjM3MGM1MWQ0MDIwMmQzMjEx
> masternode genkey
NjU4MGM2N2Q4N2MyMTkxNzYzZWFhMzk4NzlkY2EyMDhkODViOGI4
- 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 themasternodeaddr=
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
- 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
- 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
Your masternode.conf file on your Cool wallet should look something like this.
mn-local-00 [2001:19f0:5001:1fbf:5400:01ff:fe7a:7a40]:33820 MTM0YzIzMDIwMjE0MjVmMWI4OWM2NTA1ZTM1MDM2MGUyMGI5Zjgx ZDc2OTc3Njk3YmQ0YzcyZTQ5YWQ5MjY5NDhjNjVhZjNlZTRiNzczM2YyZmY5MGVm 1
mn-local-01 [2001:19f0:5001:1fbf:5400:01ff:fe7a:7a41]:33830 ZjBlNTdlMDQyMTEyODEwNDM5MjZlNjM3MGM1MWQ0MDIwMmQzMjEx MDYxZjlhMzU2N2JmM2U2NjFlNWEyZDJmYWU0ZmVhMmYxNWU4OTI1NWI3OTE4ZmRi 1
mn-local-02 [2001:19f0:5001:1fbf:5400:01ff:fe7a:7a42]:33840 NjU4MGM2N2Q4N2MyMTkxNzYzZWFhMzk4NzlkY2EyMDhkODViOGI4 ZjYzYzc4ZTMxNTQzMzU1NzEyMWYwYzUyNGMyZDBmMjI0YjZkMmJjMDMxZjMyYTk3 1
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'
Now that you have all of the above configured go ahead and initialise each of your VPS wallets.
user@server:~ $ init00
user@server:~ $ init01
user@server:~ $ init02
Over on your Cool wallet (assuming Windows), make sure your wallet is running and open the Debug Console. Run the following and look for the expected results.
> masternode start-alias mn-local-00 'your-wallet-passphrase'
{
"alias" : "mn-local-00",
"result" : "successful"
}
> masternode start-alias mn-local-01 'your-wallet-passphrase'
{
"alias" : "mn-local-01",
"result" : "successful"
}
> masternode start-alias mn-local-02 'your-wallet-passphrase'
{
"alias" : "mn-local-02",
"result" : "successful"
}
Head back over to your VPS and confirm the masternode has now started successfully.
user@server:~ $ Lindad00 masternode debug
masternode started remotely
user@server:~ $ Lindad01 masternode debug
masternode started remotely
user@server:~ $ Lindad02 masternode debug
masternode started remotely
Missing masternode input, please look at the documentation for instructions on masternode creation
If your masternode returns this when running 'masternode debug' it's very likely that you need to initiate the start-alias
for that MN instance.
Otherwise, you might have missed a parameter in your Linda.conf file, check the following
user@server:~ $ LindadXX getinfo | grep blocks
user@server:~ $ vi ~/.LindadXX/Linda.conf
not capable masternode(cmd=debug): Could not connect to [2001:19f0:9002:1:0:1:2]:port
Edit your Linda.conf file and change to listen=1