How to add new validators to your live (blockchain) testnet?

This post will guide you through the stage where you want to launch a rococo style relay chain and you want other validators to connect with you in the simplest way. Here we will show you how you can set up validators of a rococo style relay chain.

Ramsey Ajram (Decentration)
3 min readFeb 12, 2022

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 your partner’s validators; then Rotate Keys.

Let’s begin…

Launch your validators

Submit keys
Assuming you have the sudo account, launch your validators and submit your babe and grandpa keys.

Check nodes are peering
Make sure nodes are peering, and do that through `— bootnodes` tag.

Example of a validator command:

Make sure validators are working

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).

Register new validators

Send funds
Send your partner 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)
Screenshot of registering new validators to the mix

You can do more than one at a time (as shown below)

list of new validators that you are registering
list of new validators

Rotate Keys

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 

If you copy and paste code from here you may get a bug because medium changes the type of symbols like these ` “, to something non-readable.

Make the RPC call in the terminal of your where your validator’s node is located, which should look like this:

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.

session > setKeys(keys, proof)
  • Be conscious of the account you are using to set the keys.
  • In “proof” just add 0x00 (not guaranteed to be secure).
  • Submit transaction

Wait for an epoch to see the changes, and other validators.

Thanks to my validation partner JelliedOwl(Paul).

You can find out more going to https://github.com/decentration/relay-chain, or perusing through our other medium articles.

If you completed this guide let me know with 40+ claps… Don’t be shy, clappy clap clap! 👏👏👏 😏

Until next time,

Ramsey (Decentration)

github: https://github.com/decentration/
email: ramsey@decentration.org

--

--

Ramsey Ajram (Decentration)
Ramsey Ajram (Decentration)

Written by Ramsey Ajram (Decentration)

Decentralising the web. Stewarding new paradigms. Engineering and product.