-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: add flag for the private key selection #43
feat: add flag for the private key selection #43
Conversation
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.
LGTM
x/genutil/client/cli/collect.go
Outdated
@@ -64,6 +64,7 @@ func CollectGenTxsCmd(ctx *server.Context, cdc *codec.Codec, | |||
cmd.Flags().String(flagGenTxDir, "", | |||
"override default \"gentx\" directory from which collect and execute "+ | |||
"genesis transactions; default [--home]/config/gentx/") | |||
cmd.Flags().String(flags.FlagPrivKeyType, flags.DefaultPrivKeyType, "Select private key type") |
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.
- The descriptions of other flags seem to begin with a lower case.
- I feel this explanation is too simple. What does the "private key type" here mean to the CLI operator?
- Please write the default behaviour, and the available choices.
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.
Thank you. I will fix the above.
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.
By specifying the priv_key_type=composite, set priv_key.type
in the file(.linkd/config/priv_validator.json) to tendermint/PrivKeyComposite
when initializing or creating the validator. By default, priv_key.type
is set to tendermint/PrivKeyEd25519
. So, I willl write this explanation.
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 fixed. PTAL.
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 think it's still lack of explanation. I think the description should show what arguments we could input. Here is a sample description from code.
"Select keyring's backend (os|file|test)"
With current description, I couldn't know what arguments I could input.
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.
Thank you both. I added a description of the default value ed25519
and what arguments we could input.
x/genutil/client/cli/gentx.go
Outdated
@@ -190,6 +190,7 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm | |||
cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") | |||
viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend)) | |||
|
|||
cmd.Flags().String(flags.FlagPrivKeyType, flags.DefaultPrivKeyType, "Select private key type") |
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.
ditto. (The item above it seems to begin with an upper case..?)
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.
Looking at the other flag descriptions, some start with a uppercase letter and some start with a lowercase letter. It doesn't seem to be unified. This time I will make it lowercase.
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 fixed. PTAL.
x/genutil/client/cli/init.go
Outdated
@@ -121,6 +121,7 @@ func InitCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, | |||
cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory") | |||
cmd.Flags().BoolP(flagOverwrite, "o", false, "overwrite the genesis.json file") | |||
cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") | |||
cmd.Flags().String(flags.FlagPrivKeyType, flags.DefaultPrivKeyType, "Select private key type") |
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.
ditto
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 fixed. PTAL.
I found that |
@@ -62,13 +62,15 @@ const ( | |||
FlagKeyringBackend = "keyring-backend" | |||
FlagPage = "page" | |||
FlagLimit = "limit" | |||
FlagPrivKeyType = "priv_key_type" |
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 think priv-key-type
is better in terms of following local convention. Please note that all other flags
use -
as a delimiter but not _
.
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.
Thank you. I think so too, but since it is bound to the key name of the tendermint config file and is delimited by underscores _
in tendermint, I had no choice but to do this.
Have a look at this:
Finschia/ostracon#125
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.
W/ Finschia/ostracon#125, I don't have confidence but it looks like tendermint
already uses priv-key-type
in the PR code even though the PR description shows priv_key_type
.
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.
@egonspace Please could you double check it?
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.
After that, it seems that it was changed to an underscore_
here. Please check it. @egonspace
Finschia/ostracon@b6420bc
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've got it. But, IMHO, I think we need to keep consistency even though revising tendermint
as well if needed. I hope it's revised in the future.
I can not find where to use the flag. Will it be added to the next PR? |
Yes, it will be added to the next PR |
Oh, I see. Thank for your answer. |
The same settings are required for each of the |
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.
LGTM 👍
a4ef89b
into
Finschia:v0.38.5-0.1.0-linking_link_with_line_consensus
Description
FlagPrivKeyType
is added to theflags.go
.Motivation and context
This flag is required when issuing a transaction with the privatekey type set to
composite
. This flag is used by setting it in the command with link.How has this been tested?
Please set and execute as follows in the link project.
Describe the
go.mod
file of link as follows.:And this command:
Checklist:
Ref:
Finschia/ostracon#125
https://github.com/line/link/issues/1111
https://github.com/line/link/pull/1133