fn testnet_genesis(
    wasm_binary: &[u8],
    initial_authorities: Vec<(
        AccountId,
        AccountId,
        GrandpaId,
        BabeId,
        ImOnlineId,
        AuthorityDiscoveryId,
    )>,
    _root_key: AccountId,
    endowed_accounts: Vec<AccountId>,
    _enable_println: bool,
) -> GenesisConfig {
    const ENDOWMENT: u128 = 1_000_000 * CALS;
    const STASH: u128 = 20_000 * CALS;
	let num_endowed_accounts = endowed_accounts.len();
    GenesisConfig {
        pallet_sudo: Some(SudoConfig {
            key: endowed_accounts[0].clone(),
        }),
        frame_system: Some(SystemConfig {
            code: wasm_binary.to_vec(),
            changes_trie_config: Default::default(),
        }),
        balances: Some(BalancesConfig {
            balances: endowed_accounts
                .iter()
                .cloned()
                .map(|k| (k, ENDOWMENT))
                .collect(),
        }),
        pallet_indices: Some(IndicesConfig {
            indices: vec![],
        }),
        pallet_session: Some(SessionConfig {
            keys: initial_authorities
                .iter()
                .map(|x| {
                    (
                        x.0.clone(),
                        x.0.clone(),
                        session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()),
                    )
                })
                .collect::<Vec<_>>(),
        }),
        staking: Some(StakingConfig {
            validator_count: 4,
            minimum_validator_count: 1,
            stakers: initial_authorities
                .iter()
                .map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
                .collect(),
            invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
            force_era: Forcing::NotForcing,
            slash_reward_fraction: Perbill::from_percent(10),
            ..Default::default()
        }),
        murphy: Some(Default::default()),
        pallet_babe: Some(Default::default()),
        pallet_grandpa: Some(Default::default()),
        pallet_im_online: Some(Default::default()),
        pallet_authority_discovery: Some(AuthorityDiscoveryConfig {
            keys: vec![]
        }),
        tars: Some(TarsConfig {
            code: vec![]
        }),
        pallet_collective_Instance1: Some(CouncilConfig::default()),
        pallet_treasury: Some(Default::default()),
        pallet_elections_phragmen: Some(ElectionsConfig {
			members: endowed_accounts.iter()
						.take((num_endowed_accounts + 1) / 2)
						.cloned()
						.map(|member| (member, STASH))
						.collect(),
		}),
        pallet_collective_Instance2: Some(TechnicalCommitteeConfig {
            members: endowed_accounts.iter()
                .take((num_endowed_accounts + 1) / 2)
                .cloned()
                .collect(),
            phantom: Default::default(),
        }),
        pallet_democracy: Some(DemocracyConfig::default()),
        pallet_membership_Instance1: Some(Default::default()),
    }
}
/// The genesis spec of calcu dev/local test network
The genesis spec of calcu dev/local test network
The genesis spec of calcu dev / local test network
fn testnet_genesis(
    wasm_binary: &[u8],
    initial_authorities: Vec<(
        AccountId,
        AccountId,
        GrandpaId,
        BabeId,
        ImOnlineId,
        AuthorityDiscoveryId,
    )>,
    _root_key: AccountId,
    endowed_accounts: Vec<AccountId>,
    _enable_println: bool,
) -> GenesisConfig {
    const ENDOWMENT: u128 = 1_000_000 * CALS;
    const STASH: u128 = 20_000 * CALS;
	let num_endowed_accounts = endowed_accounts.len();
    GenesisConfig {
        pallet_sudo: Some(SudoConfig {
            key: endowed_accounts[0].clone(),
        }),
        frame_system: Some(SystemConfig {
            code: wasm_binary.to_vec(),
            changes_trie_config: Default::default(),
        }),
        balances: Some(BalancesConfig {
            balances: endowed_accounts
                .iter()
                .cloned()
                .map(|k| (k, ENDOWMENT))
                .collect(),
        }),
        pallet_indices: Some(IndicesConfig {
            indices: vec![],
        }),
        pallet_session: Some(SessionConfig {
            keys: initial_authorities
                .iter()
                .map(|x| {
                    (
                        x.0.clone(),
                        x.0.clone(),
                        session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()),
                    )
                })
                .collect::<Vec<_>>(),
        }),
        staking: Some(StakingConfig {
            validator_count: 4,
            minimum_validator_count: 1,
            stakers: initial_authorities
                .iter()
                .map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
                .collect(),
            invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
            force_era: Forcing::NotForcing,
            slash_reward_fraction: Perbill::from_percent(10),
            ..Default::default()
        }),
        murphy: Some(Default::default()),
        pallet_babe: Some(Default::default()),
        pallet_grandpa: Some(Default::default()),
        pallet_im_online: Some(Default::default()),
        pallet_authority_discovery: Some(AuthorityDiscoveryConfig {
            keys: vec![]
        }),
        tars: Some(TarsConfig {
            code: vec![]
        }),
        pallet_collective_Instance1: Some(CouncilConfig::default()),
        pallet_treasury: Some(Default::default()),
        pallet_elections_phragmen: Some(ElectionsConfig {
			members: endowed_accounts.iter()
						.take((num_endowed_accounts + 1) / 2)
						.cloned()
						.map(|member| (member, STASH))
						.collect(),
		}),
        pallet_collective_Instance2: Some(TechnicalCommitteeConfig {
            members: endowed_accounts.iter()
                .take((num_endowed_accounts + 1) / 2)
                .cloned()
                .collect(),
            phantom: Default::default(),
        }),
        pallet_democracy: Some(DemocracyConfig::default()),
        pallet_membership_Instance1: Some(Default::default()),
    }
}
fn testnet_genesis ( wasm_binary : & [ u8 ] , initial_authorities : Vec < ( AccountId , AccountId , GrandpaId , BabeId , ImOnlineId , AuthorityDiscoveryId , ) > , _root_key : AccountId , endowed_accounts : Vec < AccountId > , _enable_println : bool , ) -> GenesisConfig { const ENDOWMENT : u128 = 1_000_000 * CALS ; const STASH : u128 = 20_000 * CALS ; let num_endowed_accounts = endowed_accounts . len ( ) ; GenesisConfig { pallet_sudo : Some ( SudoConfig { key : endowed_accounts [ 0 ] . clone ( ) , } ) , frame_system : Some ( SystemConfig { code : wasm_binary . to_vec ( ) , changes_trie_config : Default :: default ( ) , } ) , balances : Some ( BalancesConfig { balances : endowed_accounts . iter ( ) . cloned ( ) . map ( | k | ( k , ENDOWMENT ) ) . collect ( ) , } ) , pallet_indices : Some ( IndicesConfig { indices : vec ! [ ] , } ) , pallet_session : Some ( SessionConfig { keys : initial_authorities . iter ( ) . map ( | x | { ( x . 0 . clone ( ) , x . 0 . clone ( ) , session_keys ( x . 2 . clone ( ) , x . 3 . clone ( ) , x . 4 . clone ( ) , x . 5 . clone ( ) ) , ) } ) . collect :: < Vec < _ > > ( ) , } ) , staking : Some ( StakingConfig { validator_count : 4 , minimum_validator_count : 1 , stakers : initial_authorities . iter ( ) . map ( | x | ( x . 0 . clone ( ) , x . 1 . clone ( ) , STASH , StakerStatus :: Validator ) ) . collect ( ) , invulnerables : initial_authorities . iter ( ) . map ( | x | x . 0 . clone ( ) ) . collect ( ) , force_era : Forcing :: NotForcing , slash_reward_fraction : Perbill :: from_percent ( 10 ) , .. Default :: default ( ) } ) , murphy : Some ( Default :: default ( ) ) , pallet_babe : Some ( Default :: default ( ) ) , pallet_grandpa : Some ( Default :: default ( ) ) , pallet_im_online : Some ( Default :: default ( ) ) , pallet_authority_discovery : Some ( AuthorityDiscoveryConfig { keys : vec ! [ ] } ) , tars : Some ( TarsConfig { code : vec ! [ ] } ) , pallet_collective_Instance1 : Some ( CouncilConfig :: default ( ) ) , pallet_treasury : Some ( Default :: default ( ) ) , pallet_elections_phragmen : Some ( ElectionsConfig { members : endowed_accounts . iter ( ) . take ( ( num_endowed_accounts + 1 ) / 2 ) . cloned ( ) . map ( | member | ( member , STASH ) ) . collect ( ) , } ) , pallet_collective_Instance2 : Some ( TechnicalCommitteeConfig { members : endowed_accounts . iter ( ) . take ( ( num_endowed_accounts + 1 ) / 2 ) . cloned ( ) . collect ( ) , phantom : Default :: default ( ) , } ) , pallet_democracy : Some ( DemocracyConfig :: default ( ) ) , pallet_membership_Instance1 : Some ( Default :: default ( ) ) , } }
The genesis spec of calcu dev/local test network
The genesis spec of calcu dev / local test network
wasm_binary
&[u8]
initial_authorities
Vec<(
        AccountId,
        AccountId,
        GrandpaId,
        BabeId,
        ImOnlineId,
        AuthorityDiscoveryId,
    )>
_root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool