The Solution:
After trying a lot of things, I've found from an RPC call that there's 7 keys needed for each Validator node. Those are, gran
babe
imon
para
asgn
audi
beef
. And for each key-type there's a scheme, there's a table to reference.
Key-Type |
Scheme |
gran |
ed25519 |
babe |
sr25519 |
imon |
sr25519 |
para |
sr25519 |
asgn |
sr25519 |
audi |
sr25519 |
beef |
ecdsa |
Insert them like this,
./target/release/polkadot key insert \
--base-path <path for this validator> \
--chain <raw relay chainSpec> \
--scheme <see table> \
--suri "<mnemonic of this validator>" \
--key-type <see table>
Pay attention to the base-path
you're choosing, you need separate paths for different validators.
And to each path, you insert 7 keys using the same validators' private seed
.
Parachain Session Keys:
In the Para, run the node and specify a RPC port to make a call later on.
./target/release/<parachain binary> --collator \
--force-authoring \
--chain <raw parachainSpec> \
--base-path /tmp/<para>/<path> \
--port 40333 \
--ws-port 8844 \
--rpc-port 9022 \
--unsafe-ws-external \
--rpc-methods=unsafe \
--rpc-external \
--rpc-cors=all \
-- \
--execution wasm \
--chain relay-raw.json \
--port 30343 \
--ws-port 9977 \
--bootnodes /ip4/<relay bootnode ip>/tcp/30333/p2p/<bootnode peerId>
Using this command as an example, the port open for RPC was 9022 so the insert key call should be:
curl -vH 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["aura", "<private seed in hex>", "<public key in hex>"],"id":1 }' http://127.0.0.1:9022
The private and public key here should be the collator keys. And it's for aura. So it is using the sr25519
scheme.
And it's output:
* Connection #0 to host 127.0.0.1 left intact
{"jsonrpc":"2.0","result":null,"id":1}
--alice
, I think something could be wrong in the chain-spec. Can you trying with zombienet (github.com/paritytech/zombienet) ?