-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchain_spec.rs
More file actions
30 lines (27 loc) · 1.05 KB
/
chain_spec.rs
File metadata and controls
30 lines (27 loc) · 1.05 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
use griffin_partner_chains_runtime::genesis::get_genesis_config;
use griffin_partner_chains_runtime::WASM_BINARY;
use sc_service::ChainType;
/// This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec;
pub fn development_config(genesis_json: String) -> Result<ChainSpec, String> {
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?,
None,
)
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(serde_json::json!(get_genesis_config(genesis_json)))
.build())
}
pub fn local_testnet_config(genesis_json: String) -> Result<ChainSpec, String> {
Ok(ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?,
None,
)
.with_name("Local Testnet")
.with_id("local_testnet")
.with_chain_type(ChainType::Local)
.with_genesis_config_patch(serde_json::json!(get_genesis_config(genesis_json)))
.build())
}