referrerpolicy=no-referrer-when-downgrade

polkadot_parachain/chain_spec/
asset_hubs.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 polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec};
18use sc_service::ChainType;
19
20pub fn asset_hub_westend_development_config() -> GenericChainSpec {
21	let mut properties = sc_chain_spec::Properties::new();
22	properties.insert("tokenSymbol".into(), "WND".into());
23	properties.insert("tokenDecimals".into(), 12.into());
24
25	GenericChainSpec::builder(
26		asset_hub_westend_runtime::WASM_BINARY
27			.expect("WASM binary was not built, please build it!"),
28		Extensions::new_with_relay_chain("westend".into()),
29	)
30	.with_name("Westend Asset Hub Development")
31	.with_id("asset-hub-westend-dev")
32	.with_chain_type(ChainType::Local)
33	.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
34	.with_properties(properties)
35	.build()
36}
37
38pub fn asset_hub_westend_local_config() -> GenericChainSpec {
39	let mut properties = sc_chain_spec::Properties::new();
40	properties.insert("tokenSymbol".into(), "WND".into());
41	properties.insert("tokenDecimals".into(), 12.into());
42
43	GenericChainSpec::builder(
44		asset_hub_westend_runtime::WASM_BINARY
45			.expect("WASM binary was not built, please build it!"),
46		Extensions::new_with_relay_chain("westend-local".into()),
47	)
48	.with_name("Westend Asset Hub Local")
49	.with_id("asset-hub-westend-local")
50	.with_chain_type(ChainType::Local)
51	.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
52	.with_properties(properties)
53	.build()
54}
55
56pub fn asset_hub_westend_config() -> GenericChainSpec {
57	let mut properties = sc_chain_spec::Properties::new();
58	properties.insert("tokenSymbol".into(), "WND".into());
59	properties.insert("tokenDecimals".into(), 12.into());
60
61	GenericChainSpec::builder(
62		asset_hub_westend_runtime::WASM_BINARY
63			.expect("WASM binary was not built, please build it!"),
64		Extensions::new_with_relay_chain("westend".into()),
65	)
66	.with_name("Westend Asset Hub")
67	.with_id("asset-hub-westend")
68	.with_chain_type(ChainType::Live)
69	.with_genesis_config_preset_name("genesis")
70	.with_properties(properties)
71	.build()
72}
73
74pub fn asset_hub_rococo_development_config() -> GenericChainSpec {
75	let mut properties = sc_chain_spec::Properties::new();
76	properties.insert("ss58Format".into(), 42.into());
77	properties.insert("tokenSymbol".into(), "ROC".into());
78	properties.insert("tokenDecimals".into(), 12.into());
79	asset_hub_rococo_like_development_config(
80		properties,
81		"Rococo Asset Hub Development",
82		"asset-hub-rococo-dev",
83	)
84}
85
86fn asset_hub_rococo_like_development_config(
87	properties: sc_chain_spec::Properties,
88	name: &str,
89	chain_id: &str,
90) -> GenericChainSpec {
91	GenericChainSpec::builder(
92		asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
93		Extensions::new_with_relay_chain("rococo-dev".into()),
94	)
95	.with_name(name)
96	.with_id(chain_id)
97	.with_chain_type(ChainType::Local)
98	.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
99	.with_properties(properties)
100	.build()
101}
102
103pub fn asset_hub_rococo_local_config() -> GenericChainSpec {
104	let mut properties = sc_chain_spec::Properties::new();
105	properties.insert("ss58Format".into(), 42.into());
106	properties.insert("tokenSymbol".into(), "ROC".into());
107	properties.insert("tokenDecimals".into(), 12.into());
108	asset_hub_rococo_like_local_config(
109		properties,
110		"Rococo Asset Hub Local",
111		"asset-hub-rococo-local",
112	)
113}
114
115fn asset_hub_rococo_like_local_config(
116	properties: sc_chain_spec::Properties,
117	name: &str,
118	chain_id: &str,
119) -> GenericChainSpec {
120	GenericChainSpec::builder(
121		asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
122		Extensions::new_with_relay_chain("rococo-local".into()),
123	)
124	.with_name(name)
125	.with_id(chain_id)
126	.with_chain_type(ChainType::Local)
127	.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
128	.with_properties(properties)
129	.build()
130}
131
132pub fn asset_hub_rococo_genesis_config() -> GenericChainSpec {
133	let mut properties = sc_chain_spec::Properties::new();
134	properties.insert("tokenSymbol".into(), "ROC".into());
135	properties.insert("tokenDecimals".into(), 12.into());
136	GenericChainSpec::builder(
137		asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
138		Extensions::new_with_relay_chain("rococo".into()),
139	)
140	.with_name("Rococo Asset Hub")
141	.with_id("asset-hub-rococo")
142	.with_chain_type(ChainType::Live)
143	.with_genesis_config_preset_name("genesis")
144	.with_properties(properties)
145	.build()
146}