Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chain spec into polkadot parachain #924

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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