Skip to content

Commit

Permalink
add chain spec into polkadot parachain (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmyyrroonn committed Mar 1, 2023
1 parent de3be72 commit 36cc55e
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
91 changes: 91 additions & 0 deletions crust-collator/res/polkadot-init.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions crust-collator/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
.public()
}

pub fn polkadot_parachain_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(&include_bytes!("../res/polkadot-init.json")[..])
}

/// Generate collator keys from seed.
///
/// This function's return type must always match the session keys of the chain in tuple format.
Expand Down
1 change: 1 addition & 0 deletions crust-collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn load_spec(
"2008" => Ok(Box::new(chain_spec::get_chain_spec(2008.into()))),
"2012" => Ok(Box::new(chain_spec::get_chain_spec(2012.into()))),
"staging" => Ok(Box::new(chain_spec::staging_test_net(2012.into()))),
"crust-parachain" => Ok(Box::new(chain_spec::polkadot_parachain_config()?)),
path => Ok(Box::new(chain_spec::ChainSpec::from_json_file(
path.into(),
)?)),
Expand Down

0 comments on commit 36cc55e

Please sign in to comment.