How to override DefaultGenesis?

Hi all,

I’ve been implementing a blockchain on the top of the Cosmos SDK.

Everything works well, but I’d like to override DefaultGenesis functions of some modules (such as ‘staking’).
For example, I want to use a custom value of MaxValidators, instead of the DefaultMaxValidators defined in the x/staking/types/params.go.

But, it seems there is no way to override the value.
In the genutilcli.InitCmd(), the DefaultGenesis() is used.

Please suggest any idea how to override default genesis params of the existing modules.
Thank you.


Which version of the sdk are you using?

We made a wrapper round the init command so after it generates the genesis it reads the file again and set our custom default params as bond_denom, and others.

Awesome! Thank you. I’m using v0.37.14. It seems it has the PostRunE.