375a7a074d
* evm: fix non-determinism * fixes * typo * fix tests * local testnet command * fix testnet cmd (#383) fix export-eth-key generate eth type account in genesis.json file * fixes * update docker * minor changes * fix build-docker-local-ethermint * fix dockerfile * update Makefile * update denoms * update genesis file * update makefile * fix docker-compose.yml images * fix localnet execution (#398) * finish documentation * changelog and comment rpc tests workflow * update codecov * update testnet docs * fix docker-compose execution * update docs * fix errors and make testnet work (#403) * fix errors and make testnet work * Update Dockerfile Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * wip - fix db * fixes emintd nodes and syncs nodes * starts daemon and rpc server in bg Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update entrypoint and docs * update logs * try fix rpc * build docker image * Update Dockerfile Co-authored-by: Holechain <nrgh@foxmail.com> Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com> Co-authored-by: Daniel Choi <choidanielw@gmail.com>
125 lines
5.0 KiB
Markdown
125 lines
5.0 KiB
Markdown
<!--
|
|
order: 4
|
|
-->
|
|
|
|
# Run a Validator
|
|
|
|
Configure a validator node to propose blocks and earn staking rewards {synopsis}
|
|
|
|
## Pre-requisite Readings
|
|
|
|
- [Installation](./installation.md) {prereq}
|
|
- [Run a Full Node](./run_node.md) {prereq}
|
|
|
|
## What is a Validator?
|
|
|
|
[Validators](https://hub.cosmos.network/master/validators/overview.html) are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable or sign blocks at the same height. Please read about [Sentry Node Architecture](https://hub.cosmos.network/master/validators/validator-faq.html#how-can-validators-protect-themselves-from-denial-of-service-attacks) to protect your node from DDOS attacks and to ensure high-availability.
|
|
|
|
::: danger Warning
|
|
If you want to become a validator for `mainnet`, you should [research security](https://hub.cosmos.network/master/validators/security.html).
|
|
:::
|
|
|
|
You may want to skip the next section if you have already set up a [full node](../emint-tutorials/join-mainnet.md).
|
|
|
|
## Create Your Validator
|
|
|
|
Your `cosmosvalconspub` consensus public key fron tendermint can be used to create a new validator by staking tokens. You can find your validator pubkey by running:
|
|
|
|
```bash
|
|
emintd tendermint show-validator
|
|
```
|
|
|
|
To create your validator, just use the following command:
|
|
|
|
```bash
|
|
emintcli tx staking create-validator \
|
|
--amount=1000000photon \
|
|
--pubkey=$(emintd tendermint show-validator) \
|
|
--moniker=<ethermint_validator> \
|
|
--chain-id=<chain_id> \
|
|
--commission-rate="0.10" \
|
|
--commission-max-rate="0.20" \
|
|
--commission-max-change-rate="0.01" \
|
|
--min-self-delegation="1" \
|
|
--gas="auto" \
|
|
--gas-prices="0.025uatom" \
|
|
--from=<key_name>
|
|
```
|
|
|
|
::: tip
|
|
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.
|
|
:::
|
|
|
|
::: tip
|
|
`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1000000photon`
|
|
:::
|
|
|
|
You can confirm that you are in the validator set by using a third party explorer.
|
|
|
|
## Genesis Transactions
|
|
|
|
A genesis transaction (aka `gentx`) is a JSON file carrying a self-delegation from a validator. All genesis transactions are collected by a genesis coordinator and validated against an initial `genesis.json` file.
|
|
|
|
A `gentx` does three things:
|
|
|
|
1. Makes the `validator` account you created into a validator operator account (i.e. the account that controls the validator).
|
|
2. Self-delegates the provided `amount` of staking tokens.
|
|
3. Link the operator account with a Tendermint node pubkey that will be used for signing blocks. If no `--pubkey` flag is provided, it defaults to the local node pubkey created via the `emintd init` command above.
|
|
|
|
If you want to participate in genesis as a validator, you need to justify that
|
|
you have some stake at genesis, create one (or multiple) transactions to bond this stake to your validator address, and include this transaction in the genesis file.
|
|
|
|
Your `cosmosvalconspub`, as shown on the section above, can be used to create a validator transaction on genesis as well.
|
|
|
|
Next, craft your `emintd gentx` command:
|
|
|
|
::: tip
|
|
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.
|
|
:::
|
|
|
|
```bash
|
|
emintd gentx \
|
|
--amount <amount_of_delegation_uatom> \
|
|
--commission-rate <commission_rate> \
|
|
--commission-max-rate <commission_max_rate> \
|
|
--commission-max-change-rate <commission_max_change_rate> \
|
|
--pubkey $(emintd tendermint show-validator) \
|
|
--name $KEY
|
|
```
|
|
|
|
::: tip
|
|
For more on `gentx`, use the help flag: `emintd gentx -h`
|
|
:::
|
|
|
|
## Confirm Your Validator is Running
|
|
|
|
Your validator is active if the following command returns anything:
|
|
|
|
```bash
|
|
emintcli query tendermint-validator-set | grep "$(emintd tendermint show-validator)"
|
|
```
|
|
|
|
You should now see your validator in one of the block explorers. You are looking for the `bech32`
|
|
encoded `address` in the `~/.emintd/config/priv_validator.json` file.
|
|
|
|
::: tip
|
|
To be in the validator set, you need to have more total voting power than the 100th validator.
|
|
:::
|
|
|
|
## Halt Your Validator Node
|
|
|
|
When attempting to perform routine maintenance or planning for an upcoming coordinated
|
|
upgrade, it can be useful to have your validator systematically and gracefully halt the chain and shutdown the node.
|
|
|
|
You can achieve this by setting one of the following flags during when using the `emintd start` command:
|
|
|
|
- `--halt-height`: to the block height at which to shutdown the node
|
|
- `--halt-time`: to the minimum block time (in Unix seconds) at which to shutdown the node
|
|
|
|
The node will stop processing blocks with a zero exit code at that given height/time after
|
|
committing the block.
|
|
|
|
## Next {hide}
|
|
|
|
Start and connect a [client](./clients.md) to a running network {hide}
|