Registry / config / sc-chain-spec

sc-chain-spec

JSON →
library50.0.0rscratesunverified

Defines chain configurations for Substrate-based blockchains, including genesis state, bootnodes, and protocol parameters.

# Cargo.toml [dependencies] sc-chain-spec = "50.0.0"
INSTALL
IMPORT
SIG · SC-CHAIN-SPEC
S
sc-chain-spec
configrustv50.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ChainSpec
use sc_chain_spec::ChainSpec;

Loads a chain specification from a JSON file and prints the chain name.

use sc_chain_spec::ChainSpec; fn main() { // Example: loading a chain spec from a JSON file let spec = ChainSpec::from_json_file("chain_spec.json").expect("Failed to load chain spec"); println!("Chain name: {}", spec.name()); }
Debug
Known issues
breakingChain spec format can change between Substrate versions; loading an incompatible spec may panic.
fix
Ensure the chain spec JSON matches the version of `sc-chain-spec` you are using. Regenerate specs with the same Substrate version.
affects: >= 50.0.0
Upgrade
Version history
50.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
36
OpenAI (training)
1
Resources
sc-chain-spec — cargo add sc-chain-spec · libregistry