Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Add genesisCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
foxytanuki committed Feb 14, 2024
1 parent 40f3073 commit e8abfe9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/myceld/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand All @@ -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{
Expand Down

0 comments on commit e8abfe9

Please sign in to comment.