frequency_service/chain_spec/
frequency_westend_local.rs

1#![allow(missing_docs)]
2use common_runtime::constants::{FREQUENCY_TESTNET_TOKEN, TOKEN_DECIMALS};
3use frequency_runtime::Ss58Prefix;
4use polkadot_service::chain_spec::Extensions as RelayChainExtensions;
5use sc_service::ChainType;
6
7use super::{get_properties, Extensions};
8
9/// Specialized `ChainSpec` for the normal parachain runtime.
10pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
11
12// Generic chain spec, in case when we don't have the native runtime.
13pub type RelayChainSpec = sc_service::GenericChainSpec<RelayChainExtensions>;
14
15/// Generates the chain spec for a local testnet
16pub fn westend_local_config() -> ChainSpec {
17	// Give your base currency a unit name and decimal places
18	let properties =
19		get_properties(FREQUENCY_TESTNET_TOKEN, TOKEN_DECIMALS as u32, Ss58Prefix::get().into());
20
21	ChainSpec::builder(
22		frequency_runtime::wasm_binary_unwrap(),
23		Extensions {
24			relay_chain: "westend-local".into(), // You MUST set this to the correct network!
25			para_id: 2000,
26		},
27	)
28	.with_name("Frequency Local Westend Testnet")
29	.with_id("frequency-westend-local")
30	.with_protocol_id("frequency-westend-local")
31	.with_properties(properties)
32	.with_chain_type(ChainType::Local)
33	.with_genesis_config_preset_name("frequency-westend-local")
34	.build()
35}