Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate multiple rootCmd.AddCommand() #3476

Closed
rootulp opened this issue May 13, 2024 · 1 comment · Fixed by #3478
Closed

Consolidate multiple rootCmd.AddCommand() #3476

rootulp opened this issue May 13, 2024 · 1 comment · Fixed by #3478
Assignees
Labels
good first issue Good for newcomers

Comments

@rootulp
Copy link
Collaborator

rootulp commented May 13, 2024

Context

rootCmd.AddCommand(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
genutilcli.MigrateGenesisCmd(),
cmd.AddGenesisAccountCmd(app.DefaultNodeHome),
genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
config.Cmd(),
commands.CompactGoLevelDBCmd,
addrbookCommand(),
downloadGenesisCommand(),
addrConversionCmd(),
)
server.AddCommands(rootCmd, app.DefaultNodeHome, NewAppServer, createAppAndExport, addModuleInitFlags)
// add status, query, tx, and keys subcommands
rootCmd.AddCommand(
rpc.StatusCommand(),
queryCommand(),
txCommand(),
keys.Commands(app.DefaultNodeHome),
bscmd.VerifyCmd(),
)
rootCmd.AddCommand(
snapshot.Cmd(NewAppServer),
)

Problem

Why are there 3 separate code blocks that invoke rootCmd.AddCommand()? It seems like they could all be consolidated into one. It looks like the multiple invocations date back from a while ago.

Proposal

Consolidate them all into one rootCmd.AddCommand() invocation. Test it by invoking celestia-appd --help and verify that all the commands are still added.

@rootulp rootulp added the good first issue Good for newcomers label May 13, 2024
@MukulKolpe
Copy link
Contributor

Hey @rootulp, can I work on this issue?

rootulp pushed a commit that referenced this issue May 14, 2024
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

Closes #3476

Consolidated all the `rootCmd.AddCommand()` from
[initRootCmd](https://github.com/celestiaorg/celestia-app/blob/ef67d05690d445758472b50ecacaf8a5d5f2b0f2/cmd/celestia-appd/cmd/root.go#L124)
function.

<!-- 
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue. 
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants