Skip to main content

Create a Core Validator

Once your account is funded, you can run various commands inside your Hedge Node Docker container to stake and start validating.

Confirm Node Synchronization

Verify that your node has finished synching and it is caught up with the network

# Wait until you see the output: "false"
hedged status 2>&1 | jq .SyncInfo.catching_up

Verify Account Funds

Verify that your account has funds in it in order to perform staking

# Make sure you can see your account name in the keys list
hedged keys list

# Make sure you see your account has HDE tokens in it
hedged query bank balances $(hedged keys show -a <key_name>)

Backup Validator's Consensus Key

A validator participates in the consensus by sending a message signed by a consensus key which is automatically generated when you first run a node. You must create a backup of this consensus key in case that you migrate your validator to another server or accidentally lose access to your validator.

A consensus key is stored as a json file in $hedged_home_folder/config/priv_validator_key.json by default, or a custom path specified in the parameter priv_validator_key_file of config.toml.

Stake and Start Validating

Ensure you have a small amount of HDE tokens on the wallet address you are using on your keyring in order to successfully send a transaction. Once you have have a balance on the address on your keyring, you can now send the create-validator transaction.

Here is the empty command:

hedged tx staking create-validator \
--from=<key_name> \
--amount=<staking_amount_uhedge> \
--pubkey=$(hedged tendermint show-validator --home ./hedge/berberis-1) \
--moniker="<moniker_id_of_your_node>" \
--security-contact="<security contact email/contact method>" \
--chain-id=<chain_id> \
--commission-rate="<commission_rate>" \
--commission-max-rate="<maximum_commission_rate>" \
--commission-max-change-rate="<maximum_rate_of_change_of_commission>" \
--min-self-delegation="<min_self_delegation_amount>" \
--gas=auto \
--gas-adjustment=<gas_adjustment> \
--gas-prices="<gas_price>" \
--node-id=$(curl localhost:26657/status| jq -r .result.node_info.id)

Here's an example with values which starts with a stake of 1000000000uhedge.

hedged tx staking create-validator \
--from=wallet \
--amount=1000000000uhedge \
--pubkey=$(hedged tendermint show-validator --home ./hedge/berberis-1) \
--moniker="new_validator" \
--security-contact="validator_mail@yourdomain.com" \
--chain-id=berberis-1 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation=1 \
--gas=auto \
--gas-adjustment=1.5 \
--gas-prices="0.025uhedge" \
--node-id=$(curl localhost:26657/status| jq -r .result.node_info.id)
  • from is the key_name you created when initializing the key on your keyring
  • amount is the amount of tokens to be bonded
  • pubkey is the validator public key found earlier
  • moniker is a human readable name you choose for your validator
  • chain-id is whatever chain-id you are working with (in the hedge testnet case it is berberis-1)
  • commission-rate is the commission rate on block rewards and fees charged to delegators
  • commission-max-rate is the maximum commission rate that this validator can charge. This parameter is fixed and cannot be changed after the validator is created
  • commission-max-change-rate is the maximum daily increase of the validator commission rate. This parameter is fixed cannot be changed after the validator is created(in the example above, 1 percent per day until reaching the max rate)
  • min-self-delegation is the minimum amount of HDE the validator requires to have bonded at all time. If the validator's self-delegated stake falls below this limit, the validator gets jailed and kicked out of the active validator set
  • gas-prices is the amount of gas used to send this create-validator transaction
  • When specifying commission parameters, the commission-max-change-rate is used to measure % point change over the commission-rate. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point

The terminal will ask you to confirm the transaction:

gas estimate: 234463
auth_info:
fee:
amount:
- amount: "5862"
denom: uhedge
gas_limit: "234463"
granter: ""
payer: ""
signer_infos: []
tip: null
body:
extension_options: []
memo: ""
messages:
- '@type': /cosmos.staking.v1beta1.MsgCreateValidator
commission:
max_change_rate: "0.010000000000000000"
max_rate: "0.200000000000000000"
rate: "0.100000000000000000"
delegator_address: hedge14ryuk7c3ul894cqfekfzawlm928cvh4emek5m0
description:
details: ""
identity: ""
moniker: new_validator
security_contact: validator_mail@yourdomain.com
website: ""
min_self_delegation: "1"
pubkey:
'@type': /cosmos.crypto.ed25519.PubKey
key: ghjWS2G3csB0W7Bj83uAsRUVBUuey328nUY9430YhYg=
validator_address: hedgevaloper14ryuk7c3ul894cqfekfzawlm928cvh4ehsxq7d
value:
amount: "999990000"
denom: uhedge
non_critical_extension_options: []
timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y

Type y and press Enter to confirm.

code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 7C1D69F6BE1A1836452F95D6CB0D695EA878D2AE22EA0CE7AFBB1CAE6934673D

Once you have finished running the command above, if you see code: 0 in the output, the command was successful.