-
Notifications
You must be signed in to change notification settings - Fork 33
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
[P2P] [Tooling] Peer discovery peer list
subcommand
#892
Open
bryanchriswhite
wants to merge
43
commits into
main
Choose a base branch
from
feat/peer-discovery-list
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
4badf3a
chore: simplify debug message broadcasting
bryanchriswhite 2b83d32
refactor: CLI config parsing
bryanchriswhite eac7695
refactor: common CLI helpers
bryanchriswhite bca000b
chore: add `GetBusFromCmd()` CLI helper
bryanchriswhite 5e963be
chore: consistent debug CLI identity
bryanchriswhite a883f08
chore: add `enable_peer_discovery_debug_rpc` to P2P config
bryanchriswhite 83c3604
chore: add P2P debug message handling support
bryanchriswhite 6ecca53
feat: add `peer` subcommand
bryanchriswhite d570b35
chore: add peer `--local` persistent flag
bryanchriswhite e952365
feat: add `peer list` subcommand
bryanchriswhite e80843c
chore: implement `PeerstoreProvider#GetUnstakedPeerstore()`
bryanchriswhite 8f90e22
chore: add `PeerstoreProvider#GetStakedPeerstoreAtCurrentHeight()`
bryanchriswhite 6e691cd
chore: interim bootstrapping changes (pre-#859)
bryanchriswhite 430db08
fix: gofmt
bryanchriswhite 440b59a
chore: ensure flag and config parsing
bryanchriswhite fcfa837
chore: add `GetBusFromCmd()` CLI helper
bryanchriswhite 04dc0aa
chore: consistent debug CLI identity
bryanchriswhite 3925c71
Merge branch 'refactor/cli' into feat/peer-discovery-list
bryanchriswhite 1bbad38
fixup: add `peer list` subcommand
bryanchriswhite 64abbc0
add generated helm docs
invalid-email-address d8b6296
squash: merge refactor/cli with main
h5law 9ecc9e5
chore: address review comments
h5law 1cbc249
Merge branch 'main' into refactor/cli
h5law ffbc539
fix merge error
h5law 0cff1d2
Merge branch 'refactor/cli' into feat/peer-discovery-list
h5law 39af37c
revert change
h5law c22011c
address comments
h5law 1fc2bb4
chore: address comments
h5law 764e171
clarify unstaked description
h5law 9eb5a7e
Merge branch 'main' into feat/peer-discovery-list
h5law 7380260
chore: up retry attempts and wait time, clarify error messages
h5law c03aa27
Merge branch 'main' into feat/peer-discovery-list
Olshansk da62de1
Fixed case messaging.DebugMessageEventType
Olshansk 12e22e1
clairfy error log messages
h5law f8f5da5
fix waitgroup recovery in tests
h5law 66a1347
chore: move comment line
h5law 870805f
add NewListCommand function to fit CLI pattern
h5law 64ec990
clarify errors
h5law ccec195
remove unneeded error casting as sync panics a string
h5law 90385f0
tidy cli
h5law 6d0d300
remove #810 from comment as merged
h5law c6488a5
shortern retries
h5law 2317d42
bug: comment out buggy lines
h5law File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package flags | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
|
||
"github.com/pokt-network/pocket/runtime/configs" | ||
) | ||
|
||
var Cfg *configs.Config | ||
|
||
func ParseConfigAndFlags(_ *cobra.Command, _ []string) error { | ||
// by this time, the config path should be set | ||
Cfg = configs.ParseConfig(ConfigPath) | ||
|
||
// set final `remote_cli_url` value; order of precedence: flag > env var > config > default | ||
RemoteCLIURL = viper.GetString("remote_cli_url") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we do this for the other
flags.go
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intended to revert this change. This is the direction I started when investigating #891 (comment), I thought I had reverted it but apparently failed.
To answer your question, the reason for this is because viper's only integration with flags is to support setting a viper key based on the flag, but not the other way around. I.e: Viper won't update the flag value. This only applies to bound flags
This means that we have to do one of the following consistently for bound flags:
viper.GetString("<flag key>")
(or a helper containing it) anywhere we need the valueI opted for the latter option as I felt it was more conventional and easier to read and maintain.