I want to generate a customSpec.json
where i can manually add the accounts of the initial_nominators
. I've seen the code chain_spec.rs where we in the fn testnet_genesis there is initial nominators. How can we add this in customSpec.json
?
1 Answer
This is where you should start reading:
https://docs.substrate.io/build/chain-spec/
You have already found chain_spec.rs where there are a few functions
staging_testnet_config_genesis
and local_testnet_config
cosponsoring to the different chains defined as names like dev
local
or staging
(defined in command.rs).
At line 242 the vector initial_nominators
is defined and at line 384 it is called with an empty argument, fill this vector with something like
vec![authority_keys_from_seed("Bob")]
to get some initial nominators.
Then compile and run your node with argument --chain=staging
and save the output generated chainspec.
-
1I already know this thing. Can you please tell me How can i add nominators account in customSpec? Jun 8 at 10:07
-
You add the accounts in the chain_spec.rs and compile the code. Then you use the correct chain (the one you changed) to generate the json chain-spec– SimsonJun 8 at 11:50
-
1
CustomSpec