Skip to main content

x/genutil

Concepts

The genutil package contains a variaety of genesis utility functionalities for usage within a blockchain application. Namely:

  • Genesis transactions related (gentx)
  • Commands for collection and creation of gentxs
  • InitChain processing of gentxs
  • Genesis file validation
  • Genesis file migration
  • CometBFT related initialization
    • Translation of an app genesis to a CometBFT genesis

Client

CLI

The genutil commands are available under the genesis subcommand.

add-genesis-account

Add a genesis account to genesis.json. Learn more here.

collect-gentxs

Collect genesis txs and output a genesis.json file.

simd genesis collect-gentxs

This will create a new genesis.json file that includes data from all the validators (we sometimes call it the "super genesis file" to distinguish it from single-validator genesis files).

gentx

Generate a genesis tx carrying a self delegation.

simd genesis gentx [key_name] [amount] --chain-id [chain-id]

This will create the genesis transaction for your new chain. Here amount should be at least 1000000000stake. If you provide too much or too little, you will encounter an error when starting a node.

migrate

Migrate genesis to a specified target (SDK) version.

simd genesis migrate [target-version]

validate-genesis

Validates the genesis file at the default location or at the location passed as an argument.

simd genesis validate-genesis