How to host a BlackHat masternode if you are using Linux - CLI

Post Reply
User avatar
AlexBlackHat
Site Admin
Posts: 21
Joined: Tue Apr 13, 2021 7:40 am

How to host a BlackHat masternode if you are using Linux - CLI

Post by AlexBlackHat »

Original post by Jeffrey

ATTENTION
This guide is updated for release version 5.6.1. Please, before use direct download links make sure you're trying to download the latest version.
To check the latest version go to https://github.com/BlackHatCoin/BlackHatWallet/releases
If latest version differs from this guide use the latest version from github.


Basic requirements:
  1. Your PC running a recent version of Linux - Ubuntu 18.04 recommended that will run the BlackHat wallet and keep your funds.
  2. A VPS with Ubuntu Server 18.04 64-bit OS installed with unique IP address that is running 24/7
  3. Minimum VPS specs: 10 GB of storage space, 2 GB of RAM, 1 dedicated CPU core
  4. Latest BlackHat Core wallet release
  5. 5,000 BLKC (good to have 5,001 to make sure you can cover transaction fee)
Step 1: Download the latest BlackHat wallet release (Skip if you already have it installed)

Code: Select all

cd ~ && wget https://github.com/BlackHatCoin/BlackHatWallet/releases/download/v5.6.1/blackhat-5.6.1-x86_64-linux-gnu.tar.gz
tar -zxvf blackhat-5.6.1-x86_64-linux-gnu.tar.gz && sudo rm -f blackhat-5.6.1-x86_64-linux-gnu.tar.gz
Step 2: Open your BlackHat wallet and let it sync (Skip if you already have it installed and synchronized)

Code: Select all

cd ~/blackhat-5.6.1/bin
./blkcd -daemon
Step 3: Generate a new BlackHat address and send exactly 5000 BLKC to it

Code: Select all

./blkc-cli getnewaddress
If you are sending from within this wallet to the new address then run this command:

Code: Select all

./blkc-cli sendtoaddress ADDRESSfromGETNEWADDRESS 5000
Step 4: Get the masternode private key and masternode outputs, Save them to a text document for the upcoming steps:

Code: Select all

./blkc-cli createmasternodekey

Code: Select all

./blkc-cli getmasternodeoutputs 
You can now close your BlackHat wallet on your main PC by running the following command:

Code: Select all

./blkc-cli stop
Step 5: We need to now add the information above to our "Masternode.conf file"
Navigate to your BlackHat data directory:

Code: Select all

cd ~/.blackhat
Open masternode.conf with your favorite text editor and add in the following:
{Name of Masternode} {VPS IP Address}:7147 {The result of createmasternodekey you saved in the text doc.} {Result of the getmasternodeoutputs} {The Single Digit Number after Masternode Ouputs}

A good example of a Proper Input:

Code: Select all

mn1 127.0.0.2:7147 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
After completing all that information you can save and close the file.


VPS Remote wallet installation - (https://forum.blackhatco.in/viewtopic.php?f=8&t=2)
These procedures are for a clean server install. If you have an existing installation then some steps may not be required. Performing the steps is unlikely to have any effect on the system. Securing the server has NOT been included in this tutorial. That is your responsibility. Although it’s not required, a great guide can be found here to assist you.

To be able to access a VPS, you need a software/SSH client like PuTTY for example. You can choose between alternatives as well, but this tutorial will not include installation of such software. After you successfully login to your VPS, follow the further steps.

Step 1 – Install most recent security patches

A clean server install will likely need some software updates. Enter the following command which will bring the system up to date:

Code: Select all

sudo apt-get update && sudo apt-get -y upgrade

Step 2 – Download and extract BlackHat Core wallet for Linux

Enter the following command lines one by one to download and extract BlackHat wallet:

Code: Select all

cd ~ && wget https://github.com/BlackHatCoin/BlackHatWallet/releases/download/v5.6.1/blackhat-5.6.1-x86_64-linux-gnu.tar.gz
tar -zxvf blackhat-5.6.1-x86_64-linux-gnu.tar.gz && sudo rm -f blackhat-5.6.1-x86_64-linux-gnu.tar.gz

Masternode Configuration
Step 3 – Create the masternode configuration file and populate

Before the node can operate as a masternode a custom configuration file needs to be created. Since we have not loaded the wallet yet, we will create the necessary directories and the configuration file by typing the following command lines one by one:

Code: Select all

mkdir ~/.blackhat && cd ~/.blackhat && sudo apt-get install nano && touch blkc.conf && nano blkc.conf
This command has created a blank BlackHat configuration file where we will enter our masternode configuration variables. Now we should properly setup configuration settings.

Paste the following configuration settings and modify them to have your fields in rpcuser, rpcpassword, externalip, masternodeaddr and masternodeprivkey

Code: Select all

rpcuser=USERNAMEofChoice
rpcpassword=PasswordOfYourChoice
rpcallowip=127.0.0.1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip=THEvpsIP
masternodeaddr=ThisVPSip:7147
masternodeprivkey=Result from createmasternodekey
Close and save the document.

Download Sapling params (which is needed to start the masternode). Type the following command:

Code: Select all

cd ~/blackhat-5.6.1 && ./install-params.sh

Step 4 – Start the VPS BlackHat wallet and wait for it to sync.

Code: Select all

cd ~/blackhat-5.6.1/bin && ./blkcd -daemon
You can verify that it has synced by comparing the current block height it is on to the one on https://explorer.blackhatco.in, To get the block height run this command:

Code: Select all

./blkc-cli getblockchaininfo

-----------------------------------------------------------------

Back to your PC to start the Masternode.

If you have a password set on your wallet you will first need to unlock it:

Code: Select all

./blkc-cli walletpassphrase YOURPASSWORD 90
90 means it will be unlocked for 90 seconds.


You can now proceed to start your masternode:

Code: Select all

./blkc-cli startmasternode missing 0
and on your VPS run the following:

Code: Select all

./blkc-cli startmasternode local false

Congratulations! You have now setup a masternode. Your masternode should switch to Enabled after 3-5 days and start getting masternode rewards. Make sure to vote on proposals
Post Reply