Skip to content

Commit

Permalink
Add coretime-polkadot chainspec
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda committed Aug 6, 2024
1 parent bc04c5b commit e483e24
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 14 deletions.
25 changes: 20 additions & 5 deletions chain-spec-generator/src/system_parachains_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ pub fn coretime_kusama_config() -> Result<Box<dyn ChainSpec>, String> {
properties.insert("tokenDecimals".into(), 12.into());

let boot_nodes = vec![
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/30334/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/30334/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/443/wss/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
"/dns/kusama-coretime-connect-a-0.polkadot.io/tcp/30334/p2p/12D3KooWR7Biy6nPgQFhk2eYP62pAkcFA6he9RUFURTDh7ewTjpo",
"/dns/kusama-coretime-connect-a-1.polkadot.io/tcp/30334/p2p/12D3KooWAGFiMZDF9RxdacrkenzGdo8nhfSe9EXofHc5mHeJ9vGX",
"/dns/kusama-coretime-connect-a-0.polkadot.io/tcp/443/wss/p2p/12D3KooWR7Biy6nPgQFhk2eYP62pAkcFA6he9RUFURTDh7ewTjpo",
"/dns/kusama-coretime-connect-a-1.polkadot.io/tcp/443/wss/p2p/12D3KooWAGFiMZDF9RxdacrkenzGdo8nhfSe9EXofHc5mHeJ9vGX",
];

Ok(Box::new(
Expand Down Expand Up @@ -289,9 +289,16 @@ pub fn coretime_polkadot_config() -> Result<Box<dyn ChainSpec>, String> {
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());

let boot_nodes = vec![
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/30334/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/30334/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/443/wss/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
];

Ok(Box::new(
CoretimePolkadotChainSpec::builder(
coretime_polkadot_runtime::WASM_BINARY.expect("CoretimePolkadot wasm not available!"),
coretime_polkadot_runtime::WASM_BINARY.expect("Polkadot Coretime wasm not available!"),
Extensions { relay_chain: "polkadot".into(), para_id: 1005 },
)
.with_name("Polkadot Coretime")
Expand All @@ -303,6 +310,14 @@ pub fn coretime_polkadot_config() -> Result<Box<dyn ChainSpec>, String> {
),
)
.with_properties(properties)
.with_boot_nodes(
boot_nodes
.iter()
.map(|addr| {
MultiaddrWithPeerId::from_str(addr).expect("Boot node address is incorrect.")
})
.collect(),
)
.build(),
))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
//! Genesis configs presets for the Polkadot Coretime runtime

use crate::*;
use sp_core::sr25519;
use hex_literal::hex;
use sp_core::crypto::UncheckedInto;
use sp_std::vec::Vec;
use system_parachains_constants::genesis_presets::*;

Expand Down Expand Up @@ -73,15 +74,62 @@ fn coretime_polkadot_development_genesis(para_id: ParaId) -> serde_json::Value {
coretime_polkadot_local_testnet_genesis(para_id)
}

fn coretime_polkadot_live_invulnerables() -> Vec<(parachains_common::AccountId, AuraId)> {
Vec::from([
(get_account_id_from_seed::<sr25519::Public>("Alice"), get_from_seed::<AuraId>("Alice")),
(get_account_id_from_seed::<sr25519::Public>("Bob"), get_from_seed::<AuraId>("Bob")),
])
}

pub fn coretime_polkadot_live_genesis(para_id: ParaId) -> serde_json::Value {
coretime_polkadot_genesis(coretime_polkadot_live_invulnerables(), Vec::new(), para_id)
coretime_polkadot_genesis(
vec![
// Parity polkadot-coretime-collator-a-0
// 13umUoWwGb765EPzMUrMmYTcEjKfNJiNyCDwdqAvCMzteGzi
(
hex!("80b6f570f356fef7b891afa2e1c30fca89bc7a2cddd545fd8a173106fce3a11f").into(),
hex!("4a69b6ec0eda668471d806db625681a147efc35a4baeacf0bca95d12d13cd942")
.unchecked_into(),
),
// Parity polkadot-coretime-collator-a-1
// 13NAwtroa2efxgtih1oscJqjxcKpWJeQF8waWPTArBewi2CQ
(
hex!("689e1a66fa33b75f66415021aacc4fa23f49306a3c21407748b8b2d39b4abf63").into(),
hex!("f0d0e90c36f95605510f00a9f0821675bc0c7b70e5c8d113b0426c21d627773b")
.unchecked_into(),
),
// Stakeworld.io
// 13Jpq4n3PXXaSAbJTMmFD78mXAzs8PzgUUQd5ve8saw7HQS5
(
hex!("6610a5024c2a5db3d02056d4344d120ec7be283100d71a6715f09275167e4f38").into(),
hex!("dcaa0b4c6840028f6d4fa8c460d5a7d687d1f81c9de453ef2f5ead88767fd22a")
.unchecked_into(),
),
// STKD
// 173Wc3mSdXa9ja9nv7C1z6GQHEBK4HZ9U4NGhHnvmTfJaJb
(
hex!("049bec59fb5fe6adea4578250578e89dd7e51ad88c7c92493d6f451c6680925c").into(),
hex!("7283ea6b8648673305a3e06be6dd83b7bc1840081d50d4deef1ce53eba21e914")
.unchecked_into(),
),
// Staker Space
// 1k4vuCxwbNcHfsNdQ3MgTGixwvrT7wbLc2XiZj68Gru6bLM
(
hex!("20d8c795eef2620fba2bde74dbc36461c07998ebf600ed265b746c1e05c70606").into(),
hex!("248dbf89d86998772b66900d78e98980ea2afc3c8fe5b93f4b38052f3018a230")
.unchecked_into(),
),
// openbitlab_
// 12iho9gjSMvF9smJjnihmn9j9Qqr3S1LFD97e8Lkcw4R6Yeb
(
hex!("4c0aa0240b2d7485675e52cdb283a87973652f6acb42c830a5a5faa80f7a707e").into(),
hex!("1c346cb44aa03f8995eeee230970772d6268cd7606740f269bb4e609a01a3a15")
.unchecked_into(),
),
// Math Crypto
// 112FKz5UNxjXqe3Wowe73a8FHnR5B4R9qi2pbMaXJczGNJsx
(
hex!("00f379b621bd73c45c7d155d2a1fe6a04649e3ece7c7e03b70b3a6242bc7c127").into(),
hex!("e063247ca37058db551a8d99f2f15cfede61fc796acc464a9cdce4c18f6a4659")
.unchecked_into(),
),
],
Vec::new(),
para_id,
)
}

/// Provides the JSON representation of predefined genesis config for given `id`.
Expand Down

0 comments on commit e483e24

Please sign in to comment.