9

The ChainSpec type has a from_genesis method which takes an Option<Properties>. This Properties object is:

/// Arbitrary properties defined in chain spec as a JSON object
pub type Properties = serde_json::map::Map<String, serde_json::Value>;

I can't find any documentation on the full list of the available keys for the ChainSpec properties and what they mean / do. Where can I find this?

2 Answers 2

6

The Properties field in the Chain Specification is intentionally arbitrary. As you see in the comment:

Arbitrary properties defined in chain spec as a JSON object

As a chain spec creator, you can add whatever you want in here, and it can be used by clients or libraries which are programmed to interpret that data.

At the time of writing this post, the "common" properties included with a chain spec are:

// from Kusama
"properties": {
    "ss58Format": 2,
    "tokenDecimals": 12,
    "tokenSymbol": "KSM"
}

These are used by Polkadot JS and other front-end libraries to improve the user experience, but are not strictly required.

1
  • 1
    In chains where there are multiple balance instances, the tokenDecimals and tokenSymbol can be arrays of values as well.
    – Barto
    Jul 13, 2022 at 7:05
-3

The chain spec docs link https://paritytech.github.io/substrate/master/sc_chain_spec/struct.GenericChainSpec.html#method.from_genesis

And do you know that you can produce a json file which is the chain_spec and check the keys using ... -build-spec command flag

Your Answer

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

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