Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a second development chain spec for testing in with the integritee-workers #187

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,59 @@ pub fn development_config() -> Result<ChainSpec, String> {
))
}

pub fn development_config2() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
"Integritee Development (Solo2)",
// ID
"integritee-solo-dev2",
ChainType::Development,
move || {
genesis_config(
wasm_binary,
// Initial PoA authorities
vec![authority_keys_from_seed("Alice")],
// Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
// Pre-funded accounts
vec![
(get_account_id_from_seed::<sr25519::Public>("Alice"), 2_000 * TEER),
(get_account_id_from_seed::<sr25519::Public>("Bob"), 2_000 * TEER),
(get_account_id_from_seed::<sr25519::Public>("Charlie"), 2_000 * TEER),
(TreasuryPalletId::get().into_account_truncating(), 2_000 * TEER),
(
multisig_account(
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
],
2,
),
1_000 * TEER,
),
],
true,
)
},
// Bootnodes
vec![],
// Telemetry
None,
// Protocol ID
Some("teer"),
// Arbitrary string. Nodes will only synchronize with other nodes that have the same value
// in their `fork_id`. This can be used in order to segregate nodes in cases when multiple
// chains have the same genesis hash.
None,
// Properties
Some(teer_properties()),
// Extensions
None,
))
}

pub fn local_testnet_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
Expand Down
1 change: 1 addition & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"dev2" => Box::new(chain_spec::development_config2()?),
"dev" => Box::new(chain_spec::development_config()?),
"integritee-solo-fresh" => Box::new(chain_spec::integritee_solo_fresh_config()?),
"integritee-solo" => Box::new(chain_spec::integritee_solo_config()?),
Expand Down
Loading