/ ADEN

How to start your own Masternode - using the terminal console

Part 1 - Virtual machine setup

  • DigitalOcean (the cloud provider) has a great refferal promotion as it follows:
if you register using a refferal link, you will get $100 for 60 days
refferal link (e.g. my own): https://m.do.co/c/dfca95232ee9
  • Create a new virtual machine: Create -> Droplet
  • Select Ubuntu operating system and the $5 standard plan
  • And a region where you wish to have your machine hosted in the cloud
  • Customize the name of the machine and wrap it all up by clicking on Create
  • You will be redirected to the dashboard showing you that the new machine is being created
  • After around 20 seconds, the virtual machine will be created and you will receive a e-mail with the connection details
  • After you opened the executable, introduce the IP address you received in the e-mail and click on Open
  • You will receive a warning, click on Yes
  • Login with the username and password received in the e-mail received upon creating the virtual machine

Useful tip: in order to paste (ctrl+v) something in the terminal, use the right click of the mouse

  • Change the generated password to your own password
  • Update the software available on the virtual machine to the latest versions

apt-get update -y

  • Install software needed for the masternode

apt install ufw python virtualenv git unzip pv -y

  • Install and setup a firewall

ufw allow ssh/tcp

ufw limit ssh/tcp

ufw allow 7777/tcp

ufw logging on

ufw enable

  • Add swap memory

fallocate -l 4G /swapfile

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

nano /etc/fstab

  • Add the following line at the end of the file (navigate with the down key arrow)

/swapfile       none    swap    sw      0       0

  • Then press Ctrl + X to close the editor, then Y and Enter save the file
  • Reboot the virtual machine for the changes to take place.

reboot now

  • After 1-2 minutes, connect again to the virtual machine using PuTTY

Part 2 - Help Core setup

Help Core is the software behind both the Help Core GUI wallet and Help masternodes. If not displaying a GUI, it runs as a daemon on your virtual machine (helpd), controlled by a simple command interface (help-cli).

*daemon - program that runs as a background process, , rather than being under the direct control of an interactive user

*GUI - Graphical User Interface

  • Download and install the components of your Help masternode

cd /tmp

wget https://github.com/gohelpfund/aden/releases/download/v0.13.1.0/helpcore-0.13.1-x86_64-linux-gnu.tar.gz

  • Create a working directory for Help, extract the compressed archive and copy the necessary files to the directory:

mkdir ~/.helpcore

tar xfv helpcore-0.13.1-x86_64-linux-gnu.tar.gz

cp -f helpcore-0.13.1/bin/helpd ~/.helpcore/

cp -f helpcore-0.13.1/bin/help-cli ~/.helpcore/

  • You can now start running Help Core on the virtual machine to begin synchronization with the blockchain.

~/.helpcore/helpd --daemon

  • Generate a legacy masternode key

~/.helpcore/help-cli masternode genkey

output: 7r1du3AhjhCGihTzWudgKsYS9VoSZa45WgQqUwnxgMeVitoJMPu

  • Generate a new Help address for the collateral

~/.helpcore/help-cli getnewaddress

output: Xvp6CgKyAEJHZ2CgAVdma9f5145AZrtrRF


Send exactly 2,500 HELP to the collateral address you generated  previously


  • The next step is to secure your wallet with a password of at least 8 characters

~/.helpcore/help-cli encryptwallet yourSecretPassword

  • Create a configuration file using the following command:

nano ~/.helpcore/help.conf

  • An editor window will appear. Copy and paste the following text to get started:

rpcuser=XXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
maxconnections=64
masternode=1
masternodeprivkey=XXXXXXXXXXXXXXXXXXXXXXX
externalip=XXX.XXX.XXX.XXX

Replace the fields marked with XXXXXXX as follows:

  • masternodeprivkey: legacy masternode private key you generated in the previous step (for example, Xvp6CgKyAEJHZ2CgAVdma9f5145AZrtrRF)
  • externalip: IP address of your virtual machine (for example, 178.62.243.159)

Press Ctrl + X to close the editor and Y and Enter save the file.

  • You can now start running Help on the masternode to begin synchronization with the blockchain

~/.helpcore/helpd

  • We will now install Sentinel, a piece of software which operates as a watchdog to communicate to the network that your node is working properly

cd ~/.helpcore

git clone https://github.com/gohelpfund/sentinel.git

cd sentinel

virtualenv venv

venv/bin/pip install -r requirements.txt

venv/bin/python bin/sentinel.py

  • You will see a message reading helpd not synced with network! Awaiting full sync before running Sentinel. Add helpd and sentinel to crontab to make sure it runs every minute to check on your masternode:

crontab -e

  • Choose nano as your editor and enter the following lines at the end of the file:

* * * * * cd ~/.helpcore/sentinel && ./venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log

* * * * * pidof helpd|| ~/.helpcore/helpd

  • Press enter to make sure there is a blank line at the end of the file, then press Ctrl + X to close the editor and Y and Enter save the file.
  • We now need to wait for 15 confirmations of the collateral transaction to complete, and wait for the blockchain to finish synchronizing on the masternode.
  • You can use the following commands to monitor progress:

~/.helpcore/help-cli mnsync status

When synchronisation is complete, you should see the following response:

{
"AssetID": 999,
"AssetName": "MASTERNODE_SYNC_FINISHED",
"Attempt": 0,
"IsBlockchainSynced": true,
"IsMasternodeListSynced": true,
"IsWinnersListSynced": true,
"IsSynced": true,
"IsFailed": false
}

Part 3 - Register your masternode

  • Identify the funding transaction (where you sent 2,500 previosuly)

~/.helpcore/help-cli masternode outputs

output: {

"ad308ec104bdf113444be609eb3dce9474a5550424204c6538843e3ccd3d4e78" : "1",

}

The first long string is your transaction hash, while the last number is the index.

Generate a BLS key pair

  • A public/private BLS key pair is required for the operator of the masternode.
  • If you are using a hosting service, they may provide you with their public key, and you can skip this step.
  • If you are hosting your own masternode or have agreed to provide your host with the BLS private key, generate a BLS public/private keypair as follows:

~/.helpcore/help-cli bls generate

output:
{

"secret": "48f90726059cd0f14d7ed7698a2d43bb50cba73e86abf3fc365e84cdfada18ac",

"public": "0910777d6dae6ef0ab686e42e81b16602365118593b9d0693197f5ec423362530e71cde402d4be79c6e18fc79e83659c"

}


These keys are NOT stored by the wallet and must be kept secure, similar to the value provided in the past by the masternode genkey command.


Add the private key to your masternode configuration

  • First open the configuration file:

nano ~/.helpcore/help.conf

  • Then add this line to the end of the file, replacing XXXXX with your BLS secret key generated previously:

masternodeblsprivkey=XXXXX

Where:

XXXXX :  is the field "secret"  from the previous output (for example, 48f90726059cd0f14d7ed7698a2d43bb50cba73e86abf3fc365e84cdfada18ac)

  • Press enter to make sure there is a blank line at the end of the file, then press Ctrl + X to close the editor and Y and Enter save the file.
  • We now need to restart the masternode for this change to take effect.

~/.helpcore/help-cli stop

sleep 10

~/.helpcore/helpd

  • We will now prepare the transaction used to register a DIP003 masternode on the network

Prepare a ProRegTx transaction

  • First, we need to get a new, unused address from the wallet to serve as the owner address.
  • This is different to the collateral address.
  • Generate first address (ownerKeyAddr & votingKeyAddr)  as follows:

~/.helpcore/help-cli getnewaddress

output: XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz

  • Generate a second address (payoutAddress) to receive the owner’s masternode payouts.

*it is also possible to use an address external to the wallet

~/.helpcore/help-cli getnewaddress

output: Xsrw9gjGjhFSB2syKp5imZxaVFLWRodGYq

  • Generate a third address (feeSourceAddress) to pay the transaction fee.

~/.helpcore/help-cli getnewaddres

output: XtZHmp9N2jjAjjRdXZXEdEVWVRuUvEjk6Y


Send a small amount (e.g. 1 HELP) to the third address you generated  previously


  • Unlock your wallet for 15 minutes with the previously set password

~/.helpcore/help-cli walletpassphrase yourSecretPassword 900

  • We will now prepare an unsigned ProRegTx special transaction using the protx register_prepare command. This command has the following syntax:

protx register_prepare collateralHash collateralIndex ipAndPort ownerKeyAddr  operatorPubKey votingKeyAddr operatorReward payoutAddress (feeSourceAddress)

  • collateralHash: The txid of the 2500 Help collateral funding transaction
  • collateralIndex: The output index of the 2500 Help funding transaction
  • ipAndPort: Masternode IP address and port, in the format x.x.x.x:yyyy
  • ownerKeyAddr: First address generated above for the owner/voting address
  • operatorPubKey: The BLS public key generated above (or provided by your hosting service)
  • votingKeyAddr: First address generated above
  • operatorReward: Percentage of the block reward allocated to the operator as payment
  • payoutAddress: Second address to receive the owner’s masternode rewards
  • feeSourceAddress: Third address used to fund ProTx fee.

Example (remove line breaks if copying, must be all on a single line):

protx register_prepare

ad308ec104bdf113444be609eb3dce9474a5550424204c6538843e3ccd3d4e78

1

178.62.243.159:7777

XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz

0910777d6dae6ef0ab686e42e81b16602365118593b9d0693197f5ec423362530e71cde402d4be79c6e18fc79e83659c

XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz

0

Xsrw9gjGjhFSB2syKp5imZxaVFLWRodGYq

XtZHmp9N2jjAjjRdXZXEdEVWVRuUvEjk6Y

output: {

"tx": "0300010001784e3dcd3c3e8438654c20240455a57494ce3deb09e64b4413f1bd04c18e30ad0000000000feffffff01cccfa204000000001976a9141ea44ced396667eb7d1c5b3699e04b5b3046ecfb88ac00000000d1010000000000784e3dcd3c3e8438654c20240455a57494ce3deb09e64b4413f1bd04c18e30ad0100000000000000000000000000ffff8c523b33271411c59262c9633a1bb810a7fc2b833c43cfa852ab144cbf4d472716b9504a54c7ca26906a3346253b787ffeb1a4999325049f5b2c51ef2e7c215d85f0a9142ec1c78db99b11c59262c9633a1bb810a7fc2b833c43cfa852ab00001976a91405c5fed6a3eb0b92ea5119039efae7a8dee5456488ac4e6cc5451440a6044dbd04d33a11f4cddc9021532ede3012ebbc31c0bb4ceb9c00",  "collateralAddress": "Xvp6CgKyAEJHZ2CgAVdma9f5145AZrtrRF",  

"signMessage": "Xsrw9gjGjhFSB2syKp5imZxaVFLWRodGYq|0|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|4e00de34ee03d28adb4e1fdaec966ae239c11da7e6115f566fc4b3f75c8a5503"

}

Next we will use the collateralAddress and signMessage fields to sign the transaction, and the output of the tx field to submit the transaction.

Sign the ProRegTx transaction

  • We will now sign the content of the signMessage. The command takes the following syntax:

signmessage address message

Where:

address : is the collateralAddress from the previous output (for example, Xvp6CgKyAEJHZ2CgAVdma9f5145AZrtrRF)

message: is the signMessage from the previous output(for example, "Xsrw9gjGjhFSB2syKp5imZxaVFLWRodGYq|0|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|4e00de34ee03d28adb4e1fdaec966ae239c11da7e6115f566fc4b3f75c8a5503"

signmessage yiFfzbwiN9oneftd7cEfr3kQLRwQ4kp7ue "Xsrw9gjGjhFSB2syKp5imZxaVFLWRodGYq|0|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|XgkncwQj324grvWBmim4YQVBmQ8J9BYtrz|4e00de34ee03d28adb4e1fdaec966ae239c11da7e6115f566fc4b3f75c8a5503"

output: H3ub9BATtvuV+zDGdkUQNoUGpaYFr/O1FypmrSmH5WJ0KFRi8T10FSew0EJO/+Ij+OLv4r0rt+HS9pQFsZgc2dE=

Submit the ProRegTx transaction

  • We will now submit the ProRegTx special transaction to the blockchain to register the masternode. The command takes the following syntax:

protx register_submit tx sig

Where:

  • tx: The output field tx from the protx register_prepare command
  • sig: The output from the  signmessage command

Example:

protx register_submit 0300010001784e3dcd3c3e8438654c20240455a57494ce3deb09e64b4413f1bd04c18e30ad0000000000feffffff01cccfa204000000001976a9141ea44ced396667eb7d1c5b3699e04b5b3046ecfb88ac00000000d1010000000000784e3dcd3c3e8438654c20240455a57494ce3deb09e64b4413f1bd04c18e30ad0100000000000000000000000000ffff8c523b33271411c59262c9633a1bb810a7fc2b833c43cfa852ab144cbf4d472716b9504a54c7ca26906a3346253b787ffeb1a4999325049f5b2c51ef2e7c215d85f0a9142ec1c78db99b11c59262c9633a1bb810a7fc2b833c43cfa852ab00001976a91405c5fed6a3eb0b92ea5119039efae7a8dee5456488ac4e6cc5451440a6044dbd04d33a11f4cddc9021532ede3012ebbc31c0bb4ceb9c00 H3ub9BATtvuV+zDGdkUQNoUGpaYFr/O1FypmrSmH5WJ0KFRi8T10FSew0EJO/+Ij+OLv4r0rt+HS9pQFsZgc2dE=

output: b823338301e47875493c20361a23aef034578030c639480203b394669ab05e09


Congratulations!

  • Your masternode is now registered and will appear on the Deterministic Masternode List after the transaction is mined to a block.
  • You can view this list on the Masternodes -> DIP3 Masternodes tab of the Help Core wallet
  • At this point you can go back to your terminal window and monitor your masternode using :

~/.helpcore/help-cli masternode status


How to start your own Masternode - using the terminal console
Share this

Subscribe to GoHelpFund Blog