Bitcoin 2 Masternode Setup Guide
Last edit: Jan 15 2023
Managed BTC2 masternode hosting services
1000 BTC2 per masternode. Managed service is easier to set up as most of the work is automated by the platform.
You can choose between these managed "cold" masternode hosting service providers:
- Pecunia Platform - $0.99/month or half of that if prepaid for 6 months.
- ihostmn.com - 0.99 euros per month.
- POS MN - $0.70/month.
For managed masternode hosts, just follow the instructions on their website but with caution, making sure to send the required amount of 1000 BTC2 only to your local wallet's receiving address.
If you do that, your 1000 coins are safe and the host has no access to your coins. After masternode activation, you can keep your wallet offline and still receive the rewards.
If you want to host your own Bitcoin 2 masternode, follow the guide below:
Old Russian Translation: Русская версия - переведено волонтером
Requirements for running a BTC2 Masternode by yourself
- 1000 BTC2.
- 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.
- Your personal computer or laptop. It can control multiple masternodes and it can remain offline after activation. This should not be the same as the masternode computer.
- Minimum 1 GB of RAM on the Masternode, but that could be slow. More than 2 GB of RAM Recommended.
- More than 2 GB of HDD space will be used by Bitcoin 2 Core. At least 8 GB HDD recommended.
- 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
- aws.amazon.com (Free for 12 months for new accounts for 1 node.)
- Digital Ocean (With this link you can host up to 10 nodes for free for 1 month. $5/month/node after that.)
- cloud.google.com/free/ (For new accounts: free $300 worth of credits to be used in 12 months.)
- azure.microsoft.com (Free for 12 months for new accounts for 1 node. B1s only.)
- Vultr.com $5/month
- virmach.com $4/month
- virpus.com $5/month
- oracle.com 2 nodes always free
If you choose any other service than Amazon AWS, Azure, Digital Ocean, Oracle or Google cloud, then after you’ve got your server details, you may want to go through some initial server hardening 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 few dollars.
Includes: One t2.micro instance (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
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.
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 a Swap file on Linux
Usually swapping has not been setup on new Linux nodes, so you need to set up swapping by executing the following commands on your masternode. (Using Putty for example):
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile
sudo mkswap /swapfile
echo /swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab
sudo swapon /swapfile
How to setup the Bitcoin 2 Masternode
- Using the main wallet on your local computer, enter the debug console and type the following commands:
"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.
- Send 1000 BTC2 to the public address you generated in Step 1, making sure to send exactly 1000, in one transaction.
- 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.
- 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)] [Masternode Public 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 22.214.171.124:8333 192WPpkqbr7sr6Si4fdsfssjjapuFzAXwETCrpPJubnrmU6aKzh c8f4965ear7a68d0e6dd384324dfd28cfbe0c801015b973e7331db8ce018716999 1
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.
- 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/download/2.3/bitcoin2-2.3.0-x86_64-linux-gnu.tar.gz (get the latest x86_64-linux-gnu.tar.gz version. Replace the part: /2.3/bitcoin2-2.3.0 with the actual version number, if a newer version exists.)
Linux: and extract the files with: sudo tar -zxf bitcoin2-2.3.0-x86_64-linux-gnu.tar.gz # Or whatever the file name is.
Linux: Create the data directory: mkdir ~/.bitcoin2/
- Still on the masternode, find the Bitcoin 2 data directory or click Tools - Open wallet configuration file. (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
maxconnections=256 (or a lower number such as 32 if you need to save bandwidth)
externalip=Masternode public ip address
bind=Masternode ip address (Usually internal IP. for Amazon AWS, the private IP. For Google Cloud, the Primary internal IP.)
masternodeaddr=Masternode public ip address:8333 (keep the :8333 as the port number)
masternodeprivkey=Result of Step 1
- Start the Bitcoin 2 daemon on the masternode and let it sync.
Linux: cd bitcoin2-bin
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.
- 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 more than an hour before you can start getting rewards from running it. The first reward takes longer to receive than the next ones.
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 on your local wallet in order to not have too many rewards over time slowing down your wallet.
Example: autocombinerewards true 50
Every time a block is received, this would check if it can combine all unspent transactions in one address that are below 50 BTC2 and create a transaction (with the normal fees) that combines them if they total 50+ 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: Encrypt your local wallet to better secure your BTC2
Unless you trust that you never have viruses on your computer and you are sure that no one else ever has access to your computer, you may want to
encrypt your local wallet that contains the BTC2 masternode collaterals and that will receive the rewards.
You can do it by clicking Settings, and then Encrypt wallet. All your backups would need to be encrypted too for it to be useful.
You may want to make a human readable wallet dump as well with the debug console command dumpwallet, or just dump the private keys one by one with the dumpprivkey command if you only have a few addresses in use. And then encrypting whatever file contains the wallet dump or the private keys.
This way you can import just the useful private keys later to another wallet if needed one day.
Optional: How to stake additional BTC2 with your Linux 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 encryptwallet INPUT_YOUR_PASSWORD_HERE ### Come up with a new password and do not lose it, or else you will lose your coins.
The wallet will then shut down to finish the encryption process. After it has finished shutting down, start it again with:
./bitcoin2-cli getaccountaddress ""
Send whatever amount you want to the address that is shown after you type the above command. You can send a test amount like 0.001 BTC2 first.
If you send more than 500 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.
Unlock your wallet for staking only:
./bitcoin2-cli walletpassphrase INPUT_YOUR_PASSWORD_HERE 0 true
Wait for 1 hour and 42 minutes or longer. (101 blocks since sending to the new address) and then check if you are staking with:
./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
Optional: Speed up your local wallet if it has slowed down too much
If after months of receiving 100s of rewards you notice your wallet.dat file becoming bigger than 20 MB and you feel that your wallet is too slow,
you may consider doing these steps to move your BTC2 to a fresh installation with less clutter:
- Rename masternode.conf to oldmasternode.conf. This will unlock your coins for spending.
- Stop Bitcoin 2 Core.
- Create a new Bitcoin 2 installation with -datadir=another data directory specified in a new shortcut to a bitcoin2-qt executable, and copy all the files to it from the old directory, except for backups and wallet.dat.
- Launch Bitcoin 2 Core in the new directory.
- Get the receiving addresses from it and transfer to them with the old installation. Including transferring to new masternode public addresses. (The masternode private keys made with masternode genkey can stay the same.)
- Rename oldmasternode.conf back to masternode.conf in the new directory and edit it to include the new collateral_output_txid and the new collateral_output_index (and aliases if you created different ones.)