|
| 1 | +--- |
| 2 | +title: Step 2) Setup a Validator Account |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +Before creating a validator account, make sure you are running a Sentry node with the chain synced to the latest block as specified in this [step](./run-a-sentry-node). |
| 7 | + |
| 8 | + |
| 9 | +### Setup validator |
| 10 | + |
| 11 | +1. Create validator account |
| 12 | + |
| 13 | + ```bash |
| 14 | + export VALIDATOR_KEY_NAME="my-validator-name" |
| 15 | + routerd keys add $VALIDATOR_KEY_NAME --chain-id router_9600-1 --keyring-backend file |
| 16 | + ``` |
| 17 | + |
| 18 | +2. Copy routerd address |
| 19 | + |
| 20 | + ```bash |
| 21 | + routerd keys show $VALIDATOR_KEY_NAME -a --keyring-backend file |
| 22 | + export VALIDATOR_ADDRESS=<routerd-address> |
| 23 | + ``` |
| 24 | + |
| 25 | +3. Fund routerd address with some $ROUTE tokens and check balance |
| 26 | + |
| 27 | + ```bash |
| 28 | + routerd q bank balances $VALIDATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file |
| 29 | + ``` |
| 30 | + |
| 31 | +4. Create validator: Initialize new validator with self delegation of $ROUTE tokens. |
| 32 | + |
| 33 | + ```bash |
| 34 | + export VALIDATOR_MONIKER="my-validator-moniker" |
| 35 | + |
| 36 | + routerd tx staking create-validator \ |
| 37 | + --amount=1000000000000000000route \ |
| 38 | + --pubkey=$(routerd tendermint show-validator) \ |
| 39 | + --moniker=$VALIDATOR_MONIKER \ |
| 40 | + --chain-id=router_9600-1 \ |
| 41 | + --commission-rate="0.10" \ |
| 42 | + --commission-max-rate="0.20" \ |
| 43 | + --commission-max-change-rate="0.01" \ |
| 44 | + --min-self-delegation="1000000" \ |
| 45 | + --gas="auto" \ |
| 46 | + --fees="100000000000000route" \ |
| 47 | + --from=$VALIDATOR_KEY_NAME \ |
| 48 | + --gas-adjustment=1.5 \ |
| 49 | + --keyring-backend=file |
| 50 | + ``` |
| 51 | + |
| 52 | +- `amount` flag is the initial amount of ROUTE you're willing to bond |
| 53 | +- `pubkey` is the validator public key created earlier |
| 54 | +- `moniker` is the human readable name you choose for your validator |
| 55 | +- `chain-id` is the network id of the chain you are working with (in the case of Router mainnet: `router_9600-1`) |
| 56 | +- `commission-rate` is the initial commission rate you will charge your delegates |
| 57 | +- `commission-max-rate` is the highest rate you are allowed to charge your delegates |
| 58 | +- `commission-max-change-rate` is how much you can increase your commission rate in a 24 hour period |
| 59 | +- `min-self-delegation` is the lowest amount of personal funds the validator is required to have in their validator to stay bonded |
| 60 | +- `from` flag is the KEY_NAME you created while initializing the key on your keyring |
| 61 | + |
| 62 | +5. Verify validator status |
| 63 | + |
| 64 | + ```bash |
| 65 | + routerd q staking validator $VALIDATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file |
| 66 | + ``` |
| 67 | + |
| 68 | +If you see your validator in the list of validators, then congratulations, you have officially joined the Router mainnet as a staking validator! 🎉 |
| 69 | + |
| 70 | + |
| 71 | +After setting up the validator, immediately proceed to setup the orchestrator. This is a necessary step in order to prevent the validator from being slashed. |
| 72 | + |
| 73 | + |
| 74 | +### Setup Orchestrator |
| 75 | + |
| 76 | +1. Create orchestrator account |
| 77 | + |
| 78 | + ```bash |
| 79 | + export ORCHESTRATOR_KEY_NAME="my-orchestrator-name" |
| 80 | + routerd keys add $ORCHESTRATOR_KEY_NAME --chain-id router_9600-1 --keyring-backend file |
| 81 | + ``` |
| 82 | + |
| 83 | + get Orchestrator address |
| 84 | + |
| 85 | + ```bash |
| 86 | + routerd keys show $ORCHESTRATOR_KEY_NAME -a --keyring-backend file |
| 87 | + export ORCHESTRATOR_ADDRESS=<routerd-address> |
| 88 | + ``` |
| 89 | + |
| 90 | +2. Get funds to orchestrator account, check balance after getting funds |
| 91 | + |
| 92 | + ```bash |
| 93 | + routerd q bank balances $ORCHESTRATOR_ADDRESS --chain-id router_9600-1 --keyring-backend file |
| 94 | + ``` |
| 95 | + |
| 96 | +3. Map orchestrator address to validator address. |
| 97 | + |
| 98 | + `EVM-KEY-FOR-SIGNING-TXNS` is the public ethereum address. You can create one in Metamask, it doesnt need to have funds. We use it to sign transactions on EVM chains. Make sure to save the private key of this address somewhere safe. |
| 99 | + |
| 100 | + ```bash |
| 101 | + export EVM_ADDRESS_FOR_SIGNING_TXNS=<EVM-ADDRESS-FOR-SIGNING-TXNS> |
| 102 | + routerd tx attestation set-orchestrator-address $ORCHESTRATOR_ADDRESS $EVM_ADDRESS_FOR_SIGNING_TXNS --from my-validator-key \ |
| 103 | + --chain-id router_9600-1 \ |
| 104 | + --fees 1000000000000000route \ |
| 105 | + --keyring-backend file |
| 106 | + ``` |
| 107 | + |
| 108 | +### Add config.json for Orchestrator |
| 109 | + |
| 110 | + ```json |
| 111 | + { |
| 112 | + "chains": [ |
| 113 | + { |
| 114 | + "chainId": "137", |
| 115 | + "chainType": "CHAIN_TYPE_EVM", |
| 116 | + "chainName": "Polygon", |
| 117 | + "chainRpc": "www.polygon-rpc.com", |
| 118 | + "blocksToSearch": 1000, |
| 119 | + "blockTime": "5s" |
| 120 | + } |
| 121 | + ], |
| 122 | + "globalConfig": { |
| 123 | + "logLevel": "debug", |
| 124 | + "networkType": "mainnet", |
| 125 | + "dbPath": "orchestrator.db", |
| 126 | + "batchSize": 25, |
| 127 | + "batchWaitTime": 4, |
| 128 | + "routerChainTmRpc": "http://0.0.0.0:26657", |
| 129 | + "routerChainGRpc": "tcp://0.0.0.0:9090", |
| 130 | + "evmAddress": "", |
| 131 | + "cosmosAddress": "", |
| 132 | + "ethPrivateKey": "", |
| 133 | + "cosmosPrivateKey": "" |
| 134 | + } |
| 135 | + } |
| 136 | + ``` |
| 137 | + |
| 138 | +- `routerChainTmRpc` and `routerChainGRpc`, point it to your validator IP |
| 139 | +- `cosmosAddress` is Router address of orchestrator // router5678abcd |
| 140 | +- `cosmosPrivateKey` is private key for your orchestrator cosmos address (private key of above `cosmosAddress`) |
| 141 | +- `evmAddress` is EVM address of orchestrator which created in above step in Metamask //0x1234abcd |
| 142 | +- `ethPrivateKey` is private key for the the above `evmAddress` wallet you created |
| 143 | +- `loglevel` currently kept it as "debug" can be set as "info" evmAddress is EVM address of orchestrator //0x1234abcd |
| 144 | + |
| 145 | +### Start Validator and Orchestrator |
| 146 | + |
| 147 | +1. Start validator |
| 148 | + |
| 149 | + ```bash |
| 150 | + sudo systemctl start cosmovisor.service |
| 151 | + sudo systemctl status cosmovisor.service |
| 152 | + |
| 153 | + # check logs |
| 154 | + journalctl -u cosmovisor -f |
| 155 | + ``` |
| 156 | + |
| 157 | +2. Start orchestrator |
| 158 | + |
| 159 | + ```bash |
| 160 | + sudo systemctl start orchestrator.service |
| 161 | + sudo systemctl status orchestrator.service |
| 162 | + |
| 163 | + # check logs |
| 164 | + journalctl -u orchestrator -f |
| 165 | + ``` |
| 166 | + |
| 167 | +### Check validator and orchestrator status |
| 168 | + |
| 169 | +1. Check if node is syncing, make sure it is not stuck at some block height |
| 170 | + |
| 171 | + ```bash |
| 172 | + routerd status | jq .SyncInfo.latest_block_height |
| 173 | + ``` |
| 174 | + |
| 175 | +2. Check if orchestrator health is ok |
| 176 | + |
| 177 | + ```bash |
| 178 | + curl localhost:8001/health |
| 179 | + ``` |
0 commit comments