Bitcoin 2 Masternode Setup Guide

Last edited October 17 2018

Russian Translation: Русская версия - переведено волонтером

Basic requirements for running a BTC2 Masternode

  1. 1000 BTC2.
  2. The Masternode computer that will be running 24/7 and an IP address for it that can be used by no more than one BTC2 Masternode. Static IP recommended.
  3. Your personal computer or laptop.
  4. Minimum 1 GB of RAM on the Masternode.
  5. If your hosting plan's bandwidth is metered, then at least 20 GB/month of bandwidth recommended but not required.

The basic reasoning for these requirements is that, you get to keep your BTC2 in your local wallet, and host your masternode remotely, securely. First you need to decide where you want to host your masternode. A VPS or a dedicated server is recommended.

Some VPS hosts

  1. aws.amazon.com (Free for 12 months for new accounts.)
  2. cloud.google.com/free/ (For new accounts: free $300 worth of credits to be used in 12 months + always free micro google compute engine instance.)
  3. Vultr.com $5/month
  4. mp-hosting.co.uk ~$3.14/month
  5. virmach.com $4/month
  6. virpus.com $5/month
If you choose any other service than Amazon AWS or Google cloud, then after you’ve got your server details, you need to go through some initial setup before you do anything Masternode related. You can follow these 3rd party instructions.

Amazon's AWS service to host your Masternode

You can signup to Amazon's AWS service to host your masternode for free for up to 12 months.
However the free amount of outgoing bandwidth limitation of 15 GB/month means that on some months you might get charged a little bit.
Includes: 750 hours per month (there's 720 hours in a month) of t2.micro instance usage (64 bit linux or windows, 15 GB bandwidth/month, 1 GB RAM, 1 virtual CPU, 30 GB HDD space)

Choose an Ubuntu instance (v.16.04 for example) or if you're not comfortable with Linux, you can choose a Windows instance.

Go with the defaults but change the storage space to the maximum free allowed. Which at the time of writing this article is 30 GB.

In the last step before clicking "Review and Launch" you should set up 2 additional fire wall rules.
* One to allow TCP traffic from all IPs for port 8333
* One to allow UDP traffic from all IPs for port 8333
Inbound AWS firewall rules

Generate a private key there and download the file when asked and follow the instructions on their website about how to connect to your new node.

in the EC2 management console, ensure you've created and associated an elastic IP with your instance. You can then use that elastic IP address to connect to the node.

Limits for free use to be aware of:
15 GB outgoing bandwidth per month at the time of writing this article. If it goes over that, it's likely to cost only cents in a month.
1 GB of RAM means you need to set up swapping by executing the following commands on your AWS instance (using Putty for example):

Linux only:
sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo chmod 600 /swapfile
sudo mkswap /swapfile
echo /swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab
sudo swapon /swapfile

AWS specific instruction for later stages of this guide:
Use the private IP for the "bind=" value in bitcoin2.conf on the masternode. Use the elastic IP for externalip and mastenodeaddr.

How to setup the Bitcoin 2 Masternode

  1. Using the main wallet on your local computer, enter the debug console and type the following commands:
    masternode genkey
    getaccountaddress masternodename1

    "masternodename1" being the name you give the masternode address, which you can choose yourself. Copy-paste the output you get from masternode genkey to a notepad for later, this is your MASTERNODEPRIVKEY.

  2. Send 1000 BTC2 to the public address you generated in Step 1, making sure to send exactly 1000, in one transaction.

  3. Then after a minute or two, still in the debug console, enter: masternode outputs - and copy-paste the output to your notepad, this is the TXID and INDEX you will need later.

  4. Still on the local/personal computer, go into the Bitcoin 2 data directory, by default in Windows it’ll be %Appdata%/bitcoin2

    Find masternode.conf and add the following line to it with your own values and without the “[]”s:
    [Name of Masternode(Use the name you entered earlier for simplicity)] [Unique/Static IP address]:8333 [Masternode private key - The result of Step 1] [TXID - Result of Step 3] [INDEX - The number after the long line in Step 3]

    Example: masternodename1 192WPpkqbr7sr6Si4fdsfssjjapuFzAXwETCrpPJubnrmU6aKzh c8f4965ear7a68d0e6dd384324dfd28cfbe0c801015b973e7331db8ce018716999 1

  5. Still on the local/personal computer, edit the bitcoin2.conf file (located in the same directory as masternode.conf)

    rpcuser=long random username of your own
    rpcpassword=longer random password of your own

    Save it, close and restart the wallet.

  6. Next we’re going to login to the server through ssh command-line and install the masternode wallet.

    First we need to download the wallet on our server

    Linux: cd ~/ # Or whatever directory you want.

    Linux: wget https://github.com/BITC2/bitcoin2/releases/..... (get the latest x86_64-linux-gnu.tar.gz version)

    Linux: and extract the files with: sudo tar -zxvf [filename]

    Linux: Create the data directory: mkdir ~/.bitcoin2/

  7. Still on the masternode, find the Bitcoin 2 data directory. (Linux: ~/.bitcoin2. Windows: %Appdata%/bitcoin2). Open or create the bitcoin2.conf file and make it look like this:

    rpcuser=long random username of your own
    rpcpassword=longer random password of your own
    externalip=your unique public ip address
    bind=your unique public ip address (or for Amazon AWS, the private IP. Or for Google Cloud, the Primary internal IP.)
    masternodeaddr=your unique public ip address:8333 (keep the :8333 as the port number)
    masternodeprivkey=Result of Step 1

  8. Start the Bitcoin 2 daemon on the masternode and let it sync.

    Linux: cd bitcoin2/bin

    Linux: ./bitcoin2d
    Windows: Launch bin/bitcoin2d.exe

    to check the current block you are on run: ./bitcoin2-cli getinfo

    and compare the "blocks" value to the latest block on your local computer's wallet's to the output of the getinfo command on the debug console or a web block explorer. If it's the same, you are ready to move on to the next step.

  9. Now you just need to start it with the controlling wallet on your local computer. (Make sure wallet is unlocked).
    Start bitcoin2-qt and go to the Masternodes tab and click "Start MISSING". A masternode needs to be online and started for a minimum of 45 minutes before you can start getting rewards from running it.

    All done, congratulations!

How to make the Bitcoin 2 daemon run on start-up in Ubuntu/unix-based system

To help ensure uninterrupted service, when connected by SSH to the masternode, make the Bitcoin 2 daemon run on start-up in case of a reboot:

if you installed bitcoin2d to /etc/init.d/:

sudo update-rc.d bitcoin2d defaults
// in case of error, try
sudo update-rc.d bitcoin2d enable

Or if you installed it elsewhere:

sudo vi /etc/rc.local # or vim. Press Esc and type :wq and Enter to exit and save.

and add ./path/to/bitcoin2d -datadir=/home/ubuntu/.bitcoin2 #(or your custom datadir where bitcoin2.conf is) to the file

Optional: Automatically combine your BTC2 rewards

It is recommended to use the command autocombinerewards in the debug console in order to not have too many 0.2 BTC2 rewards over time slowing down your wallet.

Example: autocombinerewards true 100
Every time a block is received, this would check if it can combine all unspent transactions in one address that are below 100 BTC2 and create a transaction (with the normal fees) that combines them if they total 100+ BTC2, and sends to that same address of yours.
You only need to execute the command once and you can disable it at anytime with: autocombinerewards false

Optional: How to stake additional BTC2 with your VPS/server/masternode

If you want to send extra coins to your server, VPS or masternode in order for it to start staking with them 24/7, you can do it as follows:

On the server/masternode, run: ./bitcoin2-cli getnewaddress

Send whatever amount you want to that address. The more the merrier. Best to send at least 1 BTC2. But if you're unsure, you can send a test amount like 0.001 BTC2 first.
If you send more than 20 BTC2, then it is better to send it in at least a few transactions in order to maximize staking efficiency.

To make sure that you received the coins, Run: ./bitcoin2-cli getinfo
and look at your balance.

After at least 1 hour and 42 minutes, run:
./bitcoin2-cli stop # In order to restart the wallet with the next command.
./bitcoin2-cli getstakingstatus # This should report true for everything. If so, then you are staking!

And then when you want to send BTC2 from the server/masternode to some address, use: ./bitcoin2-cli sendtoaddress BTC2Address AmountInBTC2