Skip to content

Commit

Permalink
Merge branch 'main' into refactor/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Jul 25, 2023
2 parents 9ecc9e5 + 77dc729 commit 1cbc249
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
25 changes: 25 additions & 0 deletions app/client/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
PromptSendBlockRequest string = "BlockRequest (broadcast)"
)

<<<<<<< HEAD

Check failure on line 26 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / Go 1.20 test

syntax error: non-declaration statement outside function body

Check failure on line 26 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body

Check failure on line 26 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body

Check failure on line 26 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body
var items = []string{
PromptPrintNodeState,
PromptTriggerNextView,
Expand All @@ -39,6 +40,30 @@ func init() {
rootCmd.AddCommand(dbgUI)
}

=======

Check failure on line 43 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / Go 1.20 test

syntax error: non-declaration statement outside function body

Check failure on line 43 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body

Check failure on line 43 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body
var (
items = []string{
PromptPrintNodeState,
PromptTriggerNextView,
PromptTogglePacemakerMode,
PromptResetToGenesis,
PromptShowLatestBlockInStore,
PromptSendMetadataRequest,
PromptSendBlockRequest,
}
)

func init() {
dbgUI := newDebugUICommand()
dbgUI.AddCommand(newDebugUISubCommands()...)
rootCmd.AddCommand(dbgUI)

dbg := newDebugCommand()
dbg.AddCommand(debugCommands()...)
rootCmd.AddCommand(dbg)
}

>>>>>>> main

Check failure on line 66 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / Go 1.20 test

syntax error: non-declaration statement outside function body

Check failure on line 66 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 66 in app/client/cli/debug.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body) (typecheck)
// newDebugUISubCommands builds out the list of debug subcommands by matching the
// handleSelect dispatch to the appropriate command.
// * To add a debug subcommand, you must add it to the `items` array and then
Expand Down
9 changes: 8 additions & 1 deletion app/client/cli/helpers/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const debugPrivKey = "09fc8ee114e678e665d09179acb9a30060f680df44ba06b51434ee4794
// P2PDependenciesPreRunE initializes peerstore & current height providers, and a
// p2p module which consumes them. Everything is registered to the bus.
func P2PDependenciesPreRunE(cmd *cobra.Command, _ []string) error {
// TECHDEBT: this is to keep backwards compatibility with localnet
// TECHDEBT: this was being used for backwards compatibility with LocalNet and need to re-evaluate if its still necessary
flags.ConfigPath = runtime.GetEnv("CONFIG_PATH", "build/config/config.validator1.json")
configs.ParseConfig(flags.ConfigPath)

Expand All @@ -38,6 +38,13 @@ func P2PDependenciesPreRunE(cmd *cobra.Command, _ []string) error {
// set final `remote_cli_url` value; order of precedence: flag > env var > config > default
flags.RemoteCLIURL = viper.GetString("remote_cli_url")

// By this time, the config path should be set.
// This is only being called for viper related side effects
// TECHDEBT(#907): refactor and improve how viper is used to parse configs throughout the codebase
_ = configs.ParseConfig(flags.ConfigPath)
// set final `remote_cli_url` value; order of precedence: flag > env var > config > default
flags.RemoteCLIURL = viper.GetString("remote_cli_url")

runtimeMgr := runtime.NewManagerFromFiles(
flags.ConfigPath, genesisPath,
runtime.WithClientDebugMode(),
Expand Down

0 comments on commit 1cbc249

Please sign in to comment.