Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmd/akash/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"github.com/cosmos/cosmos-sdk/client/snapshot"
sdkserver "github.com/cosmos/cosmos-sdk/server"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
ibctransfer "github.com/cosmos/ibc-go/v10/modules/apps/transfer"
ibccore "github.com/cosmos/ibc-go/v10/modules/core"
rosettaCmd "github.com/cosmos/rosetta/cmd"

"pkg.akt.dev/go/cli"
Expand Down Expand Up @@ -107,10 +109,29 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig sdkutil.EncodingConfig)

cli.ServerCmds(rootCmd, home, ac.newApp, ac.appExport, addModuleInitFlags)

addIBCCommands(rootCmd)

rootCmd.SetOut(rootCmd.OutOrStdout())
rootCmd.SetErr(rootCmd.ErrOrStderr())
}

// addIBCCommands adds IBC core (client, channel) and transfer tx/query subcommands to the CLI.
// The chain supports IBC; the pkg.akt.dev/go/cli package does not wire these in.
func addIBCCommands(rootCmd *cobra.Command) {
coreBasic := ibccore.AppModuleBasic{}
transferBasic := ibctransfer.AppModuleBasic{}
for _, c := range rootCmd.Commands() {
switch c.Name() {
case "tx":
c.AddCommand(coreBasic.GetTxCmd())
c.AddCommand(transferBasic.GetTxCmd())
case "query", "q":
c.AddCommand(coreBasic.GetQueryCmd())
c.AddCommand(transferBasic.GetQueryCmd())
}
}
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd) //nolint: staticcheck
}
Expand Down
Loading