diff --git a/Cargo.lock b/Cargo.lock index fb495de8f..1ea34c3e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1112,6 +1112,7 @@ dependencies = [ "pallet-referenda", "pallet-scheduler", "pallet-session", + "pallet-sudo", "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index b624a1406..6098171ae 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -19,8 +19,8 @@ use bifrost_polkadot_runtime::{ constants::currency::DOLLARS, AccountId, AssetRegistryConfig, Balance, BalancesConfig, BlockNumber, CollatorSelectionConfig, CouncilMembershipConfig, GenesisConfig, IndicesConfig, - ParachainInfoConfig, PolkadotXcmConfig, SS58Prefix, SalpConfig, SessionConfig, SystemConfig, - TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY, + ParachainInfoConfig, PolkadotXcmConfig, SS58Prefix, SalpConfig, SessionConfig, SudoConfig, + SystemConfig, TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY, }; use bifrost_runtime_common::AuraId; use cumulus_primitives_core::ParaId; @@ -46,7 +46,7 @@ pub fn ENDOWMENT() -> u128 { 1_000_000 * DOLLARS } -pub const PARA_ID: u32 = 2030; +pub const PARA_ID: u32 = 3356; fn bifrost_polkadot_properties() -> Properties { let mut properties = sc_chain_spec::Properties::new(); @@ -88,6 +88,11 @@ pub fn bifrost_polkadot_genesis( system: SystemConfig { code: WASM_BINARY.expect("WASM binary was not build, please build it!").to_vec(), }, + sudo: SudoConfig { + key: Some( + hex!["ae80aa9d42b30abf2c67510ed2410e76f749329606d1a79354b772dc73522d35"].into(), + ), + }, balances: BalancesConfig { balances }, indices: IndicesConfig { indices: vec![] }, democracy: Default::default(), @@ -191,21 +196,23 @@ pub fn development_config() -> Result { } fn local_config_genesis(id: ParaId) -> GenesisConfig { - let endowed_accounts = vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - whitelisted_caller(), // Benchmarking whitelist_account - account("bechmarking_account_1", 0, 0), + let endowed_accounts: Vec = vec![ + // get_account_id_from_seed::("Alice"), + // get_account_id_from_seed::("Bob"), + // get_account_id_from_seed::("Charlie"), + // get_account_id_from_seed::("Dave"), + // get_account_id_from_seed::("Eve"), + // get_account_id_from_seed::("Ferdie"), + // get_account_id_from_seed::("Alice//stash"), + // get_account_id_from_seed::("Bob//stash"), + // get_account_id_from_seed::("Charlie//stash"), + // get_account_id_from_seed::("Dave//stash"), + // get_account_id_from_seed::("Eve//stash"), + // get_account_id_from_seed::("Ferdie//stash"), + // whitelisted_caller(), // Benchmarking whitelist_account + // account("bechmarking_account_1", 0, 0), + hex!["ae80aa9d42b30abf2c67510ed2410e76f749329606d1a79354b772dc73522d35"].into(), + hex!["7ae247b6328d6cb9d11d49d76766568070ad56bb75ba1aa42c7b7df7cf703765"].into() ]; let balances = endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT())).collect(); let vestings = endowed_accounts @@ -217,10 +224,10 @@ fn local_config_genesis(id: ParaId) -> GenesisConfig { .iter() .flat_map(|x| vec![(x.clone(), Token2(DOT_TOKEN_ID), ENDOWMENT() * 4_000_000)]) .collect(); - let council_membership = vec![get_account_id_from_seed::("Alice")]; - let technical_committee_membership = vec![get_account_id_from_seed::("Alice")]; + let council_membership = vec![]; + let technical_committee_membership = vec![]; let salp_multisig: AccountId = - hex!["49daa32c7287890f38b7e1a8cd2961723d36d20baa0bf3b82e0c4bdda93b1c0a"].into(); + hex!["ae80aa9d42b30abf2c67510ed2410e76f749329606d1a79354b772dc73522d35"].into(); let currency = vec![ (Native(TokenSymbol::BNC), DOLLARS / 100, None), ( @@ -234,10 +241,15 @@ fn local_config_genesis(id: ParaId) -> GenesisConfig { bifrost_polkadot_genesis( vec![ ( - get_account_id_from_seed::("Alice"), - get_from_seed::("Alice"), + hex!["ae80aa9d42b30abf2c67510ed2410e76f749329606d1a79354b772dc73522d35"].into(), + hex!["ae80aa9d42b30abf2c67510ed2410e76f749329606d1a79354b772dc73522d35"] + .unchecked_into(), + ), + ( + hex!["7ae247b6328d6cb9d11d49d76766568070ad56bb75ba1aa42c7b7df7cf703765"].into(), + hex!["7ae247b6328d6cb9d11d49d76766568070ad56bb75ba1aa42c7b7df7cf703765"] + .unchecked_into(), ), - (get_account_id_from_seed::("Bob"), get_from_seed::("Bob")), ], balances, vestings, @@ -254,14 +266,14 @@ pub fn local_testnet_config() -> Result { Ok(ChainSpec::from_genesis( "Bifrost Polkadot Local Testnet", "bifrost_polkadot_local_testnet", - ChainType::Local, + ChainType::Live, move || local_config_genesis(PARA_ID.into()), vec![], - None, + TelemetryEndpoints::new(vec![(TELEMETRY_URL.into(), 0)]).ok(), Some(DEFAULT_PROTOCOL_ID), None, Some(bifrost_polkadot_properties()), - RelayExtensions { relay_chain: "polkadot-local".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID }, )) } diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 78f6e5b19..2a69b8bd0 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -67,6 +67,7 @@ pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/parityt pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } pallet-whitelist = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # Cumulus dependencies cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42", default-features = false } @@ -197,6 +198,7 @@ std = [ "pallet-session/std", "pallet-vesting/std", "pallet-whitelist/std", + "pallet-sudo/std", "bifrost-currencies/std", "orml-traits/std", "orml-tokens/std", diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 31c4e5cc6..83804d45d 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1464,6 +1464,11 @@ parameter_types! { pub const VoteWeightMultiplier: Balance = 3; } +impl pallet_sudo::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; +} + impl bifrost_ve_minting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; @@ -1596,6 +1601,7 @@ construct_runtime! { Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event} = 25, // Governance stuff Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 30,