diff --git a/cmd/myceld/cmd/root.go b/cmd/myceld/cmd/root.go index 35ee237f..84ed6b89 100644 --- a/cmd/myceld/cmd/root.go +++ b/cmd/myceld/cmd/root.go @@ -39,6 +39,7 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -199,6 +200,7 @@ func initRootCmd( // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( server.StatusCommand(), + genesisCommand(tempApp.TxConfig(), tempApp.BasicModuleManager), queryCommand(), txCommand(), keys.Commands(), @@ -215,6 +217,16 @@ func initRootCmd( ) } +// genesisCommand builds genesis-related `mychaind genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(txConfig client.TxConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.Commands(txConfig, basicManager, app.DefaultNodeHome) + + for _, subCmd := range cmds { + cmd.AddCommand(subCmd) + } + return cmd +} + // queryCommand returns the sub-command to send queries to the app func queryCommand() *cobra.Command { cmd := &cobra.Command{