Run a Validator

The codebase of the validator is NOT public at this moment. Details regarding the validator role will be released later on. Please stay tuned and thanks for your attention.


By following these steps, you should be able to successfully set up and start a Nubit Validator. If you encounter any issues, please provide detailed information, and further assistance will be provided.

Install the Validator

Download multiple repositories from the RiemaLabs GitHub into the nubit-da directory.

Note: When using git clone, you may need to temporarily comment out the UseKeychain fields in your ~/.ssh/config file. Specifically, comment out # IgnoreUnknown UseKeychain and # UseKeychain yes .

git clone git@github.com:RiemaLabs/nubit-validator.git
cd nubit-validator

In the cloned repository directory, run the following command to install the nubit-validator CLI:

make install

Initialize the Validator

Set the environment variable and initialize the validator with the following commands:

Note: You can customize the VALIDATOR_NAME as desired.

export NUBIT_VALIDATOR_HOME="$HOME/.nubit-validator"
echo $NUBIT_VALIDATOR_HOME
rm -rf $NUBIT_VALIDATOR_HOME
VALIDATOR_NAME=nubit  # Replace VALIDATOR_NAME with your desired one
CHAIN_ID=nubit-alphatestnet-1
nubit-validatord init $VALIDATOR_NAME --chain-id $CHAIN_ID

This command will create the necessary configuration files and directories, including .nubit-validator/config/ with an initial genesis.json file.

Setup the Validator

Replace the genesis.json File

Please contact Nubit team get the genesis.json file for Nubit DA Alpha Testnet. To replace the initial genesis.json file with the new one which suits the Nubit DA Alpha Testnet, please save this new genesis.json file to your home directory (or any other temporary location) and then use the following command to replace the initial genesis.json file:

cp ~/genesis.json $NUBIT_VALIDATOR_HOME/config/genesis.json # Replace ~/genesis.json with the actual file location

Modify the config.toml File

Edit the config.toml file to change the indexer setting:

sed -i'.bak' -e 's#indexer = "null"#indexer = "kv"#g' "${NUBIT_VALIDATOR_HOME}/config/config.toml"

Create and List Keys

Create a new wallet key and list all keys with the following commands:

nubit-validatord keys add my-wallet --keyring-backend test
nubit-validatord keys list

Note: A new nubit address named my_wallet will be automatically created along with its MNEMONIC. Please make sure to save the MNEMONIC as it will only appear once securely.

Set Environment Variables

Set the necessary environment variables by the following commands:

export PATH=$HOME/go/bin:$PATH
export PERSISTENT_PEERS=900a00a618f20a2e4867b26585b15108c728b523@35.82.227.214:26656,e0cf2c93177eae5cf0bb360710725aee34a44732@35.82.227.214:26656

Start the Validator

Start the validator by the following command:

nubit-validatord start --btc-rpc string --rpc.laddr tcp://0.0.0.0:26657 --grpc.address 0.0.0.0:9090 --grpc.enable --p2p.persistent_peers=$PERSISTENT_PEERS

The successful response will be like this:

6:20PM INF service start impl="Peer{MConn{44.236.43.189:26656} 97d2260cb63873183943e331c6986ce4a63d8796 out}" module=p2p msg={} peer={"id":"97d2260cb63873183943e331c6986ce4a63d8796","ip":"44.236.43.189","port":26656}
6:20PM INF service start impl=MConn{44.236.43.189:26656} module=p2p msg={} peer={"id":"97d2260cb63873183943e331c6986ce4a63d8796","ip":"44.236.43.189","port":26656}
6:20PM INF service start impl="Peer{MConn{35.82.227.214:26656} 77862897002df6adb65b81b64319116423186ccf out}" module=p2p msg={} peer={"id":"77862897002df6adb65b81b64319116423186ccf","ip":"35.82.227.214","port":26656}
6:20PM INF service start impl=MConn{35.82.227.214:26656} module=p2p msg={} peer={"id":"77862897002df6adb65b81b64319116423186ccf","ip":"35.82.227.214","port":26656}
6:20PM INF app: start Process Proposal height=1 proposer=40F0D18D0454EF72DADBE564962E88EFEC3C148E
6:20PM INF executed block height=1 module=state num_invalid_txs=1 num_valid_txs=0
6:20PM INF committed state app_hash=098724484DBF0E9BB9208D467B65541C6310A2ACF5A78C03A5D2175D9D79FC85 height=1 module=state num_txs=1
6:20PM INF app: start Process Proposal height=2 proposer=83592AD6A18494E38970AC673E150A986B717C35
6:20PM INF indexed block exents height=1 module=txindex
6:20PM INF minted coins from module account amount=350587034956unub from=mint module=x/bank
6:20PM INF executed block height=2 module=state num_invalid_txs=1 num_valid_txs=0
6:20PM INF committed state app_hash=5D57E8E05952DB21CFCB85B40902ED3D170DE358D6901961AF6FEC2A54EC15D5 height=2 module=state num_txs=1
6:20PM INF app: start Process Proposal height=3 proposer=9D40034936981454FC48AA642304E6A7A69D0D20
6:20PM INF indexed block exents height=2 module=txindex
6:20PM INF minted coins from module account amount=2963430686unub from=mint module=x/bank
6:20PM INF executed block height=3 module=state num_invalid_txs=1 num_valid_txs=0
6:20PM INF committed state app_hash=A6AA34EE9BF40674B655BAB3B12379D33C12D3AFADA911371F7596A81E91CB2F height=3 module=state num_txs=1
6:20PM INF indexed block exents height=3 module=txindex

This response indicates that the validator is running successfully. It shows the continuous process of validating and committing blocks, minting coins, and processing transactions.

When running the validator node, you can check your validator's status information using the following command:

nubit-validatord status

You will receive a response similar to this:

{"NodeInfo":{"protocol_version":{"p2p":"8","block":"11","app":"1"},"id":"267c410998e06deba2120d71b4bf4c3e7b5acac3","listen_addr":"tcp://0.0.0.0:26656","network":"nubit-alphatestnet-1","version":"0.1.0-rc.3-3-ga44d441","channels":"40202122233038606100","moniker":"nubit","other":{"tx_index":"on","rpc_address":"tcp://0.0.0.0:26657"}},"SyncInfo":{"latest_block_hash":"11405BDB419AA56ADF8DB5EBB08728B255AB3BBB7E9164509978F46F6E93A0FD","latest_app_hash":"87C98B85491EF2C420B8173F72F2005273BF8FE5A77EB4FFE6F22DA13AC5A02E","latest_block_height":"110","latest_block_time":"2024-05-25T03:34:06.867431548Z","earliest_block_hash":"AD1DB79213CA0EA005F82FACC395E34BE3CFCC086CD5C25A89FC64F871B3ABAE","earliest_app_hash":"E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855","earliest_block_height":"1","earliest_block_time":"2024-05-25T02:50:05.683274808Z","catching_up":true},"ValidatorInfo":{"Address":"D6B68AC72423C273EC637FF437A8E955831FA696","PubKey":{"type":"tendermint/PubKeyEd25519","value":"tZ5BS22CO/cwNr5ZY9Qy91RK+wAkmsUm2bE/dmMk1N8="},"VotingPower":"0"}}

Last updated