Before you can generate a transaction to declare a validator, you need an account that will sign the transaction on the console client. This requires either creating a new account with a randomly generated mnemonic and the name ACCOUNT_NAME, with the command
deccli keys add ACCOUNT_NAME
, for example
deccli keys add node-owner
, or restoring an account with the name ACCOUNT_NAME from an existing mnemonic, with the command
deccli keys add ACCOUNT_NAME --recover
, for example
deccli keys add node-owner --recover
In order to form a transaction on declaring the validator to the genesis file, execute the following command on the console client:
decd gen-declare-candidate-tx
, as a result of its execution the signed transaction is formed in the form of JSON object, which will be further included in the genesis.json file.
Several flags are required in the command:
decd gen-declare-candidate-tx \ --sequence 0 \ --chain-id "decimal-mainnet-07-23-20-55" \ --amount "1500000000000000000000000del" \ --pubkey "dxvalconspub1zcjduepqny2jlxtkpy5cuudu79lkjfqrmaseqdkd7njdt0a4n8zflg57jflsg60x9h" \ --commission-rate "0.1275" \ --reward-addr "dx1mtlnpmwf8zr6pek6gq25nv45x2890sne2ap0cc" \ --moniker "My local test validator" \ --website "myvalidator.com" \ --identity "6A0D65E29A4CBC8E" \ --security-contact "email: [email protected]" \ --details "The best validator ever" \ --node-id "$(decd tendermint show-node-id)" \ --name node-owner \
where :
- sequence - always equals 0
- chain-id - current chain-id identifier of the test or production network
- amount - validator stake in the appropriate format, in this case the stake is 1,500,000 DEL
- pubkey - here is the public key of your deployed node. Use 'decd tendermint show-validator' command in order to figure it out.
- commission-rate - the amount of commission that the validator takes from the reward of the coins delegated to it, in this case the commission is 12,75%
- reward-addr - the address the validator's reward will be deposited to. If this line is missing or the address is not specified, the reward will be sent to the address the validator was declared
- moniker - the validator's name to be displayed on Decimal services
- website - validator's website, optional
- identity - the validator identifier on Keybase or UPort systems to display the avatar, for example, for Keybase it is a string of 16 characters
- security-contact - security contact details
- details - additional text description of the validator, optional
- node-id - the deployed node ID. If the declaration is made directly from the declared node, you can find it directly in the file node_info.json or use the command - decd tendermint show-node-id. If the declaration is performed from another node, you should find the identifier of the node in the file of the declared node
- name - name of the account that signs the transaction. We created/restored it before with the command
deccli keys add
.
The result of the execution of the command will look like this (adjusted for actual data):
{ "type": "cosmos-sdk/StdTx", "value": { "msg": [ { "type": "validator/declare_candidate", "value": { "commission": "0.127500000000000000", "validator_addr": "dxvaloper1tvqxh4x7pedyqpzqp9tdf068k4q9j2hmddu9z5", "reward_addr": "dx1mtlnpmwf8zr6pek6gq25nv45x2890sne2ap0cc", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "mRUvmXYJKY5xvPF/aSQD32GQNs305NW/tZnEn6Kekn8=" }, "stake": { "denom": "del", "amount": "1500000000000000000000000" }, "description": { "moniker": "My local test validator", "identity": "6A0D65E29A4CBC8E", "website": "myvalidator.com", "security_contact": "email: [email protected]", "details": "The best validator ever" } } } ], "fee": { "amount": [], "gas": "200000" }, "signatures": [ { "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "At2s2CHimonx45uDImfnbTI6Xo2qZJ/Tye0+AioQ38uO" }, "signature": "xRROS9sw3IaDdfcrOQtXzEh17thcGoZkZ6DsSZecgekexNXiVOJvPpbnzVAuMP6De3WxJxoKrW+pbBRbz3LFFg==" } ], } }