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

Adjust chain-spec of heima and paseo #3248

Merged
merged 3 commits into from
Feb 4, 2025
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
4 changes: 2 additions & 2 deletions parachain/node/res/chain_specs/litentry-plain.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"chainType": "Live",
"bootNodes": [
"/dns/rpc0.litentry-parachain-sg.litentry.io/tcp/40333/ws/p2p/12D3KooWBy6nNAuca2ZrxNEH93bzmb7ZjRpzRbbz7CtNEraiHtSC",
"/dns/rpc1.litentry-parachain-sg.litentry.io/tcp/40333/ws/p2p/12D3KooWJejFQVK5wtZeDZguAXkzQxngrS9yZt2F1bk92m5w4Xgp"
"/dns/rpc1.litentry-parachain-sg.litentry.io/tcp/40333/ws/p2p/12D3KooWJejFQVK5wtZeDZguAXkzQxngrS9yZt2F1bk92m5w4Xgp",
"/dns/litentry-boot.dwellir.com/tcp/30333/ws/p2p/12D3KooWFHkJaz1BxqdAjzeLK4xcubxXP25kTaYWZqsJukuex5Ly"
],
"telemetryEndpoints": [
[
"/dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F",
0
]
],
"protocolId": "heima",
"properties": {
"ss58Format": 31,
"tokenDecimals": 18,
Expand Down
1 change: 0 additions & 1 deletion parachain/node/res/chain_specs/litentry.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
0
]
],
"protocolId": "heima",
"properties": {
"ss58Format": 31,
"tokenDecimals": 18,
Expand Down
5 changes: 2 additions & 3 deletions parachain/node/res/chain_specs/paseo-plain.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Litentry-paseo",
"name": "Heima-paseo",
"id": "litentry-paseo",
"chainType": "Live",
"bootNodes": [
Expand All @@ -11,11 +11,10 @@
0
]
],
"protocolId": "litentry-paseo",
"properties": {
"ss58Format": 131,
"tokenDecimals": 18,
"tokenSymbol": "LIT"
"tokenSymbol": "HEI"
},
"relayChain": "paseo",
"paraId": 2106,
Expand Down
5 changes: 2 additions & 3 deletions parachain/node/res/chain_specs/paseo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Litentry-paseo",
"name": "Heima-paseo",
"id": "litentry-paseo",
"chainType": "Live",
"bootNodes": [
Expand All @@ -11,11 +11,10 @@
0
]
],
"protocolId": "litentry-paseo",
"properties": {
"ss58Format": 131,
"tokenDecimals": 18,
"tokenSymbol": "LIT"
"tokenSymbol": "HEI"
},
"relayChain": "paseo",
"paraId": 2106,
Expand Down
119 changes: 0 additions & 119 deletions parachain/node/res/chain_specs/rococo-plain.json

This file was deleted.

388 changes: 0 additions & 388 deletions parachain/node/res/chain_specs/rococo.json

This file was deleted.

50 changes: 0 additions & 50 deletions parachain/node/res/genesis_info/rococo.json

This file was deleted.

43 changes: 0 additions & 43 deletions parachain/node/res/genesis_info/staging.json

This file was deleted.

22 changes: 2 additions & 20 deletions parachain/node/src/chain_specs/litentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

/// Get default parachain properties for Litentry which will be filled into chain spec
fn default_parachain_properties() -> Properties {
parachain_properties("LIT", 18, 31)
parachain_properties("HEI", 18, 31)
}

const DEFAULT_ENDOWED_ACCOUNT_BALANCE: Balance = 1000 * UNIT;
Expand All @@ -58,7 +58,6 @@ pub fn get_chain_spec_dev() -> ChainSpec {
)
.with_name("Heima-dev")
.with_id("heima-dev")
.with_protocol_id("heima")
.with_chain_type(ChainType::Development)
.with_properties(default_parachain_properties())
.with_genesis_config(generate_genesis(
Expand Down Expand Up @@ -89,27 +88,11 @@ pub fn get_chain_spec_dev() -> ChainSpec {
.build()
}

pub fn get_chain_spec_staging() -> ChainSpec {
// Staging keys are derivative keys based on a single master secret phrase:
//
// root: $SECRET
// account: $SECRET//collator//<id>
// aura: $SECRET//collator//<id>//aura
get_chain_spec_from_genesis_info(
include_bytes!("../../res/genesis_info/staging.json"),
"Heima-staging",
"heima-staging",
ChainType::Local,
"rococo-local".into(),
LITENTRY_PARA_ID.into(),
)
}

pub fn get_chain_spec_prod() -> ChainSpec {
get_chain_spec_from_genesis_info(
include_bytes!("../../res/genesis_info/litentry.json"),
"Heima",
"heima",
"litentry", // unchanged for now, so that node operators don't have to change the db path
ChainType::Live,
"polkadot".into(),
LITENTRY_PARA_ID.into(),
Expand Down Expand Up @@ -142,7 +125,6 @@ fn get_chain_spec_from_genesis_info(
.with_name(name)
.with_id(id)
.with_chain_type(chain_type)
.with_protocol_id("heima")
.with_properties(default_parachain_properties())
.with_boot_nodes(
boot_nodes
Expand Down
10 changes: 4 additions & 6 deletions parachain/node/src/chain_specs/paseo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
/// Get default parachain properties for paseo which will be filled into chain spec
/// We use 31 as the SS58Prefix (same as Litentry)
fn default_parachain_properties() -> Properties {
parachain_properties("LIT", 18, 31)
parachain_properties("HEI", 18, 31)
}

const DEFAULT_ENDOWED_ACCOUNT_BALANCE: Balance = 1000 * UNIT;
Expand All @@ -55,14 +55,13 @@ struct GenesisInfo {
}

pub fn get_chain_spec_dev(is_standalone: bool) -> ChainSpec {
let id = if is_standalone { "standalone" } else { "litentry-paseo-dev" };
let id = if is_standalone { "standalone" } else { "heima-paseo-dev" };
ChainSpec::builder(
WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "paseo".into(), para_id: PASEO_PARA_ID },
)
.with_name("Litentry-paseo-dev")
.with_name("Heima-paseo-dev")
.with_id(id)
.with_protocol_id("litentry-paseo")
.with_chain_type(ChainType::Development)
.with_properties(default_parachain_properties())
.with_genesis_config(generate_genesis(
Expand Down Expand Up @@ -94,7 +93,7 @@ pub fn get_chain_spec_dev(is_standalone: bool) -> ChainSpec {
pub fn get_chain_spec_prod() -> ChainSpec {
get_chain_spec_from_genesis_info(
include_bytes!("../../res/genesis_info/paseo.json"),
"Litentry-paseo",
"Heima-paseo",
"litentry-paseo",
ChainType::Live,
"paseo".into(),
Expand Down Expand Up @@ -128,7 +127,6 @@ fn get_chain_spec_from_genesis_info(
.with_name(name)
.with_id(id)
.with_chain_type(chain_type)
.with_protocol_id("litentry-paseo")
.with_properties(default_parachain_properties())
.with_boot_nodes(
boot_nodes
Expand Down
1 change: 0 additions & 1 deletion parachain/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, St
"dev" | "standalone" => Box::new(chain_specs::paseo::get_chain_spec_dev(true)),
// Litentry
"litentry-dev" => Box::new(chain_specs::litentry::get_chain_spec_dev()),
"litentry-staging" => Box::new(chain_specs::litentry::get_chain_spec_staging()),
"litentry" => Box::new(chain_specs::ChainSpec::from_json_bytes(
&include_bytes!("../res/chain_specs/litentry.json")[..],
)?),
Expand Down
8 changes: 4 additions & 4 deletions parachain/runtime/litentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ impl_opaque_keys! {
/// This runtime version.
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
// It's important to match `litentry-parachain-runtime`, which is runtime pkg name
spec_name: create_runtime_str!("heima-parachain"),
impl_name: create_runtime_str!("heima-parachain"),
// has to match the on-chain registered spec-name, which is `litentry-parachain-runtime`
spec_name: create_runtime_str!("litentry-parachain"),
impl_name: create_runtime_str!("heima"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9223,
spec_version: 9230,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
7 changes: 3 additions & 4 deletions parachain/runtime/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,12 @@ impl_opaque_keys! {
/// This runtime version.
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
// Note:
// It's important to match `paseo-parachain-runtime`, which is runtime pkg name
// has to match the on-chain registered spec-name, which is `paseo-parachain`
spec_name: create_runtime_str!("paseo-parachain"),
impl_name: create_runtime_str!("paseo-parachain"),
impl_name: create_runtime_str!("heima"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9223,
spec_version: 9230,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down