Staking with Multiple Masternodes

in #cryptocurrency6 years ago (edited)

This post aims to outline a procedure you could follow along to build multiple NYEX masternode(s). It requires that you already have a wallet for staking. Else, you may want to check several posts below.

 
Most of the scripts, configs and other supplemental files are available for download in my github repository.

Terminologies and Definitions

In this post and the above, the staker instance refers to the wallet. The user that runs the staker wallet is "nyex", while the user that runs the masternode instance is "nyexmn". Create the users as they don't usually exist by default in the VPS.

It follows that when making modifications to the staker instance, everything is relative to the home directory of user "nyex"; while the configuration files for the masternode is relative to the home directory of the masternode user "nyexmn". There usually is confusion in this matter.

Create Another VPS Instance

Launch another VPS instance. Prep it like the rest of the VPS instances. The "setup.sh" script in the github repository above. Download and execute the shell script.
$ sudo bash setup.sh

Multiple masternode instances could not co-exist in the same VPS instance since the masternode runs on a specific TCP port (port 54918 in the case of NYEX). The masternode will not start unless that port is available.

Install Additional Packages

Next, download the NYEX Linux wallet and extract it to /usr/local/bin. At the time this procedure was written, the current wallet version is V1.0.1.0. You may want to check the latest version from the Nyerium github repository.
$ wget https://github.com/nyerium-core/nyerium/releases/download/v1.0.1.0/nyerium-1.0.1.0-x64-linux-tar.gz
$ sudo tar zxf nyerium-1.0.1.0-x64-linux-tar.gz -C /usr/local/bin

Deposit Exactly 10,000 NYEX

(NOTE: Execute this on the staker node)

Generate a NYEX wallet address for your masternode. MN2 (enclosed in quotes below) can be any alias you want to call your masternode. Just like MN1, remember that this will be used later. You are starting to see the logic of using MNx (where "x" is the next number on the sequence).
$ nyerium-cli getaccountaddress "MN2"
Nb53ez1Kr24q1SjwgJJez9wFNAjyQxV9N1

Next, you need to deposit exactly 10,000 NYEX coins. Yes, you read it right -- exactly 10,000 NYEX coins. Just like the first masternode instance, the next masternode you build will require another 10,000 NYEX deposit to your staker wallet. This means you should have at least 20,000 NYEX coins for masternode collateral.

This could be a transfer from the same wallet, and will show up as a "To yourself" type transaction. If sending directly from another exchange, impute the transaction fees.
$ nyerium-cli sendtoaddress "Nb53ez1Kr24q1SjwgJJez9wFNAjyQxV9N1" 10000

Obtain Masternode TXID

After the deposit, the masternode transaction id information can be obtained. The output is a transaction hash and a trailing number having a value of either 0 or 1. Take note of these information. Let's call them MN2TRXHASH and MN2VOUT respectively. You will see that the previous TRXHASH and VOUT are already existing and another entry was added. Use the NEW ones.

$ nyerium-cli masternode outputs
{
    "54f937a7eb216fc17f4c0ab7aa8489229a1e63a26cafbadce11018d061fcfa46" : "0",
    "1f1f40accaa1a0a48a427a33d4c0f42325ca4020c80e5336f15095d51c97d8bf" : "1"
}

 

Generate a New Masternode Private Key

Next, generate a masternode private key. Take note of the output as well. Again, let's call this MN2PRIVATEKEY.
$ nyerium-cli genkey

Configure the Masternode

(NOTE: Execute this on the new masternode)

Create the username that will run the masternode daemon. In my case, I use nyexmn as the user that runs the masternode daemon.
$ sudo useradd nyexmn -m

Create the masternode configuration

Next, create the masternode configuration file ~nyexmn/.nyerium/nyerium.conf.
rpcuser=nyexrpc
rpcpassword=somelongmd5hashthatcontainstherpcpassword
rpcallowip=127.0.0.1
server=1
masternode=1
masternodeaddr=#MN2VPSIPADDR#:57418
masternodeprivkey=#MN2PRIVATEKEY#

Replace MN2VPSIPADDR with the IP address of the new VPS masternode, and likewise replace MN2PRIVATEKEY with the output of the nyerium-cli genkey that was previously executed. The hashes are there to highlight the variables, but they are not needed so remove them.

Masternode systemd service

Like the previous masternode, download the file nyex-masternode.service from my github repository. Place this file in the folder /etc/systemd/system.
$ sudo cp nyex-masternode.service /etc/systemd/system
$ sudo systemctl daemon-reload
$ sudo systemctl enable nyex-masternode
$ sudo systemctl start nyex-masternode

Check and ensure that the system is running (initially, you will have to wait for the wallet to completely sync the blockchain history). Note that another command is introduced here. This is another way to check the status of the masternode.
$ nyerium-cli masternode debug
Not capable masternode: Hot node, waiting for remote activation.

Once you see a "message" similar to the above, your masternode is now ready.

Configure The Staker Node

(NOTE: Execute this on the staker node)

The staker node can now activate the masternode. But it needs to be configured first.

Masternode Configuration

The masternode configuration file ~nyex/.nyerium/masternode.conf needs to be modified. Add the following lines.
MN2 #MN2VPSIPADDR#:57418 #MN2PRIVATEKEY# #MN2TXHASH# #MN2VOUT#

MN2 in the above is the alias used to generate the NYEX wallet. The rest of the items enclosed in hashes are already defined before. The line beginning with MN1 should still be there. Do not make changes to that line, but simply add another line for MN2.

Restart the staker service

Restart the staker service for it to be able to re-read the masternode.conf configuration file.
$ sudo systemctl restart nyex-staker

Next, activate the masternode. Again the MN1 alias is used here.
$ nyerium-cli startmasternode alias false MN2

Check and ensure that the masternode is running.

$ nyerium-cli masternode list-conf
{
    "masternode" : {
        "alias" : "MN1",
        (some output snipped)
        "status" : "ENABLED"
    },
    "masternode" : {
        "alias" : "MN2",
        (some output snipped)
        "status" : "ENABLED"
    }
}

 
Once you see the "status" is ENABLED, the masternode is now working.

Verify the status as well on the masternode with command nyerium-cli masternode debug. Status should indicate Masternode successfully started. Otherwise, you have misconfigured your masternode.

Repeat the same procedure for additional masternodes you wish to add.

NYEXMN.PNG




If you like this post, you know what to do.

Support:

  • Bitcoin (BTC) - 3Kyjg1Wj1PNGN3KhiRprxYvvQpdjC5kT3k
  • Etherium (ETH) - 0x5F168F895C63ccC5FbEf921047bc2b63f6780c3F
  • SmartCash - SbgqBUuGBVaaFERmc5zPn8XStxXe7vE1SL

Thanks!

 

Sort:  
UpvoteBank
Your upvote bank
__2.jpgThis post have been upvoted by the @UpvoteBank service. Want to know more and receive "free" upvotes click here

💡 @dillagr get upvote on 95% (VotingPower 9769.92).
The post can fall into a two-day rating and get a reward in the case of Upvote the post

Rules for calling bot:

  • Anyone can leave an appeal under the author of the post, which is in my subscribers.
  • The bot can be called no more than 3 times in 24 hours.
  • Upvote on 95%, if the Voting Power is more than 93%. Upvote on 85% if the Voting Power is between 92% and 85%. Upvote 75% if below 85%.
  • After the Upvote of the comment, the bot votes with more VotingPower.

This post has received a 0.39 % upvote from @drotto thanks to: @dillagr.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by dillagr from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

How Cool!

You got a 2.33% upvote from @coolbot courtesy of @dillagr!

Help us grow, delegate today!

💡 Congratulations, your post was rated Rating of the posts who called djimirji. Period 18.6.2018-20.6.2018.

In the case of an Upvote post with a reward, the reward would be: 0.003 SBD

2+2 is 4 minus 1 thats 3 quick maths.

I smoke trees