2

I was referring the substrate documentation on preparing a local relay chain . The documentation has provided a sample plain chain spec with two validators Alice and Bob. I need to hardcode an additional validator. I think I need to add something like below in the keys array in the chain spec but I'm not exactly sure what would the values for beefy, granpa etc would be.

            [
          "5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc",
          "5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc",
          {
            "grandpa": "5GoNkf6WdbxCFnPdAnYYQyCjAKPJgLNxXwPjwTh6DGg6gN3E",
            "babe": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
            "im_online": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
            "para_validator": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
            "para_assignment": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
            "authority_discovery": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
          }
        ]

1 Answer 1

2

Within your chain_spec.rs file you can find the types for those keys.

In the linked example we have

initial_authorities: Vec<(AuraId, GrandpaId)>,

In you case you will just need to declare the type for each key that you are using.

Another example with more keys defined can be found here

/// Helper function to create RuntimeGenesisConfig for testing.
pub fn testnet_genesis(
    initial_authorities: Vec<(
        AccountId,
        AccountId,
        GrandpaId,
        BabeId,
        ImOnlineId,
        AuthorityDiscoveryId,
        MixnetId,
    )>,
    initial_nominators: Vec<AccountId>,
    root_key: AccountId,
    endowed_accounts: Option<Vec<AccountId>>,
) -> RuntimeGenesisConfig {
// snip
3
  • I am not sure if i understand this. I am referreing to the sample plain chain spec that has been provided in the documentation. I dont' think that this plain chainspec which is a json file is genereated from the node template for this specific example nor is the plain file generated from chain spec of the release i am using. Also i am not completely sure of what the type for keys would be .
    – RRR
    Commented Oct 31, 2023 at 11:47
  • I also checked the chain spec in the polkadot sdk. I think that in chain_spec.rs rococo_local_tesnet is configured for two validator and i would have to make some code changes to use one more validator.
    – RRR
    Commented Oct 31, 2023 at 12:13
  • And this is what they mean by hardcoding an additional validator and generating chainspec or i can use wococo since it is configured for more than two validators but then again i would need a wasm binary to generate the chainspec for wococo.
    – RRR
    Commented Oct 31, 2023 at 12:27

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.