Skip to content

Commit

Permalink
Merge branch 'refactor/cli' into feat/peer-discovery-list
Browse files Browse the repository at this point in the history
* refactor/cli:
  chore: consistent debug CLI identity
  chore: add `GetBusFromCmd()` CLI helper
  chore: ensure flag and config parsing
  • Loading branch information
bryanchriswhite committed Jul 13, 2023
2 parents 430db08 + 04dc0aa commit 3925c71
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/client/cli/helpers/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"fmt"

"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/pokt-network/pocket/app/client/cli/flags"
"github.com/pokt-network/pocket/logger"
"github.com/pokt-network/pocket/p2p"
rpcCHP "github.com/pokt-network/pocket/p2p/providers/current_height_provider/rpc"
rpcPSP "github.com/pokt-network/pocket/p2p/providers/peerstore_provider/rpc"
"github.com/pokt-network/pocket/runtime"
"github.com/pokt-network/pocket/runtime/configs"
"github.com/pokt-network/pocket/shared/modules"
)

Expand All @@ -21,13 +23,13 @@ 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 {
if err := flags.ParseConfigAndFlags(nil, nil); err != nil {
return err
}

// TODO_THIS_COMMIT: figure out what to do with this vvv
// TECHDEBT: this is to keep backwards compatibility with localnet
flags.ConfigPath = runtime.GetEnv("CONFIG_PATH", "build/config/config.validator1.json")
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,
Expand Down

0 comments on commit 3925c71

Please sign in to comment.