Skip to content

Commit

Permalink
Add available keys in the secrets long help
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Mar 28, 2024
1 parent 08660a5 commit ea258b3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
10 changes: 10 additions & 0 deletions gno.land/cmd/gnoland/secrets_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,13 @@ func validateNodeKey(key *p2p.NodeKey) error {

return nil
}

// getAvailableSecretsKeys formats and returns the available secret keys (constants)
func getAvailableSecretsKeys() string {
return fmt.Sprintf(
"[%s, %s, %s]",
validatorPrivateKeyKey,
nodeKeyKey,
validatorStateKey,
)
}
5 changes: 4 additions & 1 deletion gno.land/cmd/gnoland/secrets_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ func newSecretsGetCmd(io commands.IO) *commands.Command {
Name: "get",
ShortUsage: "secrets get [flags] [<key>]",
ShortHelp: "shows all Gno secrets present in a common directory",
LongHelp: "shows the validator private key, the node p2p key and the validator's last sign state",
LongHelp: fmt.Sprintf(
"shows the validator private key, the node p2p key and the validator's last sign state. Available keys: %s",
getAvailableSecretsKeys(),
),
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
5 changes: 4 additions & 1 deletion gno.land/cmd/gnoland/secrets_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ func newSecretsInitCmd(io commands.IO) *commands.Command {
Name: "init",
ShortUsage: "secrets init [flags] [<key>]",
ShortHelp: "initializes required Gno secrets in a common directory",
LongHelp: "initializes the validator private key, the node p2p key and the validator's last sign state",
LongHelp: fmt.Sprintf(
"initializes the validator private key, the node p2p key and the validator's last sign state. Available keys: %s",
getAvailableSecretsKeys(),
),
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
5 changes: 4 additions & 1 deletion gno.land/cmd/gnoland/secrets_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ func newSecretsVerifyCmd(io commands.IO) *commands.Command {
Name: "verify",
ShortUsage: "secrets verify [flags] [<key>]",
ShortHelp: "verifies all Gno secrets in a common directory",
LongHelp: "verifies the validator private key, the node p2p key and the validator's last sign state",
LongHelp: fmt.Sprintf(
"verifies the validator private key, the node p2p key and the validator's last sign state. Available keys: %s",
getAvailableSecretsKeys(),
),
},
cfg,
func(_ context.Context, args []string) error {
Expand Down

0 comments on commit ea258b3

Please sign in to comment.