Skip to content

Commit

Permalink
Add paseo setup and add paseo/westend relay chain-specs (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb authored May 10, 2024
1 parent 921c874 commit faab959
Show file tree
Hide file tree
Showing 10 changed files with 853 additions and 2 deletions.
8 changes: 7 additions & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ pub fn ajuna_config() -> Result<ChainSpec, String> {

pub fn ajuna_westend_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(
&include_bytes!("../../resources/ajuna-westend/ajuna-westend-raw.json")[..],
&include_bytes!("../../resources/ajuna/westend/ajuna-westend-raw.json")[..],
)
}

pub fn ajuna_paseo_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(
&include_bytes!("../../resources/ajuna/paseo/ajuna-paseo-raw.json")[..],
)
}
8 changes: 8 additions & 0 deletions node/src/chain_spec_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ impl AjunaKeys {

pub enum RelayChain {
Kusama,
Paseo,
Westend,
KusamaLocal,
PaseoLocal,
RococoLocal,
WestendLocal,
}
Expand All @@ -116,8 +118,10 @@ impl ToString for RelayChain {
fn to_string(&self) -> String {
match self {
RelayChain::Kusama => "kusama".into(),
RelayChain::Paseo => "paseo".into(),
RelayChain::Westend => "westend".into(),
RelayChain::KusamaLocal => "kusama-local".into(),
RelayChain::PaseoLocal => "paseo-local".into(),
RelayChain::RococoLocal => "rococo-local".into(),
RelayChain::WestendLocal => "westend-local".into(),
}
Expand All @@ -128,17 +132,21 @@ impl RelayChain {
pub(crate) fn chain_type(&self) -> ChainType {
match self {
RelayChain::Kusama => ChainType::Live,
RelayChain::Paseo => ChainType::Live,
RelayChain::Westend => ChainType::Live,
RelayChain::KusamaLocal => ChainType::Local,
RelayChain::PaseoLocal => ChainType::Local,
RelayChain::RococoLocal => ChainType::Local,
RelayChain::WestendLocal => ChainType::Local,
}
}
pub(crate) fn protocol_id(&self) -> &str {
match self {
RelayChain::Kusama => "ajuna-k",
RelayChain::Paseo => "ajuna-pas",
RelayChain::Westend => "ajuna-w",
RelayChain::KusamaLocal => "ajuna-kl",
RelayChain::PaseoLocal => "ajuna-pasl",
RelayChain::RococoLocal => "ajuna-rl",
RelayChain::WestendLocal => "ajuna-wl",
}
Expand Down
6 changes: 5 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use crate::{
chain_spec,
chain_spec::{ajuna_chain_spec, ajuna_config, ajuna_westend_config},
chain_spec::{ajuna_chain_spec, ajuna_config, ajuna_paseo_config, ajuna_westend_config},
chain_spec_utils::{GenesisKeys, RelayChain},
cli::{Cli, RelayChainCli, Subcommand},
fake_runtime_api::aura::RuntimeApi,
Expand Down Expand Up @@ -76,6 +76,7 @@ fn runtime(_id: &str) -> Runtime {
}

const POLKADOT_PARA_ID: u32 = 2051;
const PASEO_PARA_ID: u32 = 2051;
const WESTEND_PARA_ID: u32 = 2051;
const LOCAL_PARA_ID: u32 = 2051;

Expand All @@ -85,14 +86,17 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
Ok(match id {
// live configs
"ajuna-kusama" => Box::new(ajuna_config()?),
"ajuna-paseo" => Box::new(ajuna_paseo_config()?),
"ajuna-westend" => Box::new(ajuna_westend_config()?),

// fresh production/testnet chain-specs based on the current rust code
"ajuna-kusama-fresh" => Box::new(ajuna_chain_spec(POLKADOT_PARA_ID.into(), GenesisKeys::Ajuna, RelayChain::Kusama)),
"ajuna-paseo-fresh" => Box::new(ajuna_chain_spec(PASEO_PARA_ID.into(), GenesisKeys::TestnetDev, RelayChain::Paseo)),
"ajuna-westend-fresh" => Box::new(ajuna_chain_spec(WESTEND_PARA_ID.into(), GenesisKeys::TestnetDev, RelayChain::Westend)),

// rust code based configs for a local setup
"ajuna-kusama-local" => Box::new(ajuna_chain_spec(LOCAL_PARA_ID.into(), GenesisKeys::WellKnown, RelayChain::KusamaLocal)),
"ajuna-paseo-local" => Box::new(ajuna_chain_spec(LOCAL_PARA_ID.into(), GenesisKeys::WellKnown, RelayChain::PaseoLocal)),
"ajuna-westend-local" => Box::new(ajuna_chain_spec(LOCAL_PARA_ID.into(), GenesisKeys::WellKnown, RelayChain::WestendLocal)),
"" | "ajuna-rococo-local" => Box::new(ajuna_chain_spec(LOCAL_PARA_ID.into(), GenesisKeys::WellKnown, RelayChain::RococoLocal)),

Expand Down
89 changes: 89 additions & 0 deletions resources/ajuna/paseo/ajuna-paseo-raw-unsorted.json

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions resources/ajuna/paseo/ajuna-paseo-raw.json

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions resources/ajuna/paseo/ajuna-paseo.json

Large diffs are not rendered by default.

424 changes: 424 additions & 0 deletions resources/ajuna/paseo/paseo.json

Large diffs are not rendered by default.

File renamed without changes.
156 changes: 156 additions & 0 deletions resources/ajuna/westend/westend.json

Large diffs are not rendered by default.

0 comments on commit faab959

Please sign in to comment.