Setup Desmos Gentx with Multisig [desmos-mainnet-1]

Cat Boss
4 min readAug 20, 2021

--

Hello Cat Boss here! Today we’re going to go over how you can generate a gentx and join desmos-mainnet-1 as a validator using your multisig address!

Huge congrats to the Desmos team for this accomplishment. You can go and read their original setup guide here: https://medium.com/desmosnetwork/becoming-a-desmos-mainnet-genesis-validator-part-1-61c98c6427d3

While our setup is very similar, we will primarily be focusing on the multisig aspect.

Prerequisites

You’re here for one reason.

You generated a multisig address and it’s time to create a gentx with it. But how? Well that’s what this post is here for. We won’t focus on the prerequisites as you must have already known how to create a multisig address for you to need it in gentx.

For those who are interested in generating your first multisig address: https://jake-hartnell.medium.com/cosmos-sdk-multisigs-96a390a9d3cc

Alright let’s begin…

Make sure you have at least your own key (that was used when generating the multisig address) and the multisig address by running

desmos keys list

If you do not, please add them now using

desmos keys add <moniker> [flags]

Make sure you have the correct version (v0.17.7) by running the following command.

desmos version
The expected version

If you’re on the wrong version, please check out to the correct tag (v0.17.7) and run make install then check again.

Initialise your node

If you have an existing ~/.desmos folder please make sure to:

  • delete ~/.desmos/config/genesis.json

Run the following command to init your desmos node:

desmos init <node_moniker>

This command will initialize the ~/.desmos folder properly and create all the necessary files.

Note a new genesis.json and priv_validator_key.json will be created at this stage.

Get the pre-genesis file

curl https://raw.githubusercontent.com/desmos-labs/mainnet/main/penultimate_genesis.json > ~/.desmos/config/genesis.json

This will replace the genesis.json created during the previous init step with the pre-genesis file.

Create gentx

Here is where we will differentiate a bit from the desmos team’s blog post. In order for us to correctly generate gentx with a multisig address we will need to generate the tx offline and have all the keys (or whatever the minimum threshold of the multisig is) sign the tx.

Below is an example of how we call gentx and export is out a json. Please replace the values to fit your needs.

desmos gentx [multisig-keyname] [self-delegate-amount]udsm \
--chain-id="desmos-mainnet-1" \
--moniker="<your moniker>" \
--website="<your website>" \
--details="<your description>" \
--commission-rate="0.07" \
--commission-max-rate="1.00" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--pubkey="<your pubkey>" \
--generate-only \
> ~/desmos-gentx.json
  • multisig-keyname is the key name you gave your multisig. You can find it in desmos keys list
  • self delegate amount the amount of tokens you want to self delegate. Keep in mind that there is a 10,000DSM limit. Any gentx that passes this limit will be rejected.
  • website your website. Remove the flag if you do not have
  • details validator description
  • commission-rate your validator commission rate
  • commission-max-rate the highest commission rate your validator will go
  • commission-max-change-rate the high change in commission your validator will go at once
  • pubkey you validator pubkey. You can find by running desmos tendermint show-validator or use one you already have.

This command will generate an unsigned tx in ~/desmos-gentx.json

Sign the Gentx

Now depending on the threshold number, send desmos-gentx.json to whoever needs to sign and have them individually sign the tx and send it back to you (only one person will need to hold all the signatures for the next step).

To sign the tx edit to your needs and run the following:

desmos tx sign \
--from $(desmos keys show -a <signer-keyname>) \
--multisig $(desmos keys show -a <multisig-keyname>) ~/desmos-gentx.json \
--sign-mode amino-json \
--chain-id desmos-mainnet-1 \
--offline \
--account-number 0 \
--sequence 0 >> ~/desmos-gentx-signed.json

We will be setting the account-number and sequence to 0 as it does not exist (yet) and have not done any transactions on desmos-mainnet-1 .

Combine all the signatures

We will now combine all the signatures and generate a final signed gentx.

desmos tx multisign \
--from <multisig-keyname> ~/desmos-gentx.json <multisig-keyname> ~/desmos-gentx-signed-1.json ~/desmos-gentx-signed-2.json ~/desmos-gentx-signed-3.json \
--chain-id desmos-mainnet-1 \
--offline \
--account-number 0 \
--sequence 0 > ~/desmos_gentx_final_multisig.json

If done correctly you should now have a file called desmos_gentx_final_multisig.json congrats :D .

Submit the transaction file to GitHub

While options, I would suggest changing your filename to <validator_moniker>.json .

Fork https://github.com/desmos-labs/mainnet and add your signed gentx in to /gentxs .

Create a pull request and merge your changes inside desmos’s repository.

One your PR has been approved and merge you are officially a validator for desmos-mainnet-1 at genesis! 🎉

Final comments

Make sure you save whichever priv_validator_key.json you have linked your address with in gentx! You’ll need to transfer that over to wherever you plan to start running your node if you want that node to be signing.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Cat Boss
Cat Boss

Written by Cat Boss

We’re dPoS validators and we like writing medium posts documenting our journey, sharing tips we learn along the way. Trust me, I am a Cat.

No responses yet

Write a response