Skip to content

Commit

Permalink
Dolphin-2085 on Baikal genesis (#717)
Browse files Browse the repository at this point in the history
* Dolphin-2085 on Baikal genesis

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>

* Dolphin-2085 on Baikal genesis

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>

* Clean dolphin-2085 genesis

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>

* Remove unnecessary import

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>

* Docs

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>

Co-authored-by: Jamie <djptux@gmail.com>
  • Loading branch information
ghzlatarev and Dengjianping authored Jul 29, 2022
1 parent 301bcd6 commit 4b932a5
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 3 deletions.
118 changes: 118 additions & 0 deletions genesis/dolphin-2085-genesis.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions node/src/chain_specs/dolphin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
//! Dolphin Chain Specifications
use super::*;
use crate::command::DOLPHIN_PARACHAIN_ID;
use crate::command::{DOLPHIN_ON_BAIKAL_PARACHAIN_ID, DOLPHIN_PARACHAIN_ID};
use dolphin_runtime::{
opaque::SessionKeys, CouncilConfig, DemocracyConfig, GenesisConfig, TechnicalCommitteeConfig,
};
use session_key_primitives::helpers::{get_account_id_from_seed, get_collator_keys_from_seed};

/// Dolphin Protocol Identifier
pub const DOLPHIN_PROTOCOL_ID: &str = "dolphin";

/// Kusama Relaychain Local Network Identifier
pub const KUSAMA_RELAYCHAIN_LOCAL_NET: &str = "kusama-local";

Expand Down Expand Up @@ -226,6 +224,14 @@ pub fn dolphin_testnet_config() -> Result<DolphinChainSpec, String> {
Ok(spec)
}

pub fn dolphin_2085_config() -> Result<DolphinChainSpec, String> {
let mut spec = DolphinChainSpec::from_json_bytes(
&include_bytes!("../../../genesis/dolphin-2085-genesis.json")[..],
)?;
spec.extensions_mut().para_id = DOLPHIN_ON_BAIKAL_PARACHAIN_ID;
Ok(spec)
}

pub fn dolphin_testnet_ci_config() -> Result<DolphinChainSpec, String> {
let mut spec = DolphinChainSpec::from_json_bytes(
&include_bytes!("../../../genesis/dolphin-testnet-ci-genesis.json")[..],
Expand Down
3 changes: 3 additions & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ pub const CALAMARI_PARACHAIN_ID: u32 = 2084;

/// Dolphin Parachain ID
pub const DOLPHIN_PARACHAIN_ID: u32 = 2084;
/// Dolphin on Baikal Parachain ID. Can't be 2084 because Calamari @ Baikal already uses it.
pub const DOLPHIN_ON_BAIKAL_PARACHAIN_ID: u32 = 2085;

trait IdentifyChain {
fn is_manta(&self) -> bool;
Expand Down Expand Up @@ -104,6 +106,7 @@ fn load_spec(id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
"dolphin-dev" => Ok(Box::new(chain_specs::dolphin_development_config())),
"dolphin-local" => Ok(Box::new(chain_specs::dolphin_local_config())),
"dolphin-testnet" => Ok(Box::new(chain_specs::dolphin_testnet_config()?)),
"dolphin-2085" => Ok(Box::new(chain_specs::dolphin_2085_config()?)),
"dolphin-testnet-ci" => Ok(Box::new(chain_specs::dolphin_testnet_ci_config()?)),
path => {
let chain_spec = chain_specs::ChainSpec::from_json_file(path.into())?;
Expand Down

0 comments on commit 4b932a5

Please sign in to comment.