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 bifrost stage chain spec #467

Merged
merged 1 commit into from
Jan 26, 2022
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
3 changes: 3 additions & 0 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, St
#[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))]
"bifrost-local" | "bifrost-kusama-local" =>
Box::new(service::chain_spec::bifrost_kusama::local_testnet_config()?),
#[cfg(any(feature = "with-bifrost-kusama-runtime", feature = "with-bifrost-runtime"))]
"bifrost-stage" | "bifrost-kusama-stage" =>
Box::new(service::chain_spec::bifrost_kusama::stage_testnet_config()?),

#[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))]
"bifrost-polkadot" =>
Expand Down
63 changes: 63 additions & 0 deletions node/service/src/chain_spec/bifrost_kusama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,69 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
))
}

fn stage_config_genesis(id: ParaId) -> GenesisConfig {
let invulnerables: Vec<(AccountId, AuraId)> = vec![
(
// e2s2dTSWe9kHebF2FCbPGbXftDT7fY5AMDfib3j86zSi3v7
hex!["66204aeda74f07f77a4b6945681296763706f98d0f8aebb1b9ccdf6e9b7ac13f"].into(),
hex!["66204aeda74f07f77a4b6945681296763706f98d0f8aebb1b9ccdf6e9b7ac13f"]
.unchecked_into(),
),
(
// fFjUFbokagaDRQUDzVhDcMZQaDwQvvha74RMZnyoSWNpiBQ
hex!["9c2d45edb30d4bf0c285d6809e28c55e871f10578c5a3ea62da152d03761d266"].into(),
hex!["9c2d45edb30d4bf0c285d6809e28c55e871f10578c5a3ea62da152d03761d266"]
.unchecked_into(),
),
];

let endowed_accounts: Vec<AccountId> = vec![
// dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP
hex!["42f80d01d23a66a9429362a8e4f253a2a02e16c10de83a8ac1eaf6bbb7c9cb1b"].into(),
];
let balances = endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT())).collect();

let salp_multisig: AccountId =
hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into();
let salp_lite_multisig: AccountId =
hex!["e4f78719c654cd8e8ac1375c447b7a80f9476cfe6505ea401c4b15bd6b967c93"].into();

let council_membership = vec![
// dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP
hex!["42f80d01d23a66a9429362a8e4f253a2a02e16c10de83a8ac1eaf6bbb7c9cb1b"].into(),
];
let technical_committee_membership = vec![
// dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP
hex!["42f80d01d23a66a9429362a8e4f253a2a02e16c10de83a8ac1eaf6bbb7c9cb1b"].into(),
];

bifrost_genesis(
invulnerables,
balances,
vec![],
id,
vec![],
council_membership,
technical_committee_membership,
salp_multisig,
salp_lite_multisig,
)
}

pub fn stage_testnet_config() -> Result<ChainSpec, String> {
Ok(ChainSpec::from_genesis(
"Bifrost Stage Testnet",
"bifrost_stage_testnet",
ChainType::Local,
move || stage_config_genesis(PARA_ID.into()),
vec![],
None,
Some(DEFAULT_PROTOCOL_ID),
Some(bifrost_kusama_properties()),
RelayExtensions { relay_chain: "kusama-local".into(), para_id: PARA_ID },
))
}

pub fn chainspec_config() -> ChainSpec {
ChainSpec::from_genesis(
"Bifrost",
Expand Down
2 changes: 1 addition & 1 deletion runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ use constants::currency::*;
use cumulus_primitives_core::ParaId as CumulusParaId;
use frame_support::{
sp_runtime::traits::Convert,
traits::{EnsureOrigin, LockIdentifier, OnRuntimeUpgrade},
traits::{EnsureOrigin, LockIdentifier},
};
use frame_system::{EnsureOneOf, EnsureRoot, RawOrigin};
use hex_literal::hex;
Expand Down