Multiple Masternode setup for Zsub1x .

in #zsub1x6 years ago (edited)

Setting up using Mac. Start with Ubuntu 16.04 Will be setting up as root. Will be setting up multiple MN on 1 VPS by using IP4 and IPV6.

I am making a video on how to set up​ the 2MN on the VPS. Can do the local wallet, because I have used all my coins to run the MN's.

Update, upgrade and install dependencies

enter following line by line. If you get ask hit "Y" and hit enter.

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo apt-get install nano http 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 libevent-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

Now let's create Swap.

cd /var

sudo touch swap.img

sudo chmod 600 swap.img

sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=2000

sudo mkswap /var/swap.img

sudo swapon /var/swap.img

sudo free

sudo echo "/var/swap.img none swap sw 0 0" >> /etc/fstab

cd

Now let's​ install the wallet.

wget https://github.com/SuB1X-Coin/zSub1x/releases/download/v1.3.4/zsub1x-1.3.4-x86_64-linux.tar.gz

sudo tar -xzvf zsub1x-1.3.4-x86_64-linux.tar.gz

let's move zsub1x-cli, zsub1xd, zsub1x-qt to /usr/local/bin/

mv zsub1x-cli /usr/local/bin/

mv zsub1xd /usr/local/bin/

mv zsub1x-qt /usr/local/bin/

Let's delete .tar.gz .

rm -r zsub1x-1.3.4-x86_64-linux.tar.gz

Let's make .zsub1x directrory.

mkdir .zsub1x

cd into .zsub1x dir.

cd .zsub1x

Create config file here.

nano zsub1x.conf

copy & past following​ into the config file. Change rpcuser, rpcpassword, externalip & privekey.

rpcuser=redsky123
rpcpassword=redmonkeyonearth
rpcallowip=127.0.0.1
rpcport=1331
listen=1
server=1
daemon=1
port=5721
masternode=1
bind=serverip
externalip=serverip:5721
masternodeprivkey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
addnode=sub1x.seeds.mn.zone

Now hit control X to exit the file, Then hit Y to save and hit enter to exit.

cd

Start the server.​

zsub1xd

You can check block syncing progress by.

zsub1x-cli getinfo

Now lets setup Local wallet for 1st MN

Create a new address. I labeled it as MN-01
Send 20 zsub1x to that address.
Wait for 5 conformations.
Open debug console window.
Type masternode outputs to get texid and index.
From the wallet menu click on tools and then click on open masternode config file.

Edit and Paste following line into masternode.conf file on your local wallet .

MN-01 IPaddress:5721 Genkey from VPS texid index
e.g: MN-01 xxx.xxx.xxx.xxx:5721 xxxxxxgenkeyxxxxxxxxx xxxxxxxtedidxxxxxxx Index

Before you save the file, close the wallet and then save it.
Reopen the wallet. Wait till its done syncing.
Click on Masternodes tab.
Click on your MN and then click start alias.
Unlock your wallet to start the MN.
You good to go.

Time to setup 2nd MN on the same VPS with IPV6 IP address.

On VPS stop the core.

zsub1x-cli stop

Crate a duplicate folder of .zsub1x and rename it to .zsub1x1 .
Copy the .zsub1x folder by doing the following

cp -r /root/.zsub1x /root/.zsub1x1

you can set the path according to your need.
Now cd into .zsub1x1 folder

cd .zsub1x1

Then nano into the config file

nano zsub1x.conf

Now edit config file

change the rpc user, pass & port
change externalip . While using IPV6, make sure to use it in [ ] 
change the private key
You need to remove the line you add earlier (bind= )

rpcuser=randomname
rpcpassword=randompassword
rpcallowip=127.0.0.1
rpcport=1332
server=1
daemon=1
listen=1
port=5721
logtimestamps=1
maxconnections=256
masternode=1
externalip=[ipv6]:5721
masternodeprivkey=masternode genkey

Save and exit

Sart the 1st server

zsub1xd

Start the 2nd server

zsub1xd -datadir=/root/.zsub1x1

To get info of the 2nd MN

zsub1x-cli -rpcport=1332 getinfo

To get the status of 2nd MN

zsub1x-cli -rpcport=1332 masternode status

You can use Top command to see the progress of both deamons.

Now lets setup Local wallet for 2nd MN

Create a new address. I labeled it as MN-02
Send 20 zsub1x to that address.
Wait for 5 conformations.
Open debug console window.
Type masternode outputs to get texid and index. This time you will see 2 texid's . Use the 2nd texid for 2nd MN.
From the wallet menu click on tools and then click on open masternode config file.

Edit and Paste following line into masternode.conf file on your local wallet .

MN-01 IPV6:5721 Genkey from VPS texid index
e.g: MN-01 [IPV6]:5721 xxxxxxgenkeyxxxxxxxxx xxxxxxxtedidxxxxxxx Index

Before you save the file, close the wallet and then save it.
Reopen the wallet. Wait till its done syncing.
Click on Masternodes tab.
Click on your 2nd MN and then click start alias.
Unlock your wallet to start the MN.
You good to go.

Auto start daemon on serve reboot by editing the crontab

Type

crontab -e

Some time It will ask you to select the editor. Mostly option # 2 is nano editor. Hit 2 and Hit enter. It will allow you to edit the file.

Paste the following line at the bottom and save

@reboot zsub1xd -daemon
@reboot zsub1xd -datadir=/root/.zsub1x1

Sort:  

Auto clear log files.
cd to the root folder.
Now create a file call clearlog.sh

clearlog.sh

copy & past following lines

/bin/date > .zsub1x/debug.log
/bin/date > .zsub1x1/debug.log

Now hit control X to exit the file, Then hit Y to save and hit enter to exit.

give executable permission to clearlog.sh

chmod +x clearlog.sh

Now edit crontabe.

crontab -e

past the follwoing

0 0 */2 * * ~/clearlog.sh
I think it will clear the ​log from debug.log every 2nd day ( if I​ am not​ mistaken​n​n )