2

I was following the substate documentation of authorize specific nodes tutorial

referance:-https://docs.substrate.io/tutorials/build-a-blockchain/authorize-specific-nodes/

In the add genesis storage for authorized nodes I want to add different nodes other than the predefined nodes(ALICE AND BOB) as authorized nodes so using the subkey I generated two keys for two nodes ec1 and ec2 and tried to add their peerid and account id as argument as in the figure attached

added custom peerid and account id inplace of BOB and ALICE accounts

but it is giving the following error:

Error in the account id

Please kindly help ....how to fix it?

2 Answers 2

1

The second parameter you are giving is not in right format you can do it in two was:

  1. Change the endowed accounts and use it that account endowed_accounts[0].clone() like this on the place of 0 you can right the index of your on which you have added the endowed index.
  2. The other way is to add the account that you want add in the customSpec.json before make the customSpecRaw.json file.
1

https://github.com/paritytech/substrate/blob/f4a2e84ee5974b219f2a03cd195105060c41e3cd/frame/node-authorization/src/lib.rs#L113

https://docs.rs/array-bytes/6.1.0/array_bytes/fn.hex2bytes_unchecked.html

The correct type is Vec<(PeerId, T::AccountId)>.

But here is what you passed to: Vec<PeerId, integer)>.

You should do:

OpaquePeerId(
  ss58::decode(...).into_vec().unwrap(),
  array_bytes::hex2bytes_unchecked("your account id in hex format here, e.g. 0x..."),
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.