I have a launched a Rococo staging style relay chain testnet.
I am currently the sudo and I would like to go through the process of inviting other people to become validators.
What steps do I need to take to do this?
This post will guide you through the stage where you have a rococo style relay chain and you want other validators to connect with you. Here we will show you how you can add new validators to your set. We will be using a substrate relay rococo style relay chain with a partner (which uses babe), but this will still be useful for aura.
This post assumes you understand how to create your chain-spec.json correctly, and can launch a chain (in our case a “Live” staging relay chain) that can produce and finalize blocks.
This guide will take you through 3 steps: Launch validators; Register new validators; then Rotate Keys.
The todo list:
Let's begin…
Assuming you have the sudo account, launch your validators and submit your babe and grandpa keys.
Make sure nodes are peering, and do that through - bootnodes
tag.
Example of a validator command:
./target/release/polkadot \
-- validator \
-- base-path /tmp/relay/MyVal1 \ specify your db path
-- chain ./specs/<INSERT-CHAIN-SPEC.JSON> \
-- port 30333 \
-- ws-port 9944 \
-- rpc-port 9933 \
-- rpc-methods=Unsafe \
-- name MyVal01 \
-- bootnodes /ip4/<INSERT A BOOTNODE TO LAUNCH VALIDATOR> \
-- telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' \
-- node-key <INSERT-KEY> optional
Make sure your nodes are producing blocks and finalizing, if they are not, restart nodes, and add keys again, (or use the author_hasKey RPC method to check they have the correct keys).
Send the validator owner some funds to their account so they can add existential deposits to the (stash) AccountIds of their validators.
##Get list of the new validator AccountIds Ask the new validator owner to send you the validator AccountId’s, so you can make a sudo call to register validators.
AccountId’s are the first two address above grandpa You can can connect to the UI (if you have a RPC node running) to make this extrinsic call.
sudo > validatorManager > registerValidators(validators)
You can do more than one at a time (as shown below)
Now they are registered you (and your partner) can “rotate keys”, so that new keys are generated and populated in all the session key fields for your validators. Submitting calls via RPC can be long winded, so a neat trick is to submit the BABE and GRANDPA so the chain produces and finalizes blocks, then you can run author_rotateKeys for each of your validators, which will then generate all your other keys automatically.
curl -H ‘Content-Type: application/json’ — data ‘{ “jsonrpc”:”2.0", “method”:”author_rotateKeys”, “id”:1 }’ http://127.0.0.1:9933
Make the RPC call in the terminal of your where your validator’s node is located, which should look like this:
The screenshot shows the returned result of 3 author_rotateKeys calls for my 3 validators. If you have one validator you only need to make the call once.
Once you have generated the returned hex result, you need to submit them as an extrinsic for all the validators you’ve done that for. You can use the extrinsics section of the UI for this:
session > setKeys(keys, proof)
Wait for an epoch to see the changes, and other validators.
this workflow is complete. You can view it as medium post here.