Skip to content

Masternode setup guide

Mathieu Arbez Hermoso edited this page Jun 8, 2018 · 6 revisions

LIZ Cold Masternode Setup

This guide provides instructions for deploying and starting a masternode on the LIZ network.

This guide is a temporary guide and will be updated as soon as the new wallet is released.

Basic Requirements

10.001 LIZ
A main wallet (We’ll use the Windows Wallet)
A Server (Ubuntu 16.04 that will be online 24/7)
(OPTIONAL) WinSCP (https://winscp.net/eng/download.php)

Getting the Ubuntu Server ready

Updating

Once you’ve logged in for the first time on your new Ubuntu Server you should always update your package lists from the repositories.

apt-get update

Installing needed libraries

The LIZ Daemon needs some basic libraries in order to run. Let’s get them:

apt-get -y install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 autoconf make qt5-default libtool libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libboost-all-dev libminiupnpc-dev libzmq3-dev autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libtool libdb5.3++ unzip libgmp-dev software-properties-common libgmp-dev

add-apt-repository ppa:bitcoin/bitcoin

apt-get update && apt-get install libdb4.8-dev libdb4.8++-dev libminiupnpc-dev

Creating a SWAP file

sudo fallocate -l 2G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

Making it permanent

sudo nano /etc/fstab

At the bottom of the file, you need to add a line that will tell the operating system to automatically use the file you created:

/swapfile none swap sw 0 0

Compiling the Daemon

Now it’s time to compile the daemon on your own. You'll need to create a SWAP file if your server is running with less than 1Gb of RAM.

Getting the newest version

git clone https://github.com/LIZ-project/lizus-core/ OR updating an existing LIZ

cd lizus-core && git pull

Compiling the source

cd src

chmod 755 leveldb/*

make -f makefile.unix

Running the Daemon the first time

Running the Daemon the first time will help us to create the basic folder structure and to check for errors.

/root/lizus-core/src/lizusd -daemon

Editing the configs

Once you’ve run the Daemon for the first time - it will show you to setup a rpcuser and rpcpassword and close right after it - it has also created the folder structure where the blockchain and all config files are going to be. We want to edit those files now slightly but we’ll come back later for the finishing touch.

The easiest way is to use WinSCP to edit your conf-files. If you are somehow don’t want to use WinSCP follow these steps:

apt-get install nano

Nano is a great console-based text-editor.

nano /root/.lizus/lizus.conf

Let’s open the lizus.conf located in the .lizus folder. This folder was created by the daemon on the first run!

What goes inside the config?

Your configuration files gets read by the LIZ-Daemon on startup. There are a lot of things you can tweak, add or remove.

This is just a basic configuration for a simple masternode setup:

rpcuser={CHOOSE A RANDOM USER} 
rpcpassword={CHOOSE A RANDOM PASSWORD} 
rpcallowip=127.0.0.1 
listen=1 
server=1 
daemon=1 
logtimestamps=1 
maxconnections=256 
masternode=1 
externalip={YOUR SERVER IP} 
bind={YOUR SERVER IP} 
masternodeaddr={YOUR SERVER IP} 
masternodeprivkey={YOURPRIVKEY - WE WILL GET THAT LATER}

Save the config and let’s get over to the main-wallet.

Main wallet setup

In order to get the masternodes to run, we need to send 10.000 LIZ to an address we are just going to create. We use a system called “Cold-Wallet”. This system is meant for better security because actually your masternode won’t have any access to your wallet.

Masternode Private Key

As you might’ve saw we need a “masternodeprivkey” - this key indicates a private key that is used by your wallet and the masternode.

In your Wallet-App go to: Help -> Debug Window.

masternode genkey

This will generate a private key - We need to add that key to the “masternodeprivkey”-field in the lizus.conf on the Ubuntu server.

Generate a wallet-address

Each masternode needs it’s own address. We are going to send 10.000 LIZ to this address later.

getaccountaddress MASTERNODE_01

You can change MASTERNODE_01 to whatever you want to name your masternode.

Save the address you’ve just generated for the next step. Sending 10.000 LIZ to the address

Let’s send 10.000 LIZ to that address. Yes - make sure this is only 10.000 LIZ. No less, no more.)

Wait for the transaction to have at least 15 confirmations before continuing.

Getting the transaction

For our local masternode-config we need to get the transaction id and following number.

Back into the main-wallets debugconsole enter:

masternode outputs

It will display a list of valid masternode transactions. If this is your first masternode there will be only one for sure.

The list contains a longer number (transaction ID) and a following number.

Save both of these somewhere for the next step.

Local configs

We are almost there. Just a few lines to edit and we are able to start our masternode.

lizus.conf

Open your local lizus.conf (You can find it in your appdata/roaming/lizus folder).

Make it look similiar to this:

rpcuser={CHOOSE A RANDOM USER}
rpcpassword={CHOOSE A RANDOM PASSWORD}

masternode.conf

Open your local masternode.conf (You can find it right where the lizusd.conf file is)

{YOURMASTERNODENAME} {YOURIP}:19700 {YOURMASTERNODEPRIVKEY} {TRANSACTIONID} {TRANSACTION_FOLLOW_ID}

which should result in something like that:

MN_01 1.2.3.4:19700 7123456789abcdefgh 987654321dcba 1

Starting everything up

After editing all the files locally we need to get back to our Ubuntu Server and enter the “masternodeprivkey” and for sure start the daemon.

As written in the step where we’ve created the privkey, we need to add that to the lizus.conf on our server. Get back to that step if you are not sure how to open the config.

Starting the daemon on the Ubuntu server

After adding the “masternodeprivkey” in we want to start the daemon.

/root/lizus-core/src/lizusd -daemon

The daemon should start minimzed. You’ll only see a message like this:

Lizus server starting

Remote-Start the masternode

Once you’ve restarted your Wallet-App get back into the debugconsole and enter:

masternode start-alias {YOURMASTERNODENAME}

Congratulations. You’ve successfully setup a masternode on your own!