Skip to content

Commit 2b654ab

Browse files
committed
feat(cli): add automatic-generate-keys command and improve key generation UX
- Introduced command to partner-chains-cli: - Generates and saves session keys by connecting to a running node via RPC () - Decodes session keys using the runtime API, supports modern and legacy formats, and saves to keystore and JSON - Provides fallback and error handling for various runtime formats - Integrated the new command into the CLI as an alternative to for all roles (Governance Authority, Registered Validator, Permissioned Validator) - Updated CLI help message and workflow documentation to clearly present both key generation methods and when to use each - Added comprehensive test suite for SCALE decoding and key handling logic - Updated changelog with details of the new feature and related improvements - Updated Cargo.toml and workspace dependencies for , (with serde), and related requirements
1 parent 4012015 commit 2b654ab

File tree

7 files changed

+612
-18
lines changed

7 files changed

+612
-18
lines changed

Cargo.lock

Lines changed: 204 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ sqlx = { version = "0.8.6", default-features = false, features = [
185185
] }
186186
derive-where = { version = "1.2.7", default-features = false }
187187
once_cell = { version = "1.21.3", default-features = false }
188+
reqwest = { version = "0.11", features = ["json"] }
189+
indexmap = { version = "2.0", features = ["serde"] }
188190

189191
# substrate dependencies
190192
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506" }

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ This changelog is based on [Keep A Changelog](https://keepachangelog.com/en/1.1.
44

55
# Unreleased
66

7+
## Added
8+
9+
* New `automatic-generate-keys` command in `partner-chains-cli`:
10+
* Allows users to generate and save session keys by connecting to a running node via RPC (`author_rotateKeys`).
11+
* Decodes session keys using the runtime API and saves them to the keystore and `partner-chains-public-keys.json`.
12+
* Provides fallback and error handling for various runtime formats.
13+
* Fully integrated into the CLI as an alternative to `generate-keys` for all roles (Governance Authority, Registered Validator, Permissioned Validator).
14+
* Comprehensive test suite for SCALE decoding and key handling logic.
15+
* Help message and workflow documentation updated to show both key generation methods and when to use each.
16+
717
## Changed
818

919
* Switched from `polkadot-stable2503-07` to `polkadot-stable2506`. `type RuntimeEvent` became deprecated in polkadot-sdk. It has been removed from the toolkit crates. To update to this version of PC toolkit, please remove definition of `type RuntimeEvent` when wiring in runtime.

toolkit/partner-chains-cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pallet-governed-map = { workspace = true, features = ["std"] }
4848
sp-governed-map = { workspace = true, features = ["std"] }
4949
sidechain-slots = { workspace = true }
5050
authority-selection-inherents = { workspace = true, features = ["std"] }
51+
reqwest = { workspace = true }
52+
indexmap = { workspace = true }
53+
parity-scale-codec = { workspace = true }
5154

5255
[dev-dependencies]
5356
frame-system = { workspace = true }

0 commit comments

Comments
 (0)