Skip to content

Commit

Permalink
more renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Kailai-Wang committed Dec 30, 2024
1 parent cf375f9 commit 2a38f22
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 73 deletions.
2 changes: 1 addition & 1 deletion common/primitives/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ mod types {
mod constants {
use super::types::BlockNumber;

pub const LITENTRY_PARA_ID: u32 = 2013;
pub const HEIMA_PARA_ID: u32 = 2013;
pub const PASEO_PARA_ID: u32 = 2106;

/// This determines the average expected block time that we are targeting.
Expand Down
8 changes: 4 additions & 4 deletions local-setup/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def main(processes, worker, workers_number, parachain_type, log_config_path, off
worker_dir = "tee-worker/identity"
worker_bin = "litentry-worker"

print("Starting litentry parachain in background ...")
print("Starting heima in background ...")
if parachain_type == "standalone":
add_collator_ports()
os.environ['HEIMA_DIR'] = parachain_dir
Expand All @@ -235,14 +235,14 @@ def main(processes, worker, workers_number, parachain_type, log_config_path, off
add_collator_ports()
os.environ['HEIMA_DIR'] = parachain_dir
setup_environment(offset, parachain_dir, worker_dir)
run(["./parachain/scripts/launch-network.sh", "litentry"], check=True)
run(["./parachain/scripts/launch-network.sh", "heima"], check=True)
elif parachain_type == "remote":
setup_environment(offset, "", worker_dir)
print("Litentry parachain should be started remotely")
print("Heima should be started remotely")
else:
sys.exit("Unsupported parachain_type")

print("Litentry parachain is running")
print("Heima is running")
print("------------------------------------------------------------")

c = pycurl.Curl()
Expand Down
30 changes: 15 additions & 15 deletions parachain/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ARG PROFILE
# ==========================
FROM rust:bullseye as builder

WORKDIR /litentry/parachain
COPY . /litentry/
WORKDIR /heima/parachain
COPY . /heima/

RUN apt-get update && apt-get install -yq clang libclang-dev cmake protobuf-compiler

Expand All @@ -26,7 +26,7 @@ LABEL maintainer="Trust Computing GmbH <[email protected]>"

ARG PROFILE

COPY --from=local-builder:latest /litentry/parachain/target/$PROFILE/heima-node /usr/local/bin/
COPY --from=local-builder:latest /heima/parachain/target/$PROFILE/heima-node /usr/local/bin/

# install netcat for healthcheck
RUN apt-get update && \
Expand All @@ -36,14 +36,14 @@ RUN apt-get update && \
rm -rf /var/cache/apt/lists && \
cp /usr/bin/nc /usr/local/bin/

RUN useradd -m -u 1000 -U -s /bin/sh -d /litentry litentry && \
mkdir -p /data /litentry/.local/share && \
chown -R litentry:litentry /data && \
ln -s /data /litentry/.local/share/heima-node && \
RUN useradd -m -u 1000 -U -s /bin/sh -d /heima heima && \
mkdir -p /data /heima/.local/share && \
chown -R heima:heima /data && \
ln -s /data /heima/.local/share/heima-node && \
# check if executable works in this container
/usr/local/bin/heima-node --version

USER litentry
USER heima
EXPOSE 30333 9944 9615
VOLUME ["/data"]

Expand Down Expand Up @@ -92,24 +92,24 @@ RUN echo "downloading zombienet-linux-x64 ..." && \
cp zombienet-linux-x64 /usr/local/bin/zombienet && \
zombienet version

RUN useradd -m -u 1000 -U -s /bin/sh -d /litentry litentry && \
mkdir -p /opt/litentry/parachain /code && \
chown -R litentry:litentry /opt/litentry
RUN useradd -m -u 1000 -U -s /bin/sh -d /heima heima && \
mkdir -p /opt/heima/parachain /code && \
chown -R heima:heima /opt/heima

COPY --from=local-builder:latest /litentry/parachain/target/$PROFILE/heima-node /usr/local/bin/
COPY --from=local-builder:latest /heima/parachain/target/$PROFILE/heima-node /usr/local/bin/
RUN chmod +x /usr/local/bin/heima-node && \
# check if executable works in this container
/usr/local/bin/heima-node --version

COPY ./parachain /code/parachain
COPY ./parachain/docker/entrypoint.sh /usr/local/bin/
COPY ./common /code/common
RUN chown -R litentry:litentry /code
RUN chown -R heima:heima /code
RUN chmod +x /usr/local/bin/entrypoint.sh

USER litentry
USER heima

EXPOSE 9615 9944 9946 9947 30332 30333 30336 30337
VOLUME ["/opt/litentry"]
VOLUME ["/opt/heima"]

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use super::*;
use cumulus_primitives_core::ParaId;
use litentry_parachain_runtime::{
use heima_parachain_runtime::{
AccountId, AuraId, Balance, BalancesConfig, CouncilMembershipConfig,
DeveloperCommitteeMembershipConfig, ParachainInfoConfig, ParachainStakingConfig,
PolkadotXcmConfig, RuntimeGenesisConfig, SessionConfig, TechnicalCommitteeMembershipConfig,
Expand All @@ -30,7 +30,7 @@ use sp_core::sr25519;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

/// Get default parachain properties for Litentry which will be filled into chain spec
/// Get default parachain properties for heima which will be filled into chain spec
fn default_parachain_properties() -> Properties {
parachain_properties("LIT", 18, 31)
}
Expand All @@ -53,11 +53,11 @@ struct GenesisInfo {
pub fn get_chain_spec_dev() -> ChainSpec {
ChainSpec::builder(
WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo-local".into(), para_id: LITENTRY_PARA_ID },
Extensions { relay_chain: "rococo-local".into(), para_id: HEIMA_PARA_ID },
)
.with_name("Litentry-dev")
.with_id("litentry-dev")
.with_protocol_id("litentry")
.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 All @@ -83,7 +83,7 @@ pub fn get_chain_spec_dev() -> ChainSpec {
],
vec![get_account_id_from_seed::<sr25519::Public>("Alice")],
vec![get_account_id_from_seed::<sr25519::Public>("Alice")],
LITENTRY_PARA_ID.into(),
HEIMA_PARA_ID.into(),
))
.build()
}
Expand All @@ -96,22 +96,25 @@ pub fn get_chain_spec_staging() -> ChainSpec {
// aura: $SECRET//collator//<id>//aura
get_chain_spec_from_genesis_info(
include_bytes!("../../res/genesis_info/staging.json"),
"Litentry-staging",
"litentry-staging",
"Heima-staging",
"heima-staging",
"heima",
ChainType::Local,
"rococo-local".into(),
LITENTRY_PARA_ID.into(),
HEIMA_PARA_ID.into(),
)
}

// TODO: not sure if it can be changed - so we keep `litentry` for now
pub fn get_chain_spec_prod() -> ChainSpec {
get_chain_spec_from_genesis_info(
include_bytes!("../../res/genesis_info/litentry.json"),
include_bytes!("../../res/genesis_info/heima.json"),
"Litentry",
"litentry",
"litentry",
ChainType::Live,
"polkadot".into(),
LITENTRY_PARA_ID.into(),
HEIMA_PARA_ID.into(),
)
}

Expand All @@ -121,6 +124,7 @@ fn get_chain_spec_from_genesis_info(
genesis_info_bytes: &[u8],
name: &str,
id: &str,
protocol_id: &str,
chain_type: ChainType,
relay_chain_name: String,
para_id: ParaId,
Expand All @@ -141,7 +145,7 @@ fn get_chain_spec_from_genesis_info(
.with_name(name)
.with_id(id)
.with_chain_type(chain_type)
.with_protocol_id("litentry")
.with_protocol_id(protocol_id)
.with_properties(default_parachain_properties())
.with_boot_nodes(
boot_nodes
Expand Down Expand Up @@ -186,7 +190,7 @@ fn generate_genesis(
balances: BalancesConfig { balances: endowed_accounts },
parachain_info: ParachainInfoConfig { parachain_id: id, ..Default::default() },
parachain_staking: ParachainStakingConfig {
// Should be enough for both Litentry and rococo
// Should be enough for both heima and paseo
candidates: invulnerables.iter().cloned().map(|(acc, _)| (acc, 5000 * UNIT)).collect(),
..Default::default()
},
Expand All @@ -196,9 +200,9 @@ fn generate_genesis(
.cloned()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
litentry_parachain_runtime::SessionKeys { aura }, // session keys
acc.clone(), // account id
acc, // validator id
heima_parachain_runtime::SessionKeys { aura }, // session keys
)
})
.collect(),
Expand Down
4 changes: 2 additions & 2 deletions parachain/node/src/chain_specs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#![allow(clippy::derive_partial_eq_without_eq)]

use core_primitives::{AccountId, Signature, LITENTRY_PARA_ID};
use core_primitives::{AccountId, Signature, HEIMA_PARA_ID};
use runtime_common::currency::UNIT;
pub use sc_chain_spec::Properties;
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
Expand All @@ -25,7 +25,7 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

pub mod litentry;
pub mod heima;
pub mod paseo;

pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
Expand Down
6 changes: 4 additions & 2 deletions parachain/node/src/chain_specs/paseo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use sp_core::sr25519;
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)
/// We use 31 as the SS58Prefix (same as Heima)
fn default_parachain_properties() -> Properties {
parachain_properties("LIT", 18, 31)
}
Expand Down Expand Up @@ -96,6 +96,7 @@ pub fn get_chain_spec_prod() -> ChainSpec {
include_bytes!("../../res/genesis_info/paseo.json"),
"Litentry-paseo",
"litentry-paseo",
"litentry-paseo",
ChainType::Live,
"paseo".into(),
PASEO_PARA_ID.into(),
Expand All @@ -108,6 +109,7 @@ fn get_chain_spec_from_genesis_info(
genesis_info_bytes: &[u8],
name: &str,
id: &str,
protocol_id: &str,
chain_type: ChainType,
relay_chain_name: String,
para_id: ParaId,
Expand All @@ -128,7 +130,7 @@ fn get_chain_spec_from_genesis_info(
.with_name(name)
.with_id(id)
.with_chain_type(chain_type)
.with_protocol_id("litentry-paseo")
.with_protocol_id(protocol_id)
.with_properties(default_parachain_properties())
.with_boot_nodes(
boot_nodes
Expand Down
Loading

0 comments on commit 2a38f22

Please sign in to comment.