-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathchain_spec.rs
More file actions
106 lines (95 loc) · 3.47 KB
/
chain_spec.rs
File metadata and controls
106 lines (95 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
use quantus_runtime::{
genesis_config_presets::{HEISENBERG_RUNTIME_PRESET, PLANCK_RUNTIME_PRESET},
WASM_BINARY,
};
use sc_service::{ChainType, Properties};
use sc_telemetry::TelemetryEndpoints;
use serde_json::json;
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec;
pub fn development_chain_spec() -> Result<ChainSpec, String> {
let mut properties = Properties::new();
properties.insert("tokenDecimals".into(), json!(12));
properties.insert("tokenSymbol".into(), json!("DEV"));
properties.insert("ss58Format".into(), json!(189));
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Quantus DevNet wasm not available".to_string())?,
None,
)
.with_name("Quantus DevNet")
.with_id("dev")
.with_protocol_id("quantus-devnet")
.with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_properties(properties)
.build())
}
/// Integration environment chain spec - internal use only.
pub fn heisenberg_chain_spec() -> Result<ChainSpec, String> {
let mut properties = Properties::new();
properties.insert("tokenDecimals".into(), json!(12));
properties.insert("tokenSymbol".into(), json!("HEI"));
properties.insert("ss58Format".into(), json!(189));
let telemetry_endpoints = TelemetryEndpoints::new(vec![(
"/dns/shard-telemetry.quantus.cat/tcp/443/x-parity-wss/%2Fsubmit%2F".to_string(),
0,
)])
.expect("Telemetry endpoints config is valid; qed");
let boot_nodes = vec![
"/dns/a1-p2p-heisenberg.quantus.cat/tcp/30333/p2p/Qmdts9fu3NCMFnvLdD1dHAHFer8EPzVDXxVnyPxRKA3Gkt"
.parse()
.unwrap(),
"/dns/a2-p2p-heisenberg.quantus.cat/tcp/30333/p2p/QmcKHndoiNRdiT6iVp6ugj8bNse5Vd5WmCoE9YWn9kNaTM"
.parse()
.unwrap(),
];
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Runtime wasm not available".to_string())?,
None,
)
.with_name("Heisenberg")
.with_id("heisenberg")
.with_protocol_id("heisenberg")
.with_boot_nodes(boot_nodes)
.with_telemetry_endpoints(telemetry_endpoints)
.with_chain_type(ChainType::Live)
.with_genesis_config_preset_name(HEISENBERG_RUNTIME_PRESET)
.with_properties(properties)
.build())
}
/// Planck network — live treasury signers + faucet; dev dilithium accounts for testing.
pub fn planck_chain_spec() -> Result<ChainSpec, String> {
let mut properties = Properties::new();
properties.insert("tokenDecimals".into(), json!(12));
properties.insert("tokenSymbol".into(), json!("PLK"));
properties.insert("ss58Format".into(), json!(189));
let telemetry_endpoints = TelemetryEndpoints::new(vec![(
"/dns/shard-telemetry.quantus.cat/tcp/443/x-parity-wss/%2Fsubmit%2F".to_string(),
0,
)])
.expect("Telemetry endpoints config is valid; qed");
let boot_nodes = vec![
"/dns/a1-p2p-planck.quantus.cat/tcp/30333/p2p/QmQ4AywkRZuv2L4XKb71Y3erk2DpQPNUTmMS2LGEEr5q8r"
.parse()
.unwrap(),
"/dns/a2-p2p-planck.quantus.cat/tcp/30333/p2p/QmZT5LVJjBWf3QeJY6JKcFY6bCJoWucji96pKwpgbfTgic"
.parse()
.unwrap(),
"/ip4/72.61.118.55/tcp/30333/p2p/QmbctLKQojifo6bym7a1ypph55n1nSw58YZGDkGtgRNVmF"
.parse()
.unwrap(),
];
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Runtime wasm not available".to_string())?,
None,
)
.with_name("Planck")
.with_id("planck")
.with_protocol_id("planck")
.with_boot_nodes(boot_nodes)
.with_telemetry_endpoints(telemetry_endpoints)
.with_chain_type(ChainType::Live)
.with_genesis_config_preset_name(PLANCK_RUNTIME_PRESET)
.with_properties(properties)
.build())
}