Concepts
Thegenutil
package contains a variety 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 creation
- Genesis file validation
- Genesis file migration
- CometBFT related initialization
- Translation of an app genesis to a CometBFT genesis
Genesis
Genutil contains the data structure that defines an application genesis. An application genesis consist of a consensus genesis (g.e. CometBFT genesis) and application related genesis data. x/genutil/types/genesis.goClient
CLI
The genutil commands are available under thegenesis
subcommand.
add-genesis-account
Add a genesis account togenesis.json
. Learn more here.
collect-gentxs
Collect genesis txs and output agenesis.json
file.
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.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.The
migrate
command is extensible and takes a MigrationMap
. This map is a mapping of target versions to genesis migrations functions. When not using the default MigrationMap
, it is recommended to still call the default MigrationMap
corresponding the SDK version of the chain and prepend/append your own genesis migrations.validate-genesis
Validates the genesis file at the default location or at the location passed as an argument.Validate genesis only validates if the genesis is valid at the current application binary. For validating a genesis from a previous version of the application, use the
migrate
command to migrate the genesis to the current version.