Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ETCM-411] Add optional param to generate more keys at once #812

Merged
merged 5 commits into from
Nov 25, 2020

Conversation

KonradStaniec
Copy link
Contributor

Description

Add possibility to generate n keys (ported from other project)

Copy link
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

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

Looks good, but what do you think about moving this functionality to CLI?

@KonradStaniec
Copy link
Contributor Author

one one side it makes sense, on the other side i know that Shay is using it in that format so it would be probably easier for him to use it that way without any learning curve and changes in tooling

Copy link
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

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

Ok, so maybe create a task to do that in the future. We could handle both methods at the same time. The cli will be more readable for the users

* priv-key-hex (32 bytes)
* pub-key-hex (64 bytes)
*
* Run:
* ./eckeygen > mantis-datadir/node.key
* ./eckeygen [n] > mantis-datadir/node.key
*
* to generate the private key for the node. Note that only the private key will be read upon Mantis boot,
Copy link
Contributor

@mirkoAlic mirkoAlic Nov 25, 2020

Choose a reason for hiding this comment

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

(minor) "[...] Note that only the first private key will be read upon Mantis boot"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually it is more general as even if we generate one pair, only the private key is read at boot time and then whole key pair is regenerated based on this key keyPairFromPrvKey(Hex.decode(privHex))

@KonradStaniec KonradStaniec force-pushed the etcm-411/improve-key-gen branch from abb12b3 to e513202 Compare November 25, 2020 11:59
@@ -27,6 +29,22 @@ object CliCommands {
}
}

private val GenerateKeyPairs: Command[String] =
Copy link
Contributor

@mmrozek mmrozek Nov 25, 2020

Choose a reason for hiding this comment

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

Please add a test case to CliCommandsSpec and update README

@KonradStaniec KonradStaniec force-pushed the etcm-411/improve-key-gen branch from e513202 to daa32c8 Compare November 25, 2020 12:38
@KonradStaniec KonradStaniec force-pushed the etcm-411/improve-key-gen branch from daa32c8 to 074ae4c Compare November 25, 2020 12:40
@KonradStaniec KonradStaniec merged commit 0bcd288 into develop Nov 25, 2020
@KonradStaniec KonradStaniec deleted the etcm-411/improve-key-gen branch November 25, 2020 14:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants