Sign in to follow this  
Raphael Scheidler

Masternode - VPS Setup Guide

2 posts in this topic

Masternode - VPS Setup Guide

This guide will help you to setup a masternode on an Ubuntu 16.04 64bit Server.

 

Basic Requirements

The following items will be required to setup an ALQO masternode:

  • A Virtual Private Server (VPS) running Ubuntu 16.04 (this is key; many will default to 18.04 now and the software is intended for 16.04)
    • There are many reputable providers that these can be purchased from: Vultr, Hetzner, and Time4VPS are some that members of the community use successfully. If you want to support the team: https://billing.time4vps.eu/?affid=2255 (Official ALQO Ref-Link)
    • It may be possible to use the lowest cost VPS to host your masternode as we will be going through a process that creates what can be best explained as virtual ram. However, if possible 1GB of RAM is a good beginning with most providers

 

  • Control Wallet: A copy of the most up-to-date ALQO QT wallet for your personal computer, you will use to store your masternode funds and control it. As of writing, that is Atlas version 4.1, it can be downloaded from the ALQO website or ALQO Github:

 

  • 10,000.1 ALQO in your Control Wallet

 

  • A program to login to your VPS
    • For Windows, most use putty : https://www.putty.org/
      • You will type: root@yourip into the Host Name box
      • If you are a first-time putty user right click is how you paste
    • For Mac OS you can use the Terminal: Terminal is an application in your utilities folder on your Mac
      • In your terminal window you will type: ssh root@yourip

Please keep in mind that for security reasons you’re gonna need a single IP for each masternode you’re planning to run.

 

 

Getting the Ubuntu Server ready

Updating your Server and Installing Dependencies

After logging into your VPS, we will input a series of commands. This guide will assume you are using the root user. Some of these will update existing repositories, and others will install fresh ones. This list is deliberately large to ensure that regardless of what your VPS provider has when you begin that you should have everything you need to run an ALQO node.

apt-get update

 

apt-get install -y git automake build-essential libtool autotools-dev autoconf pkg-config libssl-dev libboost-all-dev software-properties-common nano
add-apt-repository ppa:bitcoin/bitcoin
apt-get update && apt-get install -y libdb4.8-dev libdb4.8++-dev libminiupnpc-dev libevent-dev

 

Adding a SWAP file (do the commands line by line, each followed by hitting return)

fallocate -l 3G /swapfile

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

echo -e "/swapfile none swap sw 0 0 \n" >> /etc/fstab

echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf

sysctl -p

 

 

Compiling the Daemon

Now it’s time to decide. Do you want to compile the daemon on your own, or do you want to download a precompiled daemon which will save some time?
We are going to talk about both.

 

OPTION ONE - Precompiled files (recommended for most users)

If you don’t want to compile the source by yourself,  this is where you’ll go.

mkdir ALQO
cd ALQO
wget https://builds.alqo.org/linux/alqod &&chmod -f 777 alqod
wget https://builds.alqo.org/linux/alqo-cli &&chmod -f 777 alqo-cli

You can skip the following step (OPTION TWO - Compiling on your own)

 

OPTION TWO - Compiling on your own

git clone https://github.com/ALQOCRYPTO/ALQO
cd ALQO
./autogen.sh
./configure
make

 

 

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.

IMPORTANT: The path is different for the ones who compiled on there own and the ones who downloaded the precompiled files!

From any directory on your VPS you can enter:

/root/ALQO/alqod -daemon &

(For the ones who downloaded the precompiled daemon)

OR

/root/ALQO/src/alqod -daemon &

(For the ones who compiled on their own server)


Within the ALQO directory you can use the following command:

./alqod -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 need to modify the alqo.conf file on our VPS to link our VPS wallet to our main wallet holding our collateral. We are using the program nano we installed during our dependencies process to modify this file. To open it input the following command:

nano /root/.alqo/alqo.conf

 

What goes inside the config?

Your configuration files gets read by the ALQO-Daemon on startup.

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

rpcuser={Input a random string of characters you don't need to remember them}
rpcpassword={Input a random string of characters you don't need to remember them}
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip={Your servers IP address}
bind={Your servers IP address}
masternodeaddr={Your servers IP address}
masternodeprivkey={Here is where we copy the output from when we input masternode genkey in our
control wallets debug console; you'll get it at a later step}

Make sure to replace all the entries surrounded by these brackets: { }

Replace them without the brackets, e.g.: externalip=123.456.789

Once this has been copy and pasted into your alqo.conf, you will save it by pressing CTRL + X.

 

 

Main Wallet Setup

In order to get the masternode to run, we need to send 10,000 ALQO 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 Priv-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: Tools -> Debug Console and type in:

masternode genkey

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

 

Generate a wallet-address

Each masternode needs it’s own address. We are going to send 10,000 ALQO 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 ALQO to the address

Let’s send exactly 10,000 ALQO to that address. Yes - make sure this is only 10,000 ALQO. 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.

Open up the wallet debug console once again and 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 config

masternode.conf

Open your local masternode.conf (Find it or use the “Edit config file” in the ALQO-QT client under “Tools”) and fill it out like this:

{YOURMASTERNODENAME} {YOURVPSIP:55500} {The private key we generated in the debug and saved
to in our VPS alqo.conf} {The output from when we entered masternode outputs in the main wallet
debug} {The check digit that follows this; either a 1 or a 0}

Which should result in something like that:

MASTERNODE_01 123.456.7890:55500 7123456789abshdhdhfkfcdefgh 9876asjdbdfhdhjma54321dcba 0

Save and close the masternode.conf, then restart the wallet.

 

 

Starting everything up

 

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

As mentioned earlier when we’ve created the privkey, we need to add that to the alqo.conf on our server. Get back to that step if you are not sure how to open the config.

 

Making sure the daemon is not running anymore, to include the new alqo.conf

killall alqod

Starting the daemon on the Ubuntu server

After adding the “masternodeprivkey” in we want to start the daemon and allow it to sync.

/root/ALQO/alqod

(For the ones who downloaded the precompiled daemon)

OR

/root/ALQO/src/alqod

(For the ones who compiled on their own server)

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

ALQO server starting

Once this is started the only thing left to do on our VPS is let the wallet sync. This can take anywhere from a few minutes to a few hours in rare circumstances. Once it is synced nothing additional has to be done on the VPS. You can check the current blocks by typing in:

/root/ALQO/alqo-cli getinfo

(For the ones who downloaded the precompiled daemon)

OR

/root/ALQO/src/alqo-cli getinfo

(For the ones who compiled on their own server)

 

Remote-Start the masternode

We are now at the final step of our process.

Restart your wallet after editing the masternode.conf. If you don't have the masternode tab appearing in your wallet go to: settings > options in your wallet. Switch over to the tab in settings that says wallet. In here, click the radio button next to “Show Masternode Tab”. 

 

In our masternode tab we should now see an entry with the name and other information we gave it. It will be showing as missing under status. To start our masternode and finalize our process all we have to do is press the "start missing" button (or highlight the node and press "start alias").

After this, it should say enabled and still have a 00:00 under time. This shouldn't alarm you, as it can take a few hours for this to reflect. If we want to confirm we were successful, the best way is back on our VPS. There, enter the following command:

/root/ALQO/alqo-cli masternode status

(For the ones who downloaded the precompiled daemon)

OR

/root/ALQO/src/alqo-cli masternode status

(For the ones who compiled on their own server)

 

If that output says “Masternode Successfully Started”, then you've successfully set up your ALQO masternode!

At this point you can close your main wallet as it does not need to be running using the cold wallet system. The only other step left is to keep an eye on it to ensure it stays running and to keep an eye on the ALQO Discord or ALQO Community Hub for any news or updates!

 

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

  • Like 3

Share this post


Link to post
Share on other sites

Cronjob to restart your server daemon

Thanks to smasherx for providing these steps.

We'll create a shell script that restarts the masternode if not running and logs the result in the logfile
 /var/log/alqod_log.txt

 

Creating the shell script

Create the empty file mn-check-run.sh in /root/ALQO/:

nano /root/ALQO/mn-check-run.sh

Insert following code:

#!/bin/sh
# Check for ALQO MN running and restart if not

case "$(pidof alqod | wc -w)" in
0)  echo "Restarting alqod:     $(date --utc)" >> /var/log/alqod_log.txt
    /root/ALQO/alqod &
    ;;
1)  # all ok
    echo "$(date --utc) alqod already running" >> /var/log/alqod_log.txt
    ;;
*)  echo "Attention - multiple instances of ALQO daemon running  $(date --utc)" >> /var/log/alqod_log.txt
    ;;
esac

Save it and exit. Now make it executable:

chmod 777 /root/ALQO/mn-check-run.sh

 

 

Creating the cronjob

Create a cronjob which runs the newly created shell script every 10 Minutes:

sudo crontab –e

 

Insert the following line, save it afterwards and exit:

*/10 * * * * /root/ALQO/mn-check-run.sh

 

And that’s it; now you have a script that checks the state of the alqod every 10 minutes and restarts it if its not running anymore – You can delete the logging of the “running daemon” in the script, once I have confirmed that everything is correct. That’s just for the start. In the end, I have only the logs of the restarts and the highly unlikely case that more than one daemon is running.

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this