Reputation: 4442
I am running a private chain with 2 local nodes using custom accounts and keys.
Peer discovery works, but blocks are not being finalized.
Idle (1 peers), best: #0 (0xb166…8ad2), finalized #0 (0xb166…8ad2),
Idle (1 peers), best: #0 (0xb166…8ad2), finalized #0 (0xb166…8ad2),
...
In chain_spec.rs
:
Create a new set of accounts from Armstrong, Armstrong//stash, Aldrin, Aldrin//stash seeds the way it is done in the bin/node :
AccountPublic::from(sp_core::Public::Pair::from_string(seed)).into_account()
Set the initial authorities to the controller accounts Armstrong and Aldrin.
Create the SessionKeys
for the initial authorities.
BalancesConfig
: endow some balances for each account.
SessionConfig
: use the SessionKeys
I just created.
StakingConfig
: set the stakers
as a 4-tuple containing (stash, controlller, amount, StakerStatus::Validator)
This results in a build-spec like:
palletSession
{
"keys": [
[
"<STASH_ID>",
{
"grandpa": "...",
"babe": "<CONTROLLER_ID>",
"im_online": "<CONTROLLER_ID>",
"authority_discovery": "<CONTROLLER_ID>"
}
],
[
"<STASH_ID>",
{
"grandpa": "...",
"babe": "<CONTROLLER_ID>",
"im_online": "<CONTROLLER_ID>",
"authority_discovery": "<CONTROLLER_ID>"
}
]
]
}
palletStaking
"stakers": [
[
"<STASH_ID>",
"<CONTROLLER_ID>",
<STASH_AMOUNT>,
"Validator"
],
[
"<STASH_ID>",
"<CONTROLLER_ID>",
<STASH_AMOUNT>,
"Validator"
]
]
No funds staked yet. Bond funds to validate or nominate a validator
message:Upvotes: 4
Views: 1189
Reputation: 9
Upvotes: 1