This guide will show you how to setup a masternode with a controller wallet (Windows). This means that instead of holding your CHC coins on the VPS server you will hold it on your Windows Wallet instead.
7/15/2017 - Initial Doc
First Go to the chaincoin website and download the Windows Wallet
http://www.chaincoin.org/chaincoin-wallet/
masternode genkey which should give us a long string. Keep note of each of these keys as we will be using this later. Remeber you need to do this for each MasterNode as each masternode will need it's own unique key.Please note where you set the default directory upon intial 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: https://github.com/chaincoin/chaincoin/blob/master/doc/masternode_conf.md
# 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
http://104.238.153.140:3001/
Create a VPS on your perferred provider, in this setup I will use Vultr which you can sign up here:
http://www.vultr.com/?ref=7182750
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.htmlsudo 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:
cd ~
git clone https://github.com/chaincoin/chaincoin.git
Compile the masternode using the Berkely DB v4.8 and no GUI
cd ~/chaincoin/
./autogen.sh
./configure --without-gui
make
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 setps:
To create a new VPS Server with the Snapshot we just created:
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:
cd ~/.chaincoin/
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
ls
d. If the file doesn’t exist, create it like this:
touch chaincoin.conf
e. Edit the file:
nano chaincoin.conf
f. Add these lines to the file if they don’t already exist:
rpcuser=(create a username)
rpcpassword=(enter a strong password)
rpcallowip=127.0.0.1
daemon=1
server=1
listen=1
maxconnections=256
masternode=1
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.
chaincoind
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
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).“overall” : “Successfully started masternode, failed to start 0, total 1”,
“detail” :
“status” :
“alias” : “masternode1”,
“result” : “successful”
Done.
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:
masternode list
to stop your masternode
masternode stop-many
OR
masternode stop-alias mnAlias
to see count of masternodes
masternode count
to start a specific masternode use
masternode start-alias mnAlias
Thanks to @jeffblogs for providign some of the content to this guide:
https://steemit.com/@jeffblogs
Also a BIG Thanks to all those ChainCoin HODLers!! Keep on HODL'in