referrerpolicy=no-referrer-when-downgrade

polkadot_parachain/chain_spec/
penpal.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3// SPDX-License-Identifier: Apache-2.0
4
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// 	http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17use cumulus_primitives_core::ParaId;
18use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec};
19use sc_service::ChainType;
20
21pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> GenericChainSpec {
22	// Give your base currency a unit name and decimal places
23	let mut properties = sc_chain_spec::Properties::new();
24	properties.insert("tokenSymbol".into(), "UNIT".into());
25	properties.insert("tokenDecimals".into(), 12u32.into());
26	properties.insert("ss58Format".into(), 42u32.into());
27
28	GenericChainSpec::builder(
29		penpal_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
30		Extensions::new_with_relay_chain(relay_chain.into()),
31	)
32	.with_name("Penpal Parachain")
33	.with_id(&format!("penpal-{}", relay_chain.replace("-local", "")))
34	.with_chain_type(ChainType::Local)
35	.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
36	.with_genesis_config_patch(serde_json::json!({
37		"parachainInfo": {
38			"parachainId": id,
39		},
40	}))
41	.build()
42}