-
Notifications
You must be signed in to change notification settings - Fork 33
[Utility] Local Proof of Stake CLI - CLI and RPC client [part 1/2] - Issue #112 #177
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
Merged
deblasis
merged 92 commits into
pokt-network:main
from
deblasis:issue/utility_local_proof_of_stake_cli_CLI
Nov 3, 2022
Merged
Changes from 13 commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
b0f2531
chore(P2P): discuss comment on redundant line
deblasis 78c8d7d
feat(CLI): scaffolding
deblasis 32e3072
feat(CLI): scaffolding
deblasis 4f791f0
feat(CLI): scaffolding
deblasis ee1003a
feat(CLI): scaffolding
deblasis 83ec894
typo(P2P): redundant line
deblasis d7c8f5d
fix(CLI): merge conflict fix
deblasis 2bda3f3
chore(go.mod): tidy + vendor
deblasis bc6ad76
feat(Utility): CLI RPC client function
deblasis e60ea54
feat(Utility): RPC defaults const
deblasis ec76e05
feat(Utility): GetSignBytes
deblasis 6ae396e
feat(Utility): CLI utils
deblasis b87b721
feat(Utility): stake cmd scaffolding
deblasis b80a57c
fix(Utility): CLI: making use of the pwd flag
deblasis 5e185e4
fix(Utility): CLI: code review feedback
deblasis ecc360c
fix(Utility): CLI custodial stake command: OutputAddr = fromAddr
deblasis 655f3d0
refactor(Utility): CLI: refactor command bindings
deblasis d876e0e
refactor(Utility): CLI: named return values fix
deblasis ae0faa4
test(Utility): CLI: simplified tests for PK parsing from file
deblasis a86e273
feat(Utility): RPC OpenApi spec and code generation
deblasis a2eb0e9
feat(Utility): Updated RPC spec
deblasis 349ea3a
docs(Utility): CLI docs barebones
deblasis 6081c34
fix(Utility): CLI: added missing message handling for account
deblasis 0bebfa8
fix(Shared): fixed RPC config
deblasis 1e8e2de
feat(Utility): CLI updated to use the generated RPC client
deblasis 0633550
refactor(Shared): RPC config defaults -changing soon,I'm centralizin
deblasis 5726671
feat(Utility): CLI: updated to use test_artifacts default
deblasis 915fcfb
docs(Utility): CLI: Changelog
deblasis a4e7e79
fix(Utility): CLI: fixed output to user. It shouldn't be logging
deblasis d258fd5
fix(Utility): CLI code review feedback
deblasis d07c14a
style(Utility): code review feedback
deblasis 653f6d7
feat(Tooling): Updated makefile commands to better handle codegen
deblasis dda85a0
fix(Utility): Fix duplicated models
deblasis e5c3ae5
feat(Utility): CLI documentation generator + first stab at docs
deblasis bd42240
Merge remote-tracking branch 'upstream/main' into issue/utility_local…
deblasis 35914a8
fix(Utility): CLI specific fixes
deblasis 377cf14
fix(Utility): types fixes
deblasis 21459d3
fix(Utility): RPC configs post-merge
deblasis 7823a87
feat(Consensus): configOptions
deblasis e7d9c4e
feat(P2P): configOptions
deblasis 60d3c14
feat(Utility): CLI: using configOptions to inject PK
deblasis 2625979
Merge branch 'main' into issue/utility_local_proof_of_stake_cli_CLI
deblasis 2283910
Merge remote-tracking branch 'upstream/main' into issue/utility_local…
deblasis 2cea452
fix(go.mod): tidy
deblasis 2b8a9d1
fix(CLI): test_artifacts
deblasis 663fb8a
fix(go.mod): tidy
deblasis dca3786
fix(CLI): updated to use new typesUtil.ActorType
deblasis c04285b
fix(CLI): runtime based init
deblasis 5b61539
fix(test_artifacts): fix
deblasis daffff9
fix(CLI): runtime using WithRandomPK()
deblasis 0c85a8c
fix(CLI): fixed client-only initialization
deblasis 7458c0a
fix(Makefile): protogen first
deblasis 40b93b6
feat(Utility): GetActorName function (can we autogenerate these?)
deblasis 20f2ebc
fix(CLI): debug commands are now feature flagged
deblasis 52b46a3
chore(go.mod): tidy
deblasis f40f742
chore(CLI): git rm app/pocket/rpc/client.gen.go
deblasis 42a3831
chore(CLI): s/j/tx and s/prepareTx/prepareTxJson
deblasis accd5c8
refactor(shared): converters
deblasis dbdeccf
fix(CLI): debug nits
deblasis 8aef547
refactor(CLI): confirmation and credentials
deblasis f02a670
chore(CLI): removed HACK todo
deblasis 69ffc84
fix(Makefile): premature protoc
deblasis 1b1a0ed
fix(RPC): added imports used in codegen files
deblasis 8763125
refactor(RPC): moved scaffolding into rpc module
deblasis 35f8ef2
Update app/client/cli/utils.go
deblasis bf38384
fix(RPC): gitignoring generated files
deblasis db4bbdd
style(Persistence): reverting space change
deblasis aa1c737
refactor(Defaults): runtime/defaults package
deblasis 65326d5
chore(CLI): issue handle
deblasis e626d93
chore(CLI): Issue #310 links
deblasis 67bc84c
refactor(CLI): preallocation fix
deblasis d3c726a
style(CLI): oneMillion
deblasis 8d7a1a4
style(CLI): s/RelayChainIDs/relayChainIDs
deblasis 27e36c2
feat(Utility): ActorType.GetName()
deblasis 1eabec4
chore(Utility): tracking issue #142
deblasis 13485a2
chore(Utility): GetBytes -> GetCanonicalBytes
deblasis ce28724
chore(CLI): actorCmd -> accountCmd
deblasis e91a1ab
docs(CLI): fromAddr note (address currently sourced from pk)
deblasis 476b124
Merge remote-tracking branch 'upstream/main' into issue/utility_local…
deblasis 3c0f0ba
chore(Runtime): new default value from main
deblasis c740614
refactor(CLI): moving utility functions in utils.go
deblasis 1a95835
chore(CLI): NewDebug -> NewDebugCommand
deblasis f75a872
docs(CLI): added todos for exactArgs
deblasis 4cfae32
feat(RPC): /v1/consensus/round_state
deblasis c9efa96
refactor(CLI): Stake command
deblasis 20c3918
fix(CLI): tx message signing
deblasis b0a5a78
feat(CLI): reporting statuscode and body
deblasis 225be2f
Update utility/types/message.go
deblasis 5cecd49
chore(Runtime): comment spacing
deblasis 7238b03
docs(CLI): Changelog
deblasis d9743f5
refactor(Consensus): mocks with Return(nil) and not Do(...)
deblasis 2ec2448
chore(Consensus): SetBus mock Do(func(modules.Bus) {}) -> Return()
deblasis 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 hidden or 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 hidden or 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,61 @@ | ||
| package cli | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/pokt-network/pocket/shared/crypto" | ||
| "github.com/pokt-network/pocket/utility/types" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func init() { | ||
| rootCmd.AddCommand(NewAccountCommand()) | ||
| } | ||
|
|
||
| func NewAccountCommand() *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "Account", | ||
| Short: "Account specific commands", | ||
| Aliases: []string{"account"}, | ||
| Args: cobra.ExactArgs(0), | ||
| } | ||
|
|
||
| cmd.AddCommand(accountCommands()...) | ||
|
|
||
| return cmd | ||
| } | ||
|
|
||
| func accountCommands() (cmds []*cobra.Command) { | ||
| sendCmd := &cobra.Command{ | ||
| Use: "Send <fromAddr> <to> <amount>", | ||
| Short: "Send <fromAddr> <to> <amount>", | ||
| Long: "Sends <amount> to address <to> from address <fromAddr>", | ||
| Aliases: []string{"send"}, | ||
| Args: cobra.ExactArgs(3), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| // TODO(pocket/issues/150): update when we have keybase | ||
| pk, err := readEd25519PrivateKeyFromFile(privateKeyFilePath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // currently ignored since we are using the address from the PrivateKey | ||
| // fromAddr := crypto.AddressFromString(args[0]) | ||
| toAddr := crypto.AddressFromString(args[1]) | ||
| amount := args[2] | ||
|
|
||
| _ = &types.MessageSend{ | ||
| FromAddress: pk.Address(), | ||
| ToAddress: toAddr, | ||
| Amount: amount, | ||
| } | ||
|
|
||
| // TODO(deblasis): implement RPC client, route and handler | ||
| fmt.Printf("sending %s from %s to %s\n", args[2], args[0], args[1]) | ||
| return nil | ||
| }, | ||
| } | ||
|
|
||
| cmds = append(cmds, sendCmd) | ||
|
|
||
| return cmds | ||
| } |
This file contains hidden or 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,217 @@ | ||
| package cli | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "fmt" | ||
| "log" | ||
| "math/big" | ||
| "regexp" | ||
| "strings" | ||
|
|
||
| sharedTypes "github.com/pokt-network/pocket/shared/types" | ||
| "github.com/pokt-network/pocket/utility/types" | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| utilityTypes "github.com/pokt-network/pocket/utility/types" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func init() { | ||
| rootCmd.AddCommand(NewActorCommands()...) | ||
| } | ||
|
|
||
| var ( | ||
| // DISCUSS(team): this should probably come from somewhere else | ||
| stakingRecommendationAmount = big.NewInt(15100000000) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pwd string | ||
| ) | ||
|
|
||
| type actorCmdDef struct { | ||
| Name string | ||
| ActorType types.ActorType | ||
| } | ||
|
|
||
| func NewActorCommands() (cmds []*cobra.Command) { | ||
| actorCmdDefs := []actorCmdDef{ | ||
| {"Application", types.ActorType_App}, | ||
| {"Node", types.ActorType_Node}, | ||
| {"Fisherman", types.ActorType_Fish}, | ||
| {"Validator", types.ActorType_Val}, | ||
| } | ||
|
|
||
| for _, cmdDef := range actorCmdDefs { | ||
|
|
||
deblasis marked this conversation as resolved.
Show resolved
Hide resolved
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cmd := &cobra.Command{ | ||
| Use: cmdDef.Name, | ||
| Short: fmt.Sprintf("%s actor specific commands", cmdDef.Name), | ||
| Aliases: []string{strings.ToLower(cmdDef.Name), cmdDef.ActorType.GetActorName()}, | ||
| Args: cobra.ExactArgs(0), | ||
| } | ||
| cmd.AddCommand(newActorCommands(cmdDef)...) | ||
| cmds = append(cmds, cmd) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| return cmds | ||
| } | ||
|
|
||
| func newActorCommands(cmdDef actorCmdDef) (cmds []*cobra.Command) { | ||
Olshansk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| stakeCmd := &cobra.Command{ | ||
deblasis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Use: "Stake <fromAddr> <amount> <RelayChainIDs> <serviceURI>", | ||
| Short: "Stake a node in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.", | ||
| Long: `Stake the node into the network, making it available for service. | ||
| Will prompt the user for the <fromAddr> account passphrase. If the node is already staked, this transaction acts as an *update* transaction. | ||
| A node can updated relayChainIDs, serviceURI, and raise the stake amount with this transaction. | ||
| If the node is currently staked at X and you submit an update with new stake Y. Only Y-X will be subtracted from an account | ||
deblasis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| If no changes are desired for the parameter, just enter the current param value just as before`, | ||
| Args: cobra.ExactArgs(4), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| // TODO(pocket/issues/150): update when we have keybase | ||
| pk, err := readEd25519PrivateKeyFromFile(privateKeyFilePath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // currently ignored since we are using the address from the PrivateKey | ||
| // fromAddr := crypto.AddressFromString(args[0]) | ||
| amount := args[1] | ||
|
|
||
| am, err := sharedTypes.StringToBigInt(args[1]) | ||
| if err != nil { | ||
| log.Fatal(err) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| if sharedTypes.BigIntLessThan(am, stakingRecommendationAmount) { | ||
| fmt.Printf("The amount you are staking for is below the recommendation of %d POKT, would you still like to continue? y|n\n", stakingRecommendationAmount.Div(stakingRecommendationAmount, big.NewInt(1000000)).Int64()) | ||
| if !Confirmation(pwd) { | ||
| return fmt.Errorf("aborted") | ||
| } | ||
| } | ||
|
|
||
| reg, err := regexp.Compile("[^,a-fA-F0-9]+") | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| rawChains := reg.ReplaceAllString(args[2], "") | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| chains := strings.Split(rawChains, ",") | ||
| serviceURI := args[3] | ||
|
|
||
| fmt.Println("Enter Passphrase: ") | ||
| // TODO (team): passphrase is currently not used since there's no keybase yet, the prompt is here to mimick the real world UX | ||
| _ = Credentials(pwd) | ||
|
|
||
| msg := &types.MessageStake{ | ||
| PublicKey: pk.PublicKey().Bytes(), | ||
| Chains: chains, | ||
| Amount: amount, | ||
| ServiceUrl: serviceURI, | ||
| OutputAddress: []byte{}, // TODO(deblasis): 👀 | ||
| Signer: pk.Address(), // TODO(deblasis): figure out where I should get this from (https://github.com/pokt-network/pocket/pull/169#discussion_r953186602) | ||
| ActorType: cmdDef.ActorType, | ||
| } | ||
|
|
||
| codec := sharedTypes.GetCodec() | ||
| anyMsg, err := codec.ToAny(msg) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| signature, _ := pk.Sign(msg.GetSignBytes()) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| tx := &utilityTypes.Transaction{ | ||
| Msg: anyMsg, | ||
| Signature: &utilityTypes.Signature{ | ||
| Signature: signature, | ||
| PublicKey: pk.PublicKey().Bytes(), | ||
| }, | ||
| Nonce: "", // TODO(deblasis): figure out where I should get this from | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| j, err := json.Marshal(tx) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| // TODO(deblasis): we need a single source of truth for routes, the empty string should be replaced with something like a constant that can be used to point to a specific route | ||
| // perhaps the routes could be centralized into a map[string]Route in #176 and accessed here | ||
| // I will do this in #169 since it has commits from #176 and #177 | ||
| resp, err := QueryRPC("", j) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| fmt.Println(resp) | ||
Olshansk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return nil | ||
| }, | ||
| } | ||
| cmds = append(cmds, stakeCmd) | ||
|
|
||
| editStakeCmd := &cobra.Command{ | ||
| Use: "EditStake <fromAddr> <amount>", | ||
| Short: "EditStake <fromAddr> <amount>", | ||
| Long: fmt.Sprintf(`Stakes a new <amount> for the %s actor with address <fromAddr>`, cmdDef.Name), | ||
| Args: cobra.ExactArgs(2), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| // TODO(pocket/issues/150): update when we have keybase | ||
| pk, err := readEd25519PrivateKeyFromFile(privateKeyFilePath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| amount := args[1] | ||
|
|
||
| _ = &types.MessageEditStake{ | ||
| Address: pk.Address(), | ||
| Chains: []string{}, // TODO(deblasis): 👀 | ||
| Amount: amount, | ||
| ServiceUrl: "", // TODO(deblasis): 👀 | ||
| Signer: []byte{}, // TODO(deblasis): 👀 | ||
| ActorType: cmdDef.ActorType, | ||
| } | ||
|
|
||
| return nil | ||
| }, | ||
| } | ||
| cmds = append(cmds, editStakeCmd) | ||
|
|
||
| unstakeCmd := &cobra.Command{ | ||
| Use: "Unstake <fromAddr>", | ||
| Short: "Unstake <fromAddr>", | ||
| Long: fmt.Sprintf(`Unstakes the prevously staked tokens for the %s actor with address <fromAddr>`, cmdDef.Name), | ||
| Args: cobra.ExactArgs(1), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| // TODO(pocket/issues/150): update when we have keybase | ||
| pk, err := readEd25519PrivateKeyFromFile(privateKeyFilePath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| _ = &types.MessageUnstake{ | ||
| Address: pk.Address(), | ||
| Signer: []byte{}, // TODO(deblasis): 👀 | ||
Olshansk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ActorType: cmdDef.ActorType, | ||
| } | ||
|
|
||
| return nil | ||
| }, | ||
| } | ||
| cmds = append(cmds, unstakeCmd) | ||
|
|
||
| unpauseCmd := &cobra.Command{ | ||
| Use: "Unpause <fromAddr>", | ||
| Short: "Unpause <fromAddr>", | ||
| Long: fmt.Sprintf(`Unpauses the %s actor with address <fromAddr>`, cmdDef.Name), | ||
| Args: cobra.ExactArgs(1), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| // TODO(pocket/issues/150): update when we have keybase | ||
| pk, err := readEd25519PrivateKeyFromFile(privateKeyFilePath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| _ = &types.MessageUnpause{ | ||
| Address: pk.Address(), | ||
| Signer: []byte{}, // TODO(deblasis): 👀 | ||
| ActorType: cmdDef.ActorType, | ||
| } | ||
|
|
||
| return nil | ||
| }, | ||
| } | ||
| cmds = append(cmds, unpauseCmd) | ||
|
|
||
| return cmds | ||
| } | ||
This file contains hidden or 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,48 @@ | ||
| package cli | ||
|
|
||
| import ( | ||
| "bytes" | ||
| "encoding/json" | ||
| "fmt" | ||
| "io/ioutil" | ||
| "net/http" | ||
| "strconv" | ||
| "time" | ||
|
|
||
| "github.com/pokt-network/pocket/shared/types/genesis/test_artifacts" | ||
| ) | ||
|
|
||
| func QueryRPC(path string, jsonArgs []byte) (string, error) { | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cliURL := remoteCLIURL + path | ||
| fmt.Println(cliURL) | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| req, err := http.NewRequest("POST", cliURL, bytes.NewBuffer(jsonArgs)) | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
| req.Header.Set("Content-Type", "application/json") | ||
| client := &http.Client{ | ||
| Timeout: time.Duration(test_artifacts.DefaultRpcTimeout) * time.Millisecond, | ||
| } | ||
| resp, err := client.Do(req) | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
| defer resp.Body.Close() | ||
| bz, err := ioutil.ReadAll(resp.Body) | ||
| if err != nil { | ||
| return "", err | ||
| } | ||
| res, err := strconv.Unquote(string(bz)) | ||
| if err == nil { | ||
deblasis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| bz = []byte(res) | ||
| } | ||
| if resp.StatusCode == http.StatusOK { | ||
| var prettyJSON bytes.Buffer | ||
| err = json.Indent(&prettyJSON, bz, "", " ") | ||
| if err == nil { | ||
| return prettyJSON.String(), nil | ||
| } | ||
| return string(bz), nil | ||
| } | ||
| return "", fmt.Errorf("the http status code was not okay: %d, and the status was: %s, with a response of %v", resp.StatusCode, resp.Status, string(bz)) | ||
| } | ||
This file contains hidden or 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,33 @@ | ||
| package cli | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/pokt-network/pocket/shared/types/genesis/test_artifacts" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| const cliExecutableName = "client" | ||
|
|
||
| var ( | ||
| remoteCLIURL string | ||
| privateKeyFilePath string | ||
| ) | ||
|
|
||
| func init() { | ||
| rootCmd.PersistentFlags().StringVar(&remoteCLIURL, "remoteCLIURL", test_artifacts.DefaultRemoteCliUrl, "takes a remote endpoint in the form of <protocol>://<host> (uses RPC Port)") | ||
| rootCmd.PersistentFlags().StringVar(&privateKeyFilePath, "path_to_private_key_file", "./pk.json", "Path to private key to use when signing") | ||
| } | ||
|
|
||
| var rootCmd = &cobra.Command{ | ||
| Use: cliExecutableName, | ||
| // TODO(deblasis): document | ||
| Short: "", | ||
| Long: "", | ||
| // TODO(deblasis): do we need some sort of teardown as well? | ||
|
|
||
| } | ||
|
|
||
| func ExecuteContext(ctx context.Context) error { | ||
Olshansk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return rootCmd.ExecuteContext(ctx) | ||
| } | ||
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.
An issue I just realized is that validators (and maybe fisherman tentative the question I asked in #311) don't have relay chain IDs. I believe they will just be ignored so things will function E2E, but it'llbe very confusing to the user that they can pass that in.
I was thinking of just updating the docs saying "unneeded params will be ignored", but it still feels misleading and unclear.
Still thinking if we should create a follow up ticket for it or if there's a quick & easy fix here...
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.
@deblasis Can you create a ticket to track this?
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.
@Olshansk, @andrewnguyen22 : I was writing the ticket and meanwhile, I thought:
I guess this issue is similar to #177 (comment) with the exception that for that one we already have a dependency that could unlock it which is the keybase.
Since it looks like the end-to-end scenario is what we want to achieve short-term and that I added these arguments in the first place when I was more of a newbie just by referencing V0, shall we just remove them and add them back when the time comes to keep it stupid simple?
Ergo:
fromAddrargument where neededThere 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'm okay with either approach of the following approach
Feel free to take either one depending on your best judgment and time/work capacity
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.
Resolving this per the TODOs left alongside
cobra.ExactArgs