Repository navigation
feat(consensus/keys): add consensus keys init - #1200
Draft
leninmehedy wants to merge 1 commit into
Draft
leninmehedy wants to merge 1 commit into
leninmehedy wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
leninmehedy
added this pull request to stack #1201
September 26, 2026 14:44
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
September 29, 2026 05:13
33a53e1 to
37dafc9
Compare
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 06:27
37dafc9 to
f8c7fc2
Compare
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 10:33
f8c7fc2 to
4978e78
Compare
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 11:06
4978e78 to
3a0cd47
Compare
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 11:29
3a0cd47 to
1012dbd
Compare
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 12:37
1012dbd to
276e5c6
Compare
Add the one-shot init verb: generate a node's key material into --keys-dir and create the per-node secrets from it, reusing the generate and import code paths (no new key logic). - `consensus keys init --node-id N --keys-dir DIR` (node-id required): generate then import. Pass-through flags: --identity, --machine-id, --admin-algo, --gossip/--tls/--admin selectors, --force. - Idempotent: an existing key type in --keys-dir is kept (not regenerated), and re-applying identical secrets is a no-op; --force regenerates and overwrites differing material. - Admin private key stays in --keys-dir (operator custody); only the public key is pushed to Kubernetes. - For a DAB join (node-id unknown until assigned) use generate + import separately instead. Refs #1195 Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
leninmehedy
force-pushed
the
01195-consensus-keys-init
branch
from
October 13, 2026 12:52
276e5c6 to
57cfa24
Compare
leninmehedy
marked this pull request as draft
October 20, 2026 06:24
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fifth PR in the stacked series for epic #1164 — Consensus Node Key & Secret Management. Stacked on #1199 (base branch
01168-consensus-keys-verify).Adds the one-shot
consensus keys initverb — generate a node's key material and create its Kubernetes secrets in a single command — plus makes generation/import/export idempotent with an audit trail.What's in it
consensus keys init --node-id N --keys-dir DIR— runsgeneratethenimport, reusing the exact same code paths (no new key logic). The output names the exact secrets created. Pass-through flags:--identity,--machine-id,--admin-algo,--grpc-cn,--grpc-org,--grpc-dns,--grpc-ip,--grpc-validity-days,--gossip/--tls/--admin,--force. For a DAB join (node-id unknown until assigned) usegenerate+importseparately.generate/initkeep an existing key type in--keys-dirinstead of regenerating (protecting the gossip identity);--forceregenerates.importre-applies identical material as a no-op and refuses a secret whose material differs without--force.exportleaves identical files untouched and refuses to clobber differing files without--force.--keys-dir(operator custody); only the public key reaches Kubernetes.Files
cmd/cli/commands/consensus/keys/init.goinitsubcommand (generate + import, idempotent)cmd/cli/commands/consensus/keys/init_test.gocmd/cli/commands/consensus/keys/keys.goinitdocs/commands/consensus.mdinitsectionTesting
Validated in the UTM VM:
All pass.
Update: the new gRPC certificate options were added after the VM run above. Their tests pass for
pkg/internalon macOS and the command tests compile for Linux, but they still need a VM run.Closes #1195.