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

[Client] [Tooling] refactor: CLI #806

Merged
merged 71 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
34d42bf
refactor: move `persistencePeerstoreProvider` & implement `#GetUnstak…
bryanchriswhite Jun 5, 2023
142071d
feat: add `p2pPeerstoreProvider`
bryanchriswhite Jun 5, 2023
bcf3f65
refactor: only embed IntegratableModule in PeerstoreProvider
bryanchriswhite Jun 5, 2023
00730d4
refactor: remove unused `PeerstoreProvider#GetP2PConfig()` method
bryanchriswhite Jun 5, 2023
41d18ae
feat: add `PeerstoreProvider#GetUnstakedPeerstore()` interface method
bryanchriswhite Jun 5, 2023
507d8af
chore: implement `rpcPeerstoreProvider#GetUnstakedPeerstore()`
bryanchriswhite Jun 5, 2023
e74fea4
chore: add TECHDEBT comment
bryanchriswhite Jun 5, 2023
6128d84
chore: add `Factory` generic type
bryanchriswhite Jun 5, 2023
4bc605a
chore: update comments
bryanchriswhite Jun 5, 2023
094a95e
chore: update changelogs
bryanchriswhite Jun 5, 2023
2a5b300
chore: update changelogs
bryanchriswhite Jun 6, 2023
1d03f38
empty commit
bryanchriswhite Jun 6, 2023
c1318da
chore: replace empty interfaces with `any`
bryanchriswhite Jun 6, 2023
8d1f62a
chore: edit comment
bryanchriswhite Jun 6, 2023
975acf3
refactor: export `rootCmd` for cross-package subcommand registration
bryanchriswhite Jun 5, 2023
e9a451f
refactor: debug CLI helpers
bryanchriswhite Jun 5, 2023
72b7304
refactor: CLI flags
bryanchriswhite Jun 6, 2023
7924dda
fix: goimports
bryanchriswhite Jun 6, 2023
df5eb7e
chore: update changelogs
bryanchriswhite Jun 6, 2023
08bcafd
chore: remove unused `GetP2PConfig()` method
bryanchriswhite Jun 7, 2023
5a54400
chore: add godoc comments
bryanchriswhite Jun 7, 2023
5000ad8
fix: retrieve p2p mdoule from bus on each call
bryanchriswhite Jun 7, 2023
c587afa
refactor: persistence peerstor provider
bryanchriswhite Jun 7, 2023
e70b99c
refactor: embed `p2pPStoreProviderFactory`
bryanchriswhite Jun 7, 2023
b3ce271
chore: oneline function signature
bryanchriswhite Jun 7, 2023
8a476a4
refactor: consolidate p2pPeerstoreProvider into persistencePeerstorPr…
bryanchriswhite Jun 7, 2023
650d432
refactor: rename persistence.go back to provider.go
bryanchriswhite Jun 7, 2023
59fffb5
refactor: `p2pPeerstoreProvider` to a single function'
bryanchriswhite Jun 7, 2023
a1e22c4
refactor: update peerstore provider method receivers
bryanchriswhite Jun 7, 2023
ccd9fb7
refactor: re-implement `GetUnstakedPeerstore`
bryanchriswhite Jun 7, 2023
6e1a5b8
chore: add TECHDEBT comments
bryanchriswhite Jun 8, 2023
60302a4
chore: add issue numbers to TECHDEBT comments
bryanchriswhite Jun 8, 2023
1ac2e00
chore: improve comment
bryanchriswhite Jun 8, 2023
3a8e138
refactor: rename `T` & `K` type params to `M` &`C`
bryanchriswhite Jun 8, 2023
0cbca43
chore: update changelogs
bryanchriswhite Jun 8, 2023
9cee9dd
fix: bugs
bryanchriswhite Jun 8, 2023
2489b92
Merge remote-tracking branch 'pokt/main' into refactor/peerstore-prov…
bryanchriswhite Jun 8, 2023
11c61fc
Merge branch 'refactor/peerstore-provider' into refactor/cli
bryanchriswhite Jun 8, 2023
4bf0bba
chore: additional merge conflict resolution
bryanchriswhite Jun 8, 2023
60ea916
chore: add godoc comments to flag vars
bryanchriswhite Jun 8, 2023
3afcfa0
chore: unexport `genesisPath` env var
bryanchriswhite Jun 8, 2023
51d6f55
chore: add TECHDEBT comment
bryanchriswhite Jun 8, 2023
3bfa694
chore: update changelogs
bryanchriswhite Jun 8, 2023
3d01244
fix: missed a `flags.RemoteCLIURL` ref update
bryanchriswhite Jun 9, 2023
e286cbf
refactor:
bryanchriswhite Jun 9, 2023
82ad80a
chore: improve e2e test error message
bryanchriswhite Jun 9, 2023
093a78a
chore: simplify e2e debug commands
bryanchriswhite Jun 9, 2023
c8b05c3
chore: improve error handling in client CLI
bryanchriswhite Jun 9, 2023
3f42683
chore: improve comment
bryanchriswhite Jun 9, 2023
3faa07a
chore: update changelogs
bryanchriswhite Jun 9, 2023
8c2b9f4
fix: imports
bryanchriswhite Jun 9, 2023
c98e8d1
chore: add TECHDEBT comments
bryanchriswhite Jun 12, 2023
84ce1bd
chore: combine `NewRPCPeerstoreProvider()` & `Create()`
bryanchriswhite Jun 12, 2023
341d982
refactor: rename `NewPersistencePeerstoreProvider()` to `Create()`
bryanchriswhite Jun 12, 2023
0b22fbd
fix: remote_cli_url flag is overriden by env var
bryanchriswhite Jun 12, 2023
a9ffa56
chore: persistence peerstore provider includes all staked actors
bryanchriswhite Jun 12, 2023
0d92a09
chore: fix consensus test
bryanchriswhite Jun 12, 2023
024d88b
fix: p2p test
bryanchriswhite Jun 12, 2023
22ff0fd
chore: update changelogs
bryanchriswhite Jun 12, 2023
95c2d82
Merge branch 'refactor/peerstore-provider' into refactor/cli
bryanchriswhite Jun 12, 2023
7b6e995
chore: rename local var
bryanchriswhite Jun 12, 2023
408a68d
chore: update changelogs
bryanchriswhite Jun 12, 2023
c0577a3
fix: missed a rename reference
bryanchriswhite Jun 12, 2023
044f6f1
revert: `readCtx.GetAllStakedActors()`
bryanchriswhite Jun 13, 2023
b273e87
chore: update changelogs
bryanchriswhite Jun 13, 2023
2e4d60d
chore: fix nit
bryanchriswhite Jun 13, 2023
14404da
Merge branch 'refactor/peerstore-provider' into refactor/cli
bryanchriswhite Jun 13, 2023
c17bf87
chore: update changelogs
bryanchriswhite Jun 13, 2023
a4de252
Merge remote-tracking branch 'pokt/main' into refactor/cli
bryanchriswhite Jun 13, 2023
79c658d
chore: fix comment typo
bryanchriswhite Jun 13, 2023
413589f
chore: cleanup unneeded code comment
bryanchriswhite Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ rebuild_client_start: docker_check ## Rebuild and run a client daemon which is o

.PHONY: client_connect
client_connect: docker_check ## Connect to the running client debugging daemon
docker exec -it client /bin/bash -c "POCKET_P2P_IS_CLIENT_ONLY=true go run -tags=debug app/client/*.go debug"
docker exec -it client /bin/bash -c "POCKET_P2P_IS_CLIENT_ONLY=true go run -tags=debug app/client/*.go debug --remote_cli_url=http://validator1:50832"

.PHONY: build_and_watch
build_and_watch: ## Continous build Pocket's main entrypoint as files change
Expand Down Expand Up @@ -510,7 +510,7 @@ localnet_up: ## Starts up a k8s LocalNet with all necessary dependencies (tl;dr

.PHONY: localnet_client_debug
localnet_client_debug: ## Opens a `client debug` cli to interact with blockchain (e.g. change pacemaker mode, reset to genesis, etc). Though the node binary updates automatiacally on every code change (i.e. hot reloads), if client is already open you need to re-run this command to execute freshly compiled binary.
kubectl exec -it deploy/dev-cli-client --container pocket -- p1 debug
kubectl exec -it deploy/dev-cli-client --container pocket -- p1 debug --remote_cli_url http://pocket-validators:50832

.PHONY: localnet_shell
localnet_shell: ## Opens a shell in the pod that has the `client` cli available. The binary updates automatically whenever the code changes (i.e. hot reloads).
Expand Down
6 changes: 4 additions & 2 deletions app/client/cli/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package cli
import (
"fmt"

"github.com/spf13/cobra"

"github.com/pokt-network/pocket/app/client/cli/flags"
"github.com/pokt-network/pocket/shared/crypto"
"github.com/pokt-network/pocket/utility/types"
"github.com/spf13/cobra"
)

func init() {
Expand Down Expand Up @@ -48,7 +50,7 @@ func accountCommands() []*cobra.Command {
return err
}

if !nonInteractive {
if !flags.NonInteractive {
pwd = readPassphrase(pwd)
}

Expand Down
12 changes: 7 additions & 5 deletions app/client/cli/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"regexp"
"strings"

"github.com/spf13/cobra"

"github.com/pokt-network/pocket/app/client/cli/flags"
coreTypes "github.com/pokt-network/pocket/shared/core/types"
"github.com/pokt-network/pocket/shared/crypto"
typesUtil "github.com/pokt-network/pocket/utility/types"
"github.com/spf13/cobra"
)

func init() {
Expand Down Expand Up @@ -100,7 +102,7 @@ If no changes are desired for the parameter, just enter the current param value
return err
}

if !nonInteractive {
if !flags.NonInteractive {
pwd = readPassphrase(pwd)
}

Expand Down Expand Up @@ -169,7 +171,7 @@ func newEditStakeCmd(cmdDef actorCmdDef) *cobra.Command {
return err
}

if !nonInteractive {
if !flags.NonInteractive {
pwd = readPassphrase(pwd)
}

Expand Down Expand Up @@ -233,7 +235,7 @@ func newUnstakeCmd(cmdDef actorCmdDef) *cobra.Command {
return err
}

if !nonInteractive {
if !flags.NonInteractive {
pwd = readPassphrase(pwd)
}
pk, err := kb.GetPrivKey(fromAddrHex, pwd)
Expand Down Expand Up @@ -284,7 +286,7 @@ func newUnpauseCmd(cmdDef actorCmdDef) *cobra.Command {
return err
}

if !nonInteractive {
if !flags.NonInteractive {
pwd = readPassphrase(pwd)
}

Expand Down
35 changes: 19 additions & 16 deletions app/client/cli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,43 @@ package cli

import (
"context"
"log"

"github.com/pokt-network/pocket/runtime/configs"
"github.com/pokt-network/pocket/runtime/defaults"
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/pokt-network/pocket/app/client/cli/flags"
"github.com/pokt-network/pocket/runtime/configs"
"github.com/pokt-network/pocket/runtime/defaults"
)

const (
cliExecutableName = "p1"
)

var (
remoteCLIURL string
dataDir string
configPath string
nonInteractive bool
verbose bool
cfg *configs.Config
cfg *configs.Config
)

func init() {
rootCmd.PersistentFlags().StringVar(&remoteCLIURL, "remote_cli_url", defaults.DefaultRemoteCLIURL, "takes a remote endpoint in the form of <protocol>://<host> (uses RPC Port)")
rootCmd.PersistentFlags().BoolVar(&nonInteractive, "non_interactive", false, "if true skips the interactive prompts wherever possible (useful for scripting & automation)")
rootCmd.PersistentFlags().StringVar(&flags.RemoteCLIURL, "remote_cli_url", defaults.DefaultRemoteCLIURL, "takes a remote endpoint in the form of <protocol>://<host>:<port> (uses RPC Port)")
// ensure that this flag can be overidden by the respective viper-conventional environment variable (i.e. `POCKET_REMOTE_CLI_URL`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked if it environment variable works? I love that you bind a viper configuration instead of looking up the environment variable!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so. The CLI client and cluster manager containers are using POCKET_REMOTE_CLI_URL in this branch and both k8s and docker-compose localnets seem to be working as expected. I even used a fresh kind cluster for the k8s localnet.

Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 hmm... it doesn't seem to be working in the context of make localnet_shell though when it seems like it should, perhaps I've missed something. Taking another look. 👀

Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okdas thanks for making me double check this. 😅

I did a bit of investigating and I'm noticing that the way BindPFlag() works is not quite what I expected. It seems to "bind the respective viper key" in the sense that the final result will be reflected in the value retrieved from viper (as opposed to updating the bound flag variable). 0b22fbd adds a line just after the call to ParseConfig() which updates the flag var to this final value. My thinking is that it's better to keep the flag var than to replace all references to it with viper.GetString("remote_cli_url") or something similar.

It's worth noting though that we'll have to do this explicitly for any other flag vars which we wish to express the same behavior.

if err := viper.BindPFlag("remote_cli_url", rootCmd.PersistentFlags().Lookup("remote_cli_url")); err != nil {
log.Fatalf("could not bind flag %q: %v", "remote_cli_url", err)
}

rootCmd.PersistentFlags().BoolVar(&flags.NonInteractive, "non_interactive", false, "if true skips the interactive prompts wherever possible (useful for scripting & automation)")

// TECHDEBT: Why do we have a data dir when we have a config path if the data dir is only storing keys?
rootCmd.PersistentFlags().StringVar(&dataDir, "data_dir", defaults.DefaultRootDirectory, "Path to store pocket related data (keybase etc.)")
rootCmd.PersistentFlags().StringVar(&configPath, "config", "", "Path to config")
rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data_dir", defaults.DefaultRootDirectory, "Path to store pocket related data (keybase etc.)")
rootCmd.PersistentFlags().StringVar(&flags.ConfigPath, "config", "", "Path to config")
if err := viper.BindPFlag("root_directory", rootCmd.PersistentFlags().Lookup("data_dir")); err != nil {
panic(err)
log.Fatalf("could not bind flag %q: %v", "data_dir", err)
}

rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "Show verbose output")
rootCmd.PersistentFlags().BoolVar(&flags.Verbose, "verbose", false, "Show verbose output")
if err := viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose")); err != nil {
panic(err)
log.Fatalf("could not bind flag %q: %v", "verbose", err)
}
}

Expand All @@ -45,7 +48,7 @@ var rootCmd = &cobra.Command{
Long: "The CLI is meant to be an user but also a machine friendly way for interacting with Pocket Network.",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// by this time, the config path should be set
cfg = configs.ParseConfig(configPath)
cfg = configs.ParseConfig(flags.ConfigPath)
return nil
},
}
Expand Down
5 changes: 3 additions & 2 deletions app/client/cli/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cli

import (
"fmt"
"github.com/spf13/cobra"

"github.com/pokt-network/pocket/app/client/cli/flags"
"github.com/pokt-network/pocket/rpc"
"github.com/spf13/cobra"
)

func init() {
Expand Down Expand Up @@ -96,7 +97,7 @@ func consensusCommands() []*cobra.Command {
}

func getConsensusState(cmd *cobra.Command) (*rpc.GetV1ConsensusStateResponse, error) {
client, err := rpc.NewClientWithResponses(remoteCLIURL)
client, err := rpc.NewClientWithResponses(flags.RemoteCLIURL)
if err != nil {
return nil, nil
}
Expand Down
111 changes: 14 additions & 97 deletions app/client/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import (
"os"

"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
"google.golang.org/protobuf/types/known/anypb"

"github.com/pokt-network/pocket/app/client/cli/helpers"
"github.com/pokt-network/pocket/logger"
"github.com/pokt-network/pocket/p2p"
"github.com/pokt-network/pocket/p2p/providers/current_height_provider"
rpcCHP "github.com/pokt-network/pocket/p2p/providers/current_height_provider/rpc"
"github.com/pokt-network/pocket/p2p/providers/peerstore_provider"
rpcABP "github.com/pokt-network/pocket/p2p/providers/peerstore_provider/rpc"
typesP2P "github.com/pokt-network/pocket/p2p/types"
"github.com/pokt-network/pocket/runtime"
"github.com/pokt-network/pocket/runtime/defaults"
"github.com/pokt-network/pocket/shared/messaging"
"github.com/pokt-network/pocket/shared/modules"
"github.com/spf13/cobra"
"google.golang.org/protobuf/types/known/anypb"
)

// TECHDEBT: Lowercase variables / constants that do not need to be exported.
Expand All @@ -33,9 +30,6 @@ const (
)

var (
// A P2P module is initialized in order to broadcast a message to the local network
p2pMod modules.P2PModule

items = []string{
PromptPrintNodeState,
PromptTriggerNextView,
Expand All @@ -45,28 +39,12 @@ var (
PromptSendMetadataRequest,
PromptSendBlockRequest,
}

genesisPath string = runtime.GetEnv("GENESIS_PATH", "build/config/genesis.json")
rpcHost string
)

// NOTE: this is required by the linter, otherwise a simple string constant would have been enough
type cliContextKey string

const busCLICtxKey = "bus"

func init() {
dbg := NewDebugCommand()
dbg.AddCommand(NewDebugSubCommands()...)
rootCmd.AddCommand(dbg)

// by default, we point at the same endpoint used by the CLI but the debug client is used either in docker-compose of K8S, therefore we cater for overriding
validator1Endpoint := defaults.Validator1EndpointDockerCompose
if runtime.IsProcessRunningInsideKubernetes() {
validator1Endpoint = defaults.Validator1EndpointK8S
}

rpcHost = runtime.GetEnv("RPC_HOST", validator1Endpoint)
}

// NewDebugSubCommands builds out the list of debug subcommands by matching the
Expand All @@ -77,10 +55,8 @@ func NewDebugSubCommands() []*cobra.Command {
commands := make([]*cobra.Command, len(items))
for idx, promptItem := range items {
commands[idx] = &cobra.Command{
Use: promptItem,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
persistentPreRun(cmd, args)
},
Use: promptItem,
PersistentPreRunE: helpers.P2PDependenciesPreRunE,
Run: func(cmd *cobra.Command, args []string) {
handleSelect(cmd, cmd.Use)
},
Expand All @@ -93,70 +69,11 @@ func NewDebugSubCommands() []*cobra.Command {
// NewDebugCommand returns the cobra CLI for the Debug command.
func NewDebugCommand() *cobra.Command {
return &cobra.Command{
Use: "debug",
Short: "Debug utility for rapid development",
Args: cobra.MaximumNArgs(0),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
persistentPreRun(cmd, args)
},
RunE: runDebug,
}
}

// persistentPreRun is called by both debug and debug sub-commands before runs
func persistentPreRun(cmd *cobra.Command, _ []string) {
// TECHDEBT: this is to keep backwards compatibility with localnet
configPath = runtime.GetEnv("CONFIG_PATH", "build/config/config.validator1.json")
rpcURL := fmt.Sprintf("http://%s:%s", rpcHost, defaults.DefaultRPCPort)

runtimeMgr := runtime.NewManagerFromFiles(
configPath, genesisPath,
runtime.WithClientDebugMode(),
runtime.WithRandomPK(),
)

bus := runtimeMgr.GetBus()
setValueInCLIContext(cmd, busCLICtxKey, bus)

setupPeerstoreProvider(*runtimeMgr, rpcURL)
setupCurrentHeightProvider(*runtimeMgr, rpcURL)
setupAndStartP2PModule(*runtimeMgr)
}

func setupPeerstoreProvider(rm runtime.Manager, rpcURL string) {
bus := rm.GetBus()
modulesRegistry := bus.GetModulesRegistry()
pstoreProvider := rpcABP.NewRPCPeerstoreProvider(
rpcABP.WithP2PConfig(rm.GetConfig().P2P),
rpcABP.WithCustomRPCURL(rpcURL),
)
modulesRegistry.RegisterModule(pstoreProvider)
}

func setupCurrentHeightProvider(rm runtime.Manager, rpcURL string) {
bus := rm.GetBus()
modulesRegistry := bus.GetModulesRegistry()
currentHeightProvider := rpcCHP.NewRPCCurrentHeightProvider(
rpcCHP.WithCustomRPCURL(rpcURL),
)
modulesRegistry.RegisterModule(currentHeightProvider)
}

func setupAndStartP2PModule(rm runtime.Manager) {
bus := rm.GetBus()
mod, err := p2p.Create(bus)
if err != nil {
logger.Global.Fatal().Err(err).Msg("Failed to create p2p module")
}

var ok bool
p2pMod, ok = mod.(modules.P2PModule)
if !ok {
logger.Global.Fatal().Msgf("unexpected P2P module type: %T", mod)
}

if err := p2pMod.Start(); err != nil {
logger.Global.Fatal().Err(err).Msg("Failed to start p2p module")
Use: "debug",
Short: "Debug utility for rapid development",
Args: cobra.MaximumNArgs(0),
PersistentPreRunE: helpers.P2PDependenciesPreRunE,
RunE: runDebug,
}
}

Expand Down Expand Up @@ -269,7 +186,7 @@ func broadcastDebugMessage(cmd *cobra.Command, debugMsg *messaging.DebugMessage)
if err != nil {
logger.Global.Fatal().Err(err).Msg("Failed to convert validator address into pocketCrypto.Address")
}
if err := p2pMod.Send(addr, anyProto); err != nil {
if err := helpers.P2PMod.Send(addr, anyProto); err != nil {
logger.Global.Error().Err(err).Msg("Failed to send debug message")
}
}
Expand Down Expand Up @@ -299,14 +216,14 @@ func sendDebugMessage(cmd *cobra.Command, debugMsg *messaging.DebugMessage) {
logger.Global.Fatal().Err(err).Msg("Failed to convert validator address into pocketCrypto.Address")
}

if err := p2pMod.Send(validatorAddress, anyProto); err != nil {
if err := helpers.P2PMod.Send(validatorAddress, anyProto); err != nil {
logger.Global.Error().Err(err).Msg("Failed to send debug message")
}
}

// fetchPeerstore retrieves the providers from the CLI context and uses them to retrieve the address book for the current height
func fetchPeerstore(cmd *cobra.Command) (typesP2P.Peerstore, error) {
bus, ok := getValueFromCLIContext[modules.Bus](cmd, busCLICtxKey)
bus, ok := helpers.GetValueFromCLIContext[modules.Bus](cmd, helpers.BusCLICtxKey)
if !ok || bus == nil {
return nil, errors.New("retrieving bus from CLI context")
}
Expand Down
24 changes: 24 additions & 0 deletions app/client/cli/flags/flags.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package flags
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

var (
// RemoveCLIURL is the URL of the remote RPC node which the CLI will interact with.
// Formatted as <protocol>://<host>:<port> (uses RPC Port).
// (see: --help the root command for more info).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I think adding (see: --help the root command for more info). once above var ( would be sufficient.

Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I was imagining browsing the godoc. Perhaps a package-level comment would be more appropriate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Adding this to my list of TODOs in a downstream PR to avoid another round with CI)

RemoteCLIURL string
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

// DataDir a path to store pocket related data (keybase etc.).
// (see: --help the root command for more info).
DataDir string

// ConfigPath is the path to the node config file.
// (see: --help the root command for more info).
ConfigPath string

// If true skips the interactive prompts wherever possible (useful for scripting & automation)
// (see: --help the root command for more info).
NonInteractive bool

// Show verbose output
// (see: --help the root command for more info).
Verbose bool
bryanchriswhite marked this conversation as resolved.
Show resolved Hide resolved
)
Loading