How to run your own Cosmos Testnet

DerFredy
2 min readNov 19, 2018

--

While we are waiting the new release of Gaia-9002 and the GoS testnet
we may need to test some skills and infrastructure. This guide has been tested on:

> gaiad version
0.26.1-rc1–0-gbb54a0de

That version was a short lived Gaia 9001 testnet. There was an important bug that allowed negative fees, thus some one was able to mint tokens. The network halted in 2 days.

Here are the steps to deploy your very own private Cosmos testnet.

Cosmos

Login to your Validator and ensure it is clean with:

$ gaiad unsafe-reset-all

Previous command is dangerous. If you are not completly sure what you are doing… I wouldn’t do it.

Ensure you have at least a wallet in your keys list. If not you should start creating one.

$ gaiacli keys list

Next we will initialize gaia configurations files and data:

$ gaiad init

The genesis.json is not ready yet, but it can be sent to the participants for them to generate their gentx. If they use their own genesis (created with gaiad init) the network won’t start. It will fail like this: “panic: {“codespace”:1,”code”:4,”abci_code”:65540,”message”:”signature verification failed”}”
Now we need to add our cosmos address in our genesis file

$ gaiad add-genesis-account cosmos1lt6kq4u4me844u858hehu0mwt336tklfpr43mu 1000atom,1000steak

We could add here as many cosmos address as we need. But it is important to add more than one. If we just use one address the consensus and the sign of blocks is so fast that it makes no sense.
Now it is time to initialize our validator creating a gentx json file:

$ gaiad gentx --name=DerFredy

Each participant that would like to be present in the genesis file from the begining needs to generate a signed gentx and send the file back to us.
To finish our genesis creation we will include all our gentx json files from our friend’s validator. We just place their gentx files
inside the .gaiad/config/gentx folder and then run the following command:

$ gaiad collect-gentxs

Everything is ready to start our private testnet and produce blocks

$ gaiad start

Stay tuned:

--

--