Skip to content

Commit

Permalink
Merge pull request #110 from web3labs/spec-load
Browse files Browse the repository at this point in the history
Spec load for kusama as well as staging rococo
  • Loading branch information
mohamedelshami authored Jul 14, 2022
2 parents eba9da6 + 0f0750f commit bd0faa5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 443 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = 'https://substrate.dev'
license = 'Apache-2.0'
name = 'ice-node'
repository = 'https://github.com/web3labs/ice-substrate'
version = '0.4.50'
version = '0.4.51'
publish = false

[package.metadata.docs.rs]
Expand Down
16 changes: 14 additions & 2 deletions node/src/chain_spec/snow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ pub fn testnet_spec() -> SnowChainSpec {
let endowed_accounts = vec![
(
hex!["10b3ae7ebb7d722c8e8d0d6bf421f6d5dbde8d329f7c905a201539c635d61872"].into(),
ICY * 630000000,
ICY * 931000000,
),
(
TreasuryPalletId::get().into_account_truncating(),
ICY * 1170000000,
ICY * 1729000000,
),
(
hex!["6f38cb15a6ec17a68f2aec60d2cd8cd15e58b4e33ee7f705d1cbcde07009d33f"].into(),
Expand Down Expand Up @@ -293,3 +293,15 @@ pub fn get_authority_keys_from_seed(seed: &str) -> (AccountId, AuraId) {
fn session_keys(aura: AuraId) -> SessionKeys {
SessionKeys { aura }
}

pub fn snow_kusama_config() -> Result<SnowChainSpec, String> {
sc_chain_spec::GenericChainSpec::from_json_bytes(
&include_bytes!("../../../resources/snow-kusama.json")[..],
)
}

pub fn snow_staging_rococo_config() -> Result<SnowChainSpec, String> {
sc_chain_spec::GenericChainSpec::from_json_bytes(
&include_bytes!("../../../resources/snow-staging-rococo.json")[..],
)
}
3 changes: 3 additions & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use sp_core::hexdisplay::HexDisplay;
use sp_runtime::traits::Block as BlockT;
use std::{io::Write, net::SocketAddr};

use crate::chain_spec::snow::{snow_kusama_config, snow_staging_rococo_config};
#[cfg(feature = "runtime-benchmarks")]
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};

Expand Down Expand Up @@ -64,6 +65,8 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, St
"arctic" => Box::new(chain_spec::arctic::get_chain_spec()),
"snow-dev" => Box::new(chain_spec::snow::get_dev_chain_spec()),
"snow-testnet" => Box::new(chain_spec::snow::testnet_spec()),
"snow-kusama" => Box::new(snow_kusama_config()?),
"snow-staging-rococo" => Box::new(snow_staging_rococo_config()?),

path => {
let chain_spec = chain_spec::snow::SnowChainSpec::from_json_file(path.into())?;
Expand Down
Loading

0 comments on commit bd0faa5

Please sign in to comment.