Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
feat(cmd): add config command (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgooz committed Jul 27, 2021
1 parent 960bc2b commit d26fa00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cosmoscmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
Expand Down Expand Up @@ -131,12 +132,18 @@ func NewRootCmd(
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithBroadcastMode(flags.BroadcastBlock).
WithHomeDir(defaultNodeHome)
WithHomeDir(defaultNodeHome).
WithViper("")

rootCmd := &cobra.Command{
Use: appName + "d",
Short: "Stargate CosmosHub App",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
initClientCtx, err := config.ReadFromClientConfig(initClientCtx)
if err != nil {
return err
}

if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil {
return err
}
Expand Down Expand Up @@ -185,6 +192,7 @@ func initRootCmd(
AddGenesisAccountCmd(defaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
config.Cmd(),
)

a := appCreator{
Expand Down

0 comments on commit d26fa00

Please sign in to comment.