From e919e409e49b67e5d5013240f4a33256dd79ea3d Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:42:16 +0200 Subject: [PATCH] Chainspec fixes; replace kusama with polkadot + fix chain-id of ajuna-paseo (need to move de chain-db before deployment) (#38) --- node/src/chain_spec_utils.rs | 20 +++++++++---------- node/src/command.rs | 6 +++--- .../ajuna/paseo/ajuna-paseo-raw-unsorted.json | 11 ++++++---- resources/ajuna/paseo/ajuna-paseo-raw.json | 11 ++++++---- resources/ajuna/paseo/ajuna-paseo.json | 11 ++++++---- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/node/src/chain_spec_utils.rs b/node/src/chain_spec_utils.rs index e7ff395..93b2df5 100644 --- a/node/src/chain_spec_utils.rs +++ b/node/src/chain_spec_utils.rs @@ -105,10 +105,10 @@ impl AjunaKeys { } pub enum RelayChain { - Kusama, + Polkadot, Paseo, Westend, - KusamaLocal, + PolkadotLocal, PaseoLocal, RococoLocal, WestendLocal, @@ -117,10 +117,10 @@ pub enum RelayChain { impl RelayChain { pub fn id(&self) -> &'static str { match self { - RelayChain::Kusama => "kusama", + RelayChain::Polkadot => "polkadot", RelayChain::Paseo => "paseo", RelayChain::Westend => "westend", - RelayChain::KusamaLocal => "kusama-local", + RelayChain::PolkadotLocal => "polkadot-local", RelayChain::PaseoLocal => "paseo-local", RelayChain::RococoLocal => "rococo-local", RelayChain::WestendLocal => "westend-local", @@ -129,10 +129,10 @@ impl RelayChain { pub fn name(&self) -> &'static str { match self { - RelayChain::Kusama => "Kusama", + RelayChain::Polkadot => "Polkadot", RelayChain::Paseo => "Paseo", RelayChain::Westend => "Westend", - RelayChain::KusamaLocal => "Kusama-local", + RelayChain::PolkadotLocal => "Polkadot-local", RelayChain::PaseoLocal => "Paseo-local", RelayChain::RococoLocal => "Rococo-local", RelayChain::WestendLocal => "Westend-local", @@ -141,10 +141,10 @@ impl RelayChain { pub(crate) fn chain_type(&self) -> ChainType { match self { - RelayChain::Kusama => ChainType::Live, + RelayChain::Polkadot => ChainType::Live, RelayChain::Paseo => ChainType::Live, RelayChain::Westend => ChainType::Live, - RelayChain::KusamaLocal => ChainType::Local, + RelayChain::PolkadotLocal => ChainType::Local, RelayChain::PaseoLocal => ChainType::Local, RelayChain::RococoLocal => ChainType::Local, RelayChain::WestendLocal => ChainType::Local, @@ -152,10 +152,10 @@ impl RelayChain { } pub(crate) fn protocol_id(&self) -> &str { match self { - RelayChain::Kusama => "ajuna-k", + RelayChain::Polkadot => "ajuna-k", RelayChain::Paseo => "ajuna-pas", RelayChain::Westend => "ajuna-w", - RelayChain::KusamaLocal => "ajuna-kl", + RelayChain::PolkadotLocal => "ajuna-kl", RelayChain::PaseoLocal => "ajuna-pasl", RelayChain::RococoLocal => "ajuna-rl", RelayChain::WestendLocal => "ajuna-wl", diff --git a/node/src/command.rs b/node/src/command.rs index 893fdb2..dd0a647 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -85,17 +85,17 @@ const LOCAL_PARA_ID: u32 = 2051; fn load_spec(id: &str) -> std::result::Result, String> { Ok(match id { // live configs - "ajuna-kusama" => Box::new(ajuna_config()?), + "ajuna-polkadot" => 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-polkadot-fresh" => Box::new(ajuna_chain_spec(POLKADOT_PARA_ID.into(), GenesisKeys::Ajuna, RelayChain::Polkadot)), "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-polkadot-local" => Box::new(ajuna_chain_spec(LOCAL_PARA_ID.into(), GenesisKeys::WellKnown, RelayChain::PolkadotLocal)), "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)), diff --git a/resources/ajuna/paseo/ajuna-paseo-raw-unsorted.json b/resources/ajuna/paseo/ajuna-paseo-raw-unsorted.json index 3103fba..b748cca 100644 --- a/resources/ajuna/paseo/ajuna-paseo-raw-unsorted.json +++ b/resources/ajuna/paseo/ajuna-paseo-raw-unsorted.json @@ -1,16 +1,19 @@ { "name": "Ajuna Paseo", - "id": "ajuna-ajuna-westend", + "id": "ajuna-paseo", "chainType": "Live", - "bootNodes": [], + "bootNodes": [ + "/ip4/95.217.105.80/tcp/23804/p2p/p2p/12D3KooWFR6k9RLLRUJDhS8R4a2s7c8Tc1t2Rf7d7WGn9K2XpNsB", + "/ip4/135.181.240.254/tcp/23804/p2p/p2p/12D3KooWLRzxpDsfbgZPVM3719JQ1Xct5jg3En7ANJZ2ntRfYo7x" + ], "telemetryEndpoints": null, - "protocolId": "ajuna-w", + "protocolId": "ajuna-pas", "properties": { "ss58Format": 1328, "tokenDecimals": 12, "tokenSymbol": "AJUN" }, - "relay_chain": "ajuna-westend", + "relay_chain": "paseo", "para_id": 2051, "codeSubstitutes": {}, "genesis": { diff --git a/resources/ajuna/paseo/ajuna-paseo-raw.json b/resources/ajuna/paseo/ajuna-paseo-raw.json index 694052d..fb1f2c3 100644 --- a/resources/ajuna/paseo/ajuna-paseo-raw.json +++ b/resources/ajuna/paseo/ajuna-paseo-raw.json @@ -1,5 +1,8 @@ { - "bootNodes": [], + "bootNodes": [ + "/ip4/95.217.105.80/tcp/23804/p2p/p2p/12D3KooWFR6k9RLLRUJDhS8R4a2s7c8Tc1t2Rf7d7WGn9K2XpNsB", + "/ip4/135.181.240.254/tcp/23804/p2p/p2p/12D3KooWLRzxpDsfbgZPVM3719JQ1Xct5jg3En7ANJZ2ntRfYo7x" + ], "chainType": "Live", "codeSubstitutes": {}, "genesis": { @@ -75,7 +78,7 @@ } } }, - "id": "ajuna-ajuna-westend", + "id": "ajuna-paseo", "name": "Ajuna Paseo", "para_id": 2051, "properties": { @@ -83,7 +86,7 @@ "tokenDecimals": 12, "tokenSymbol": "AJUN" }, - "protocolId": "ajuna-w", - "relay_chain": "ajuna-westend", + "protocolId": "ajuna-pas", + "relay_chain": "paseo", "telemetryEndpoints": null } diff --git a/resources/ajuna/paseo/ajuna-paseo.json b/resources/ajuna/paseo/ajuna-paseo.json index f0ee770..45b5f5e 100644 --- a/resources/ajuna/paseo/ajuna-paseo.json +++ b/resources/ajuna/paseo/ajuna-paseo.json @@ -1,16 +1,19 @@ { "name": "Ajuna Paseo", - "id": "ajuna-ajuna-westend", + "id": "ajuna-paseo", "chainType": "Live", - "bootNodes": [], + "bootNodes": [ + "/ip4/95.217.105.80/tcp/23804/p2p/12D3KooWFR6k9RLLRUJDhS8R4a2s7c8Tc1t2Rf7d7WGn9K2XpNsB", + "/ip4/135.181.240.254/tcp/23804/p2p/12D3KooWLRzxpDsfbgZPVM3719JQ1Xct5jg3En7ANJZ2ntRfYo7x" + ], "telemetryEndpoints": null, - "protocolId": "ajuna-w", + "protocolId": "ajuna-pas", "properties": { "ss58Format": 1328, "tokenDecimals": 12, "tokenSymbol": "AJUN" }, - "relay_chain": "ajuna-westend", + "relay_chain": "paseo", "para_id": 2051, "codeSubstitutes": {}, "genesis": {