github.com/Tri-stone/burrow@v0.25.0/docs/quickstart/add-validators.md (about) 1 # Add Validator 2 3 For this example, make sure you have the latest `burrow` binary and JSON parsing tool `jq` installed. 4 5 First, let's start a network with two running validators: 6 7 ```bash 8 burrow spec -f2 | burrow configure -s- --pool --separate-genesis-doc=genesis.json 9 burrow start --config=burrow000.toml & 10 burrow start --config=burrow001.toml & 11 ``` 12 13 Next, fetch a persistent peer and the validator address of the first node: 14 15 ```bash 16 PERSISTENT_PEER=$(cat burrow000.toml | grep PersistentPeers | cut -d \" -f2) 17 OLD_VALIDATOR=$(cat burrow000.toml | grep ValidatorAddress | cut -d \" -f2) 18 ``` 19 20 Let's generate the config and keys for a new validator account. As this node will be joining an existing network we won't need the GenesisDoc, but we will need to give it the persistent peer address we obtained above. Unless you want to do these steps manually, please use the following commands: 21 22 ```bash 23 burrow spec -v1 | burrow configure -s- --json > burrow-new.json 24 NEW_VALIDATOR=$(jq -r '.GenesisDoc.Accounts[0].PublicKey.PublicKey' burrow-new.json) 25 jq 'del(.GenesisDoc)' burrow-new.json | jq ".Tendermint.PersistentPeers=\"$PERSISTENT_PEER\"" | jq '.RPC.Info.Enabled=false' | jq '.RPC.GRPC.Enabled=false' | jq '.Tendermint.ListenAddress="tcp://0.0.0.0:25565"' > burrow003.json 26 ``` 27 28 Copy the following script into `deploy.yaml`: 29 30 ```yaml 31 jobs: 32 - name: InitialTotalPower 33 query-vals: 34 field: "Set.TotalPower" 35 36 - name: AddValidator 37 update-account: 38 target: NEW_VALIDATOR 39 power: 232322 40 41 - name: CheckAdded 42 query-vals: 43 field: "Set.${AddValidator.address}.Power" 44 45 - name: AssertPowerNonZero 46 assert: 47 key: $CheckAdded 48 relation: gt 49 val: 0 50 51 - name: AssertPowerEqual 52 assert: 53 key: $CheckAdded 54 relation: eq 55 val: $AddValidator.power 56 ``` 57 58 If you haven't already, swap in the public key for your new validator and run the deployment to give the account stake: 59 60 ```bash 61 sed -i "s/NEW_VALIDATOR/$NEW_VALIDATOR/" deploy.yaml 62 burrow deploy -u 127.0.0.1:10997 --mempool-signing=true --address=$OLD_VALIDATOR deploy.yaml 63 ``` 64 65 If this returns successfully, you'll be able to see that the new validator is now in the running set: 66 67 ```bash 68 curl -s 127.0.0.1:26758/consensus 69 ``` 70 71 Let's start the new validator and watch it catch up: 72 73 ```bash 74 burrow start --config=burrow003.json --genesis=genesis.json 75 ```