Masternodes: Manual Setup Guide

From Genesis Network Wiki
Revision as of 17:11, 24 March 2019 by Ssowellsvt (talk | contribs)
Jump to navigation Jump to search

This page describes exactly how to create a Genesis Masternode without using an automated script.

Pre-Requisites

First and foremost, you must make sure these requirements are met for setting up a masternode. Really, you need all of them.

  • A fully-synced full-node Genesis wallet.
    • Always check that you have the latest version (v3.0+)
  • 750,000 $GENX collateral for each masternode
  • A remote VPS (Virtual Private Server) running Ubuntu 16.04 or 18.04
    • We recommend DigitalOcean, Vultr, or MasterHash
    • Other VPS providers can and may work. Some VPS providers may require additional work such as AWS
    • Other Linux distributions will work with minor changes
  • PuTTY (Download Here)

Local Setup

Create a Text File and Setup in this Manner

Masternode: 
Private Key: 
Address: 
Transaction: 
Output: 
IP:

Generate a Private Key for Your Masternode

  1. Open up the console on the full-node wallet by click Help > Debug Window > Console
  2. Enter the following into the console and press enter
masternode genkey
  1. The result is your Private Key - Add to your text file under "Private Key:"
MN-TUT-1.png

Create a Public Address for Your Masternode

  1. Still having the console open, enter the following and press enter
getaccountaddress "masternode01"
  1. Feel free to rename "masternode01" to a name of your choosing
  2. The result is your public address - Add to your text file under "Address:"
MN-TUT-2.png

Transfer your 750,000 GENX Collateral

  1. Still having your console open, enter the following and press enter
    sendtoaddress "address" 750000
    Make sure to replace "address" with the actual address in your text file
MN-TUT-3.png

Verify & Obtain Transaction Info

  1. Still having your console open, enter the following and press enter
    masternode outputs
    You may need to wait for 6 confirmations (~6 minutes)
  2. The result is your transaction ID and output
    • Add the text string to your text file under "Transaction:"
    • Add the single digit output to your text tile under "Output:"
MN-TUT-4.png

VPS Setup

For this tutorial we'll use a DigitalOcean droplet.

Create VPS

  • After signing up at DigitalOcean, click Create > Droplet
  • Recommended safe size VPS is 2GB RAM, 2 Core CPU. Recommended minimum size VPS is 2GB RAM, 1 Core CPU
  • Anything lower than 2GB RAM, 1 Core CPU could result in issues with compiling and will be very slow
  • Future upgrades of the network will require more robust VPS's
  • This example we will use the recommended minimum of 2GB and 1 Core CPU
  • After creating the VPS, check your email for login information
MN-TUT-5.png

Login to Your VPS

  • Download, install and open PuTTY
  • Get the IP/User/Pass from your email (DigitalOcean)
  • Input the IP address into the PuTTY window and press Open
    • Alternatively, you can also save your VPS in PuTTY by putting in a name of your choice and pressing Save. Double click the saved session to open
    • Security warning will come up, simply press Yes
  • After the security warning, type your User/Pass from the email, then it will prompt you to change your password
    • Your password will not actually show anything on the screen while you're typing or if you copy/pasted. This is fine, just type and hit enter
  • Pro-tip: Right-click is paste in terminal (VPS)
MN-TUT-6.png

Install Dependencies

  • Copy/paste each line of code individually
  • Update your machine
sudo apt-get update
  • Daemon & Sentinel Dependencies
sudo apt-get install nano python-virtualenv virtualenv build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libsodium-dev git curl software-properties-common libboost-all-dev
  • BerkeleyDB
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
MN-TUT-7.png

Create Secondary User (Optional)

The remainder of the guide uses "genesismasternode" as the user. Please edit for your user.

adduser genesismasternode
  • Create password and enter through everything, or setup if you wish
su - genesismasternode
  • Now you're user is switched to "genesismasternode". You can even login next time this way
MN-TUT-8.png

Compile Genesis!

git clone https://github.com/genesisofficial/genesis/
cd genesis
./autogen.sh
  • Configuring Genesis properly is important. If you're using a VPS under 2GB RAM, you can use a swapfile or add some flags that will cause your machine to take a lot longer to compile.
  • Choose ONLY ONE of the following configurations
./configure # If using a VPS 2GB RAM or more
./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" # If using a VPS under 2GB RAM / No Swapfile
  • Now finally, building Genesis. This will take quite a bit of time. Go take a nap, or mow the yard.
make
  • After successful build, last but not least..
echo "export PATH=$PATH:/home/genesismasternode/genesis/src" >> /home/genesismasternode/.profile && source /home/genesismasternode/.profile
MN-TUT-9.png

Make Masternode Configuration File

mkdir -p /home/genesismasternode/.genesis
nano /home/genesismasternode/.genesis/genesis.conf
  • You will now be in a new screen, fill with the following content
# RPC #
rpcuser=XXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
# General #
listen=1
server=1
daemon=1
txindex=1
maxconnections=24
# Masternode #
masternode=1
masternodeprivkey=XXXXXXXXXXXXXXXXXXXXX
externalip=XXX.XXX.XXX.XXX
port=7233
# Addnodes #
addnode=mainnet1.genesisnetwork.io
addnode=mainnet2.genesisnetwork.io
  • Replace rpcuser and rpcpassword with something strong. It can be anything. If you can't think of a good password, use a generator.
  • Replace masternodeprivkey with the "Private Key:" from your text document
  • Replace externalip with the "IP:" from your text document
  • Once complete, press Ctrl+X, followed by Y then Enter to save the configuration file
MN-TUT-10.png

Start Genesis Server!

  • Lets go ahead and start up our server. Type the following
genesisd
  • You should see a print that says "Genesis server starting". Now we can watch it sync by typing the following
genesis-cli -getinfo
  • If you're familiar with masternodes, getinfo flag is very well known. Since 0.16.x BTC codebase, getinfo is depreciated, and info is pulled from 'getblockchaininfo'. However adding the - before getinfo will still show the legacy style setup
  • You can repeat the previous command multiple times until you are synced. Check to see if you're synced by using a Genesis block explorer.
MN-TUT-11.png

Setup & Run Sentinel

  • Sentinel is an all-in-one powerful toolset for Genesis masternodes. Simple copy and paste each line (edit for your username if not using default)
cd /home/genesismasternode && git clone https://github.com/genesisofficial/sentinel.git && cd sentinel
virtualenv ./venv
./venv/bin/pip install -r requirements.txt
crontab -l | { cat; echo "* * * * * cd /home/genesismasternode/sentinel && ./venv/bin/python2 bin/sentinel.py >/dev/null 2>&1"; } | crontab -
  • Sentinel is now installed and has a crontab to execute Sentinel every minute
MN-TUT-12.png

Finalization

Edit Your Local Masternode Conf File

  • Head back to your local PC where you have your Genesis full-node wallet installed.
  • Depending on your OS, locate the Genesis Masternode configuration file, open with Notepad, nano or your favorite text editor
    • Windows — %appdata%Genesis\main\masternode.conf
    • Linux — ~/.genesis/main/masternode.conf
    • MacOS — ~/Library/Application Support/Genesis/main/masternode.conf
  • Follow the example and use your text file to fill out the information:
masternode01 IP:7233 PrivateKey Transaction Output
  • Example
MN01 193.178.10.163:7233 WDi7PZVAhW85qdGcDGfDvZr8ruUDYC3j7kB4mD47vbXqg2HWKe 8ef75988f9dc08ac345effdeabf0cc0d5ed992c781dde1e08f674af776be76b4 1
  • Now save your text file, close your Genesis full-node wallet and reopen it
MN-TUT-13.png

Start Your Masternode!

  • Once you reopen your full-node wallet, let it sync fully
  • Head over to the Masternodes tab
  • You should see your masternode inside the list under "My Masternodes" with the status "MISSING"
  • Right click the entry and select "start-alias"
  • Your masternode should go into "PRE-ENABLED" state
  • Wait between 10-30 minutes and the masternode should go into Enabled

That's it!! Congratulations, your masternode is ready to go!

MN-TUT-14.png

Troubleshooting

This area to be filled out later. Please contact the team on Discord in the meantime.