Search
Duplicate
Try Notion
🪤
Genesis file generation
We already run the evmosd init command in the tmkms set up, so there is a gensis.json file in our .evmosd/config folder.
Genesis transaction:
The genesis transaction is an special transaction that genesis validators can create, so they are part of the active set from the block 0.
The first step is to assign coins to the validator wallet in the genesis file:
~/evmosd add-genesis-account validator 100000000000000000000000000aevmos --keyring-backend file
Bash
The second step is to create the transaction to register our validator:
~/evmosd gentx validator 1000000000000000000000aevmos --keyring-backend file --chain-id evmos_9999-1
Bash
Upload your gentx file:
The last command created a .json file in your ~/.evmosd/config/gentx folder, we need to get all the validators gentx in order to join them and create the final genesis file.
For mainnet they were shared using a Github repo, but we can just copy and paste them in a chat channel:
cd ~/.evmosd/config/gentx cat *.json
Bash
Copy selecting from your terminal and paste in the chat.
Joining all the genesis transactions
This step needs to only be executed in one machine, it will generate the final version of the genesis.json file.
Copy all the .json files to the ~/.evmosd/config/gentx folder.
Add all the genesis account to you local genesis file, running for each <validator_address> the following command:
evmosd add-genesis-account <validator_address> 100000000000000000000000000aevmos
Bash
NOTE: helper script
sudo apt install jq for i in $(find ~/.evmosd/config/gentx -name "*.json");do address=$(cat "$i" | jq '.body.messages[0].delegator_address'|tr -d '"') ~/evmosd add-genesis-account "$address" 100000000000000000000000000aevmos [ $? -eq 0 ] && echo "$address added" || echo "$address failed" done
Bash
Collect genesis transactions:
~/evmosd collect-gentxs
Bash
Validator the genesis file
~/evmosd validate-genesis
Bash
Update all the modules coin denomination
There are some module coin denominations set as aphotons so we need to change them to aevmos to keep everything working with the same type of coin.
# Change parameter token denominations to aevmos cat $HOME/.evmosd/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aevmos"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json cat $HOME/.evmosd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aevmos"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json cat $HOME/.evmosd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aevmos"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json cat $HOME/.evmosd/config/genesis.json | jq '.app_state["evm"]["params"]["evm_denom"]="aevmos"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json cat $HOME/.evmosd/config/genesis.json | jq '.app_state["inflation"]["params"]["mint_denom"]="aevmos"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json
Bash
Change the voting time
In order to be able to test the proposals we are going to set the voting period to 5minutes:
cat $HOME/.evmosd/config/genesis.json | jq '.app_state["gov"]["voting_params"]["voting_period"]="250s"' > $HOME/.evmosd/config/tmp_genesis.json && mv $HOME/.evmosd/config/tmp_genesis.json $HOME/.evmosd/config/genesis.json
Bash
Send the final genesis.json file
Double check that everything is working:
~/evmosd validate-genesis
Bash
Distribute the genesis file to all the validators:
# From your local terminal (outside the vm) run to copy the genesis file and then send the file to all the validators scp ip@port:/home/hanchon/.evmosd/config/genesis.json ./
Bash