This guide will explain how to install the pundixd command line interface (CLI) on your system with Binaries option. With these installed on a server, you can participate on the mainnet or testnet as a Validator.
Initializing pundixd will result in the creation of a few directories and most importantly the .pundix directory (for more information on the directory tree, refer to the validator-recovery section). This will be where your validator keys are stored and this is important for recovery of your validator.
Fetching genesis file (copy this entire line of code and hit ENTER):
IMPORTANT At this stage BEFORE starting the node, please download the latest snapshot, refer to this link.
Additionally, what is important is that your validator keys that is stored in a .json file for you to do a recovery in the future. For more information how to access the files.
The execution of the previous command will return something like this (this is to check the status of nodes and which blocks are being synced/are syncing):
6:08PMINFindexedblockheight=3698module=txindexserver=node6:08PMINFTimedoutdur=945.515height=3699module=consensusround=0server=nodestep=16:08PM INF received proposal module=consensus proposal={"Type":32,"block_id":{"hash":"51E98FF8FB0F6F5D4A37BEDFFDB37F849657A19D786FD89E0521A8BBFAD54733","parts":{"hash":"5108094CA9248288944168931AE1B5D9BF87EB253DEDECA60982EE2FDF253265","total":1}},"height":3699,"pol_round":-1,"round":0,"signature":"/77Seq+zrpzpjoUIofqB2/+xCRDKcUf0ekW3dXGjlgn8nWqkbfxuuS2XUhU5p2FxSEbs436f5vwOlVRJK+dHAw==","timestamp":"2022-08-25T10:08:40.924827Z"} server=node
6:08PMINFreceivedcompleteproposalblockhash=51E98FF8FB0F6F5D4A37BEDFFDB37F849657A19D786FD89E0521A8BBFAD54733height=3699module=consensusserver=node6:08PMINFfinalizingcommitofblockhash={}height=3699module=consensusnum_txs=0root=739ACDF1321A8A3DFACDD78CA62C056C1463DCF80C840439BD6242EDEFF3682Fserver=node6:08PMINFmintedcoinsfrommoduleaccountamount=4753287822151504pursefrom=mintmodule=x/bank6:08PMINFexecutedblockheight=3699module=statenum_invalid_txs=0num_valid_txs=0server=node6:08PMINFcommitsyncedcommit=436F6D6D697449447B5B313537203134322036203838203139352031383720323431203131332031383220313332203232352031333420313935203633203330203733203136362032372035312032313620363420353220323133203132382031353420383020313933203132392031303220313520313930203233305D3A4537337D6:08PMINFcommittedstateapp_hash=9D8E0658C3BBF171B684E186C33F1E49A61B33D84034D5809A50C181660FBEE6height=3699module=statenum_txs=0server=node6:08PMINFindexedblockheight=3699module=txindexserver=node
To ensure that the blocks are synced up with your node, under "sync_info", "catching_up value" should be false "catching_up value": false. This may take a few hours and your node has to be fully synced up before proceeding to the next step. You may cross reference the latest block you are synced to "sync_info": "latest_block_height" and the latest block height of our Testnet blockchain on our Testnet blockchain explorer or our Mainnet.
Stop Node (will be running in the background if not stopped):
ps-ef|greppundixdkill-9PID
Running Server
It is important to keep pundixd running at all times. There are several ways to achieve this, and the simplest solution we recommend is to register pundixd as a systemd service so that it will automatically get started upon system reboots and other events.
Register pundixd as a service
First, create a service definition file in /etc/systemd/system.
Run this command to create the sample file above in the file path/etc/systemd/system/pundixd.service (if you are in the pundix directory):
cat>/etc/systemd/system/pundixd.service
hit the ENTER button on your keyboard and copy and paste the contents of the file below into the command line:
Then hit the ENTER button on your keyboard before using Ctrl+D on your keyboard, your file with the above contents will be created. It should look like this:
run the command:which pundixd and replace the ExecStart file path with the return value of the command
Modify the Service section from the given sample above to suit your settings. Note that even if we raised the number of open files for a process, we still need to include LimitNOFILE.
After creating a service definition file, you should execute:
systemctldaemon-reloadsystemctlenablepundixd
Controlling the service
Use systemctl to control (start, stop, restart) in Linux/Ubuntu:
To start the node, run sudo systemctl start pundixd, and thereafter run journalctl -u pundixd -n 100 -f to see the latest and continuous logs.
Accessing logs
# entire logjournalctl-upundixd-n100# entire log reversedjournalctl-upundixd-r# latest and continuous logjournalctl-upundixd-n100-f
Concluding tips: It is always better to sync PundiX using the Daemon method because this ensures stability and that your syncing is continuously running in the background.
Secret and updating consensus key
Use this at your own risk❗ I suggest trying it out on testnet first and also backing up your priv_validator_key.json if you already have this set up for a validator. The file can be found in this file path ~/.pundix/config/priv_validator_key.json.
Updating your consensus key and tagging it to a pin
Before setting up your validator if you would like to have a backup of your keys with a pin. You may run the following command:
After inputting y, your priv_validator_key.json will be replaced with a new file. This means you will have a new consensus private key and it will be tagged to your <secret> pin.
Checking to see if the pin works
If your .pundix folder is in the root directory
cat~/.pundix/config/priv_validator_key.json
Record the previous output before running the next command!
Remove this file:
rm~/.pundix/config/priv_validator_key.json
The following command will recover your original consensus key: