fix(server/v2): remove dup commands + reduce api surface (#20810)

This commit is contained in:
Julien Robert
2024-07-04 08:21:49 +00:00
committed by GitHub
parent e75f7b506b
commit 9df6019de6
4 changed files with 87 additions and 88 deletions
+9 -10
View File
@@ -99,6 +99,15 @@ func initRootCmd[AppT serverv2.AppI[T], T transaction.Tx](
panic(fmt.Sprintf("failed to create logger: %v", err))
}
// add keybase, auxiliary RPC, query, genesis, and tx child commands
rootCmd.AddCommand(
genesisCommand[T](txConfig, moduleManager, appExport[T]),
queryCommand(),
txCommand(),
keys.Commands(),
offchain.OffChain(),
)
// Add empty server struct here for writing default config
if err = serverv2.AddCommands(
rootCmd,
@@ -109,16 +118,6 @@ func initRootCmd[AppT serverv2.AppI[T], T transaction.Tx](
); err != nil {
panic(err)
}
// add keybase, auxiliary RPC, query, genesis, and tx child commands
rootCmd.AddCommand(
server.StatusCommand(),
genesisCommand[T](txConfig, moduleManager, appExport[T]),
queryCommand(),
txCommand(),
keys.Commands(),
offchain.OffChain(),
)
}
// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter