astar_collator/parachain/chain_spec/
astar.rs

1// This file is part of Astar.
2
3// Copyright (C) Stake Technologies Pte.Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later
5
6// Astar is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// Astar is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with Astar. If not, see <http://www.gnu.org/licenses/>.
18
19//! Astar chain specifications.
20
21use super::Extensions;
22use astar_primitives::parachain::ASTAR_ID;
23use astar_runtime::wasm_binary_unwrap;
24use sc_service::ChainType;
25
26/// Specialized `ChainSpec` for Astar Network.
27pub type AstarChainSpec = sc_service::GenericChainSpec<Extensions>;
28
29/// Get Astar chain specification.
30pub fn get_chain_spec() -> AstarChainSpec {
31    let mut properties = serde_json::map::Map::new();
32    properties.insert("tokenSymbol".into(), "ASTR".into());
33    properties.insert("tokenDecimals".into(), 18.into());
34
35    AstarChainSpec::builder(
36        wasm_binary_unwrap(),
37        Extensions {
38            bad_blocks: Default::default(),
39            relay_chain: "paseo".into(),
40            para_id: ASTAR_ID,
41        },
42    )
43    .with_name("Astar Testnet")
44    .with_id("astar")
45    .with_chain_type(ChainType::Development)
46    .with_properties(properties)
47    .with_genesis_config(astar_runtime::genesis_config::default_config(ASTAR_ID))
48    .build()
49}