2

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
  • Please clarify what you mean by CustomSpec Jun 8, 2023 at 8:44

1 Answer 1

3

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.

3
  • 1
    I already know this thing. Can you please tell me How can i add nominators account in customSpec? Jun 8, 2023 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
    – Simson
    Jun 8, 2023 at 11:50
  • 1
    @ArunjotSingh aha I see did my edit answer your question?
    – Simson
    Jun 9, 2023 at 0:29

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.