What's new

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

Jeffrey

Administrator
Staff member
Basic requirements:

  1. Your PC running a recent version of Linux - Ubuntu 18.04 recommended that will run the PIVX 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: 50 GB of storage space, 2 GB of RAM, 1 dedicated CPU core
  4. Latest PIVX Core wallet release: v5.5.0
  5. 10,000 PIVX (good to have 10,001 to make sure you can cover transaction fee)
Step 1: Download the latest PIVX wallet release (Skip if you already have it installed)
cd ~ && wget https://github.com/PIVX-Project/PIVX/releases/download/v5.5.0/pivx-5.5.0-x86_64-linux-gnu.tar.gz
tar -zxvf pivx-5.5.0-x86_64-linux-gnu.tar.gz && sudo rm -f pivx-5.5.0-x86_64-linux-gnu.tar.gz

Step 2: Open your PIVX wallet and let it sync (Skip if you already have it installed and synchronized)
cd ~/pivx-5.5.0/bin
./pivxd -daemon

Step 3: Generate a new PIVX address and send exactly 10K PIVX to it
./pivx-cli getnewaddress
If you are sending from within this wallet to the new address then run this command:
./pivx-cli sendtoaddress ADDRESSfromGETNEWADDRESS 10000

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

./pivx-cli getmasternodeoutputs


You can now close your PIVX wallet on your main PC by running the following command:
./pivx-cli stop

Step 5: We need to now add the information above to our "Masternode.conf file"
Code:
Navigate to your PIVX data directory
cd ~/.pivx
Open masternode.conf with your favorite text editor and add in the following:
{Name of Masternode} {VPS IP Address}:51472 {The result of createmasternodekey you saved in the text doc.} {Result of the getmasternodeoutputs} {The Single Digit Number after Masternode Ouputs}


A good example is this:
Example of a Proper Input:
Example: mn1 127.0.0.2:51472 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0

After completing all that information you can save and close the file.


VPS Remote wallet installation - (https://forum.pivx.org/index.php?threads/masternode-setup-guide.746/ )
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:

sudo apt-get update && sudo apt-get -y upgrade
Step 2 – Download and extract PIVX Core wallet for Linux

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

cd ~ && wget https://github.com/PIVX-Project/PIVX/releases/download/v5.5.0/pivx-5.5.0-x86_64-linux-gnu.tar.gz
tar -zxvf pivx-5.5.0-x86_64-linux-gnu.tar.gz && sudo rm -f pivx-5.5.0-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:

mkdir ~/.pivx && cd ~/.pivx && sudo apt-get install nano && touch pivx.conf && nano pivx.conf
This command has created a blank PIVX 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:
rpcuser=USERNAMEofChoice
rpcpassword=PasswordOfYourChoice
rpcallowip=127.0.0.1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip=THEvpsIP
masternodeaddr=ThisVPSip:51472
masternodeprivkey=Result from createmasternodekey

Close and save the document.

Step 3: Start the VPS PIVX wallet and wait for it to sync.
cd ~/pivx-5.5.0/bin && ./pivxd -daemon

You can verify that it has synced by comparing the current block height it is on to the one on https://explorer.pivx.org, To get the block height run this command:
./pivx-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:
./pivx-cli walletpassphrase YOURPASSWORD 90
90 means it will be unlocked for 90 seconds.

You can now proceed to start your masternode:
startmasternode missing y

and on your VPS run the following:
./pivx-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 :)





Note:
Thanks to the original writer of the masternode setup guide found at https://pivx.org/knowledge-base/masternode-setup-guide/
 
Last edited:
Top