Masternodes For Beginners
The layman Show
So it’s finally here as promised the beginners guide to Masternodes.
So where do we start. As anyone who has been following me on twitter knows that i have recently started building my Masternode (MN) collection. It has been a steep learning curve but a successful one. The aim of this guide is to detail the process i go through in choosing my MN.
For me i chose to get involved with masternodes as a means of passive crypto income. I have a family and a job so i don’t get to trade as much as i would like to these day. Owning a MN means that I’m involved and making gains even when i’m not trading. It’s true that there are far better gains to be made trading and looking for that next X10 coin but i just don’t have that much time anymore.
So on to the good stuff.
What is a Masternode anyway ?
A masternode is a full node or a cryptocurrency wallet that is fully synced on the blockchain of whatever coin you choose with MN function availability and is always running 24/7.
Masternodes are considerably different in their functionality than normal nodes in a few ways. They are different because they perform several other functions apart from just keeping the full blockchain and relaying blocks/transactions as a full node does in Bitcoin/Litcoin.
Some of the special functions that these nodes perform are:
- Increasing privacy of transactions
- Doing instant transactions
- Participating in governance and voting
- Enable budgeting and treasury system in cryptos
Ok got all that now how do i make the money..
How do i choose my Masternode
Ok, so this is where the hard work begins, what one do i choose.
For me the process goes something like this.
- Check https://masternodes.online or http://www.mnrank.com
- Look for a coin with good ROI and cost
- Visit the website to look at the roadmap and coin specs and coins needed for a MN
- Visit https://bitcointalk.org/index.php?board=159.0 and see what the community are saying about the coin
- Visit the github and see if the dev is active
- Check social media to see if there is an active community there.
If i then like what i see i head on over to the exchange to buy the coin. I usually place orders below the latest bid and wait for miners or sellers to fill my orders (Don’t market buy)
I have my coins so now what ?
So now we get to the nitty gritty of setting up our node and i’m going to choose Chaincoin CHC on Cryptopia as an example as it it low cost (but also low ROI unfortunately)
Local Wallet Setup
So we visit the official website for Chaincoin https://www.chaincoin.org and we download and install the latest windows wallet.
Once we have the wallet downloaded we let it fully sync with the blockchain. Then once the wallet is synced we can send our coins from the exchange to our local wallet.
Once we have the required amount of confirmations on the wallet we can then encrypt the wallet with a nice secure password and do a backup of your wallet.dat file.
The setup i always look to choose for my MN is Hot wallet on a VPS and a cold local wallet on your PC/Laptop
This means your coins are safe in your local wallet and it only needs to be loaded up every few days to sync with the network and collect your rewards.
Setting up the Control Wallet
- Download and install the wallet and wait for your blockchain to sync.
- For Each MasterNode you want to create, create a receiving address, if you are setting up 2 masternode you would create 2 receiving addresses. Do this by going to File -> Receiving Addresses -> New in the wallet Use a meanginful label name to identify your masternodes for example MN1, MN2.
- For each MasterNode create a masternode key. Do this by going to the RPC console in the wallet Tools -> Debug Console and type in
masternode genkeywhich should give us a long string. Keep note of each of these keys as we will be using this later. Remember you need to do this for each MasterNode as each masternode will need it's own unique key.
- You would now have one receiving address and one masternode key Per MasterNode*. Note these as we will place them in the masternode.conf file explained below.
Setting up the masternode.conf File
Please note where you set the default directory upon initial startup of the wallet.
Navigate to the chaincoin directory:
Default directory is: C:\Users\ username \AppData\Roaming\ChainCoin
You should see a backup folder, block, chainstate, and chaincoin.conf
In your ChainCoin Directory create a file called masternode.conf, if one does not exist. You can create this file by opening up notepad and saving a blank file in the chaincoin directory as masternode.conf. The masternode.conf file is where we will put information on each masternode in this format:
Doc for masternode.conf:
# Masternode config file
# Format: alias IP:port masternodeprivkey collateral_output_txid collateral_output_index
# Example: mn1 127.0.0.2:51474 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
<MASTERNODE_ALIAS> <SERVER_IP_ADDRESS>:11994 <MASTERNODE_PRIVATE_KEY> <TX_OUTPUT_ID> <TX_10K_OUTPUT_INDEX>
Lets define the parameters for the format:
Alias: The alias portion is just a name for ease of use you want to name your masternode for exampel MN1
IP/Port: This will be the IP address of your VPS server and the port will be 11994
Masternode Private Key*: This is a unique key that we will generate for each masternode by using the command
masternode genkey in the Tools -> Debug Console screen located in the wallet.
TXID Collateral: This is the transaction id for the 1,000 CHC you sent to the wallet address
TX Output Index: This will either be a 0 or 1 and point to the 1,000 CHC on the transaction. In the example below we can see the 1,000 CHC is second so the TX output will be 1. If it was above it would be a 0.
Use the Chaincoin Block Explorer to find the TXID and TX Output Index
- Setup the masternode.conf file we just created using the information above for each masternode. It should look like this:
- Remember the IP address will be the VPS IP address we setup below
- Save the masternode.conf file.
Setting up the Hosted Masternode VPS (Virtual Private Server)
Now this is the part where most people panic but it’s actually very easy. You can start by setting up an account on https://www.vultr.com/?ref=7304321
They do hosting for about $5 a month and they accept bitcoin as payment.
I use vultr for all my MN’s as i find the service easy to use and reasonably priced.
I should make this very clear i am no linux expert but following the step by step guides posted on every Masternode website has worked out quite well for me so far.
Experience has taught me to follow these guides to the nearest full stop and don’t skip over anything.
- After you sign up create a new VPS machine by clicking on the + button to “Deploy a New Server”.
- Select your preferred location for your VPS server
- Select the Ubuntu Server x64bit 14.04 The Ubuntu Version needs to be 14.04
- Select your server size, the recommended size will be the 1GB server which at this time is $5 a month
- Give it a meaningful name for example ChainCoinMN1, you also have the option to enable automatic backups if you want
If you have multiple masternodes to setup then we will need to create one VPS per MN as recommended by the developers, we can do this by setting up on MasterNode and then creating a snapshot to quickly create the others
- We need to login to our new VPS server and download the wallet, but first we need to access it. There are various programs to access linux VPS machines but we will be using Putty for this guide.
- Go to the Putty website and download and install the client
- Install and run Putty. Now we need to enter the VPS credentials to login.
The username will be: root
The Password will be located by clicking on VPS on the Vultr site.
- After we logged in we will need to type a series of commands to get started in order
Create Swap File
Run these commands to make a swapfile:
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
sudo mkswap /var/swap.img
sudo swapon /var/swap.img
To make the swap file persist if the server is rebooted:
sudo chmod 0600 /var/swap.img
sudo chown root:root /var/swap.img
sudo nano /etc/fstab
Append the following line to the end of the file:
/var/swap.img none swap sw 0 0
Save the file by using cntrl+s and confirm the changes
Install the dependencies needed before compiling the Masternode
sudo apt-get update
sudo apt-get install automake
sudo apt-get install libdb++-dev
sudo apt-get install build-essential libtool autotools-dev
sudo apt-get install autoconf pkg-config libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install git
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo apt-get install g++
Download and compile the Berkely DB v4.8 database
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev -y
Download the chaincoin source code:
git clone https://github.com/chaincoin/chaincoin.git
Compile the masternode using the Berkely DB v4.8 and no GUI
sudo make install
If you are setting up multiple masternodes, it will be a good idea to at this point to create a snapshot of this VPS machine now to speed the installation of new masternodes.
To Create a Snapshot follow the following setups:
- Go to your Vultr Dashboard and click on the VPS machine you want to snapshot, and navigate to the Snapshot Menu
- Give your snapshot a name for example ChainCoin_seed
- Click on Take Snapshot and wait for the process to complete. At the time of writting this guide snapshots on Vultr are free
- When the snapshot is complete you can now use this snapshot to create New VPS Servers for new MasterNodes
To create a new VPS Server with the Snapshot we just created:
- Deploy a new server by clickin on the + icon to deploy a new server
*Select your preferred region
*When selecting Server Type look for the Snapshot tab and select your snapshot. Note The server size has to be equal to or greater than the server you created the snapshot from.
This will speed up setting up new masternodes by allowing you to start from the steps below for each new masternode. It is important to note that you will have to change the HostName for each new snapshot server to match your new name. You can do this by entering the following on the command line to change your Hostname to match:
sudo nano /etc/hosts
sudo nano /etc/hostname
Edit the configuration file for the Masternode
a. Go to the configuration folder:
b. If the folder doesn’t exist, create it with
mkdir ~/.chaincoin/ and then use
cd ~/.chaincoin/ to go into the config folder
c. List the contents and look for chaincoin.conf
d. If the file doesn’t exist, create it like this:
e. Edit the file:
f. Add these lines to the file if they don’t already exist:
rpcuser=(create a username)
rpcpassword=(enter a strong password)
externalip=(VPS IP Address)
bind=(VPS IP Address)
masternodeaddr=(VPS IP Address):11994
masternodeprivkey=(Insert your masternode key we generated above)
The rpcuser and rpcpassword values are for the RPC interface, allowing you to interact
with the Masternode from the command line. Use any values you like but keep a copy of
them on file somewhere.
- Run chaincoind and wait for it to sync. This may take a while as it needs to download a large file.
Once your masternode has synced to the blockchain we will be ready to start with the next step which is starting the MasterNode from your Windows Wallet
Starting your new MasterNode
- Go to your Windows wallet and open the RPC console by going to Tools -> Debug Console
- Enter the following command into the RPC console
masternode start-many (wallet password)If your wallet is encrypted which I recommend you do then you would put your password in place of (wallet password).
You should see a message in the console:
“overall” : “Successfully started masternode, failed to start 0, total 1”,
“alias” : “masternode1”,
“result” : “successful”
Checking on your MasterNode
You can check if your masternode is running by opening the RPC console by going to Tools -> Debug Console and entering
masternode list status IPAddress
to get a full list of masternodes enter:
to stop your masternode
masternode stop-alias mnAlias
to see count of masternodes
to start a specific masternode use
masternode start-alias mnAlias
And we are finished
You now have your first masternode running hopefully and you can start reaping the rewards in a few days.
If you follow the steps outlined in this guide and stick to the install guides available on every Masternode website you will become very efficient at setting up nodes in no time.
I started with 1 Memetic node a few weeks ago and since then i have added
So there we go. I hope this guide helps you along into the world of Masternodes.
Happy staking my friends.