diff --git a/common/primitives/core/src/lib.rs b/common/primitives/core/src/lib.rs index 9031389b64..3c505b74be 100644 --- a/common/primitives/core/src/lib.rs +++ b/common/primitives/core/src/lib.rs @@ -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. diff --git a/local-setup/launch.py b/local-setup/launch.py index 4f585b1b7c..475c06124f 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -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 @@ -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() diff --git a/parachain/docker/Dockerfile b/parachain/docker/Dockerfile index 9012d40cec..fdf0d7dbd2 100644 --- a/parachain/docker/Dockerfile +++ b/parachain/docker/Dockerfile @@ -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 @@ -26,7 +26,7 @@ LABEL maintainer="Trust Computing GmbH " 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 && \ @@ -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"] @@ -92,11 +92,11 @@ 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 @@ -104,12 +104,12 @@ RUN chmod +x /usr/local/bin/heima-node && \ 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"] \ No newline at end of file diff --git a/parachain/node/res/chain_specs/litentry-plain.json b/parachain/node/res/chain_specs/heima-plain.json similarity index 100% rename from parachain/node/res/chain_specs/litentry-plain.json rename to parachain/node/res/chain_specs/heima-plain.json diff --git a/parachain/node/res/chain_specs/litentry.json b/parachain/node/res/chain_specs/heima.json similarity index 100% rename from parachain/node/res/chain_specs/litentry.json rename to parachain/node/res/chain_specs/heima.json diff --git a/parachain/node/res/genesis_info/litentry.json b/parachain/node/res/genesis_info/heima.json similarity index 100% rename from parachain/node/res/genesis_info/litentry.json rename to parachain/node/res/genesis_info/heima.json diff --git a/parachain/node/src/chain_specs/litentry.rs b/parachain/node/src/chain_specs/heima.rs similarity index 89% rename from parachain/node/src/chain_specs/litentry.rs rename to parachain/node/src/chain_specs/heima.rs index 0ae572c6fe..8dbeab80b4 100644 --- a/parachain/node/src/chain_specs/litentry.rs +++ b/parachain/node/src/chain_specs/heima.rs @@ -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, @@ -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) } @@ -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( @@ -83,7 +83,7 @@ pub fn get_chain_spec_dev() -> ChainSpec { ], vec![get_account_id_from_seed::("Alice")], vec![get_account_id_from_seed::("Alice")], - LITENTRY_PARA_ID.into(), + HEIMA_PARA_ID.into(), )) .build() } @@ -96,22 +96,25 @@ pub fn get_chain_spec_staging() -> ChainSpec { // aura: $SECRET//collator////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(), ) } @@ -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, @@ -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 @@ -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() }, @@ -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(), diff --git a/parachain/node/src/chain_specs/mod.rs b/parachain/node/src/chain_specs/mod.rs index d52132e187..6ff7d2ad61 100644 --- a/parachain/node/src/chain_specs/mod.rs +++ b/parachain/node/src/chain_specs/mod.rs @@ -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}; @@ -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; diff --git a/parachain/node/src/chain_specs/paseo.rs b/parachain/node/src/chain_specs/paseo.rs index d72874568d..7fdbe029cf 100644 --- a/parachain/node/src/chain_specs/paseo.rs +++ b/parachain/node/src/chain_specs/paseo.rs @@ -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) } @@ -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(), @@ -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, @@ -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 diff --git a/parachain/node/src/command.rs b/parachain/node/src/command.rs index 8bb930b5a8..ec2152615c 100644 --- a/parachain/node/src/command.rs +++ b/parachain/node/src/command.rs @@ -32,16 +32,16 @@ use sc_service::config::{BasePath, PrometheusConfig}; use sp_runtime::traits::AccountIdConversion; use std::net::SocketAddr; -const UNSUPPORTED_CHAIN_MESSAGE: &str = "Unsupported chain spec, please use litentry*"; +const UNSUPPORTED_CHAIN_MESSAGE: &str = "Unsupported chain spec, please use heima* or litentry-paseo*"; trait IdentifyChain { - fn is_litentry(&self) -> bool; + fn is_heima(&self) -> bool; fn is_paseo(&self) -> bool; fn is_standalone(&self) -> bool; } impl IdentifyChain for dyn sc_service::ChainSpec { - fn is_litentry(&self) -> bool { + fn is_heima(&self) -> bool { // we need the combined condition as the id in our paseo spec starts with `litentry-paseo` // simply renaming `litentry-paseo` to `paseo` everywhere would have an impact on the // existing litentry-paseo chain @@ -56,8 +56,8 @@ impl IdentifyChain for dyn sc_service::ChainSpec { } impl IdentifyChain for T { - fn is_litentry(&self) -> bool { - ::is_litentry(self) + fn is_heima(&self) -> bool { + ::is_heima(self) } fn is_paseo(&self) -> bool { ::is_paseo(self) @@ -72,19 +72,19 @@ fn load_spec(id: &str) -> std::result::Result, St // `--chain=standalone or --chain=dev` to start a standalone node with paseo-dev chain spec // mainly based on Acala's `dev` implementation "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")[..], + // Heima + "heima-dev" => Box::new(chain_specs::heima::get_chain_spec_dev()), + "heima-staging" => Box::new(chain_specs::heima::get_chain_spec_staging()), + "heima" => Box::new(chain_specs::ChainSpec::from_json_bytes( + &include_bytes!("../res/chain_specs/heima.json")[..], )?), // Paseo "paseo-dev" => Box::new(chain_specs::paseo::get_chain_spec_dev(false)), "paseo" => Box::new(chain_specs::ChainSpec::from_json_bytes( &include_bytes!("../res/chain_specs/paseo.json")[..], )?), - // Generate res/chain_specs/litentry.json - "generate-litentry" => Box::new(chain_specs::litentry::get_chain_spec_prod()), + // Generate res/chain_specs/heima.json + "generate-heima" => Box::new(chain_specs::heima::get_chain_spec_prod()), // Generate res/chain_specs/paseo.json "generate-paseo" => Box::new(chain_specs::paseo::get_chain_spec_prod()), path => { @@ -92,7 +92,7 @@ fn load_spec(id: &str) -> std::result::Result, St if chain_spec.is_paseo() { Box::new(chain_specs::ChainSpec::from_json_file(path.into())?) } else { - // Fallback: use Litentry chain spec + // Fallback: use heima chain spec Box::new(chain_spec) } }, @@ -101,7 +101,7 @@ fn load_spec(id: &str) -> std::result::Result, St impl SubstrateCli for Cli { fn impl_name() -> String { - "Litentry node".into() + "Heima node".into() } fn impl_version() -> String { @@ -109,7 +109,7 @@ impl SubstrateCli for Cli { } fn description() -> String { - "Litentry node\n\nThe command-line arguments provided first will be \ + "Heima node\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ heima-node -- " @@ -125,7 +125,7 @@ impl SubstrateCli for Cli { } fn copyright_start_year() -> i32 { - 2017 + 2019 } fn load_spec(&self, id: &str) -> std::result::Result, String> { @@ -135,7 +135,7 @@ impl SubstrateCli for Cli { impl SubstrateCli for RelayChainCli { fn impl_name() -> String { - "Litentry node".into() + "Heima node".into() } fn impl_version() -> String { @@ -143,7 +143,7 @@ impl SubstrateCli for RelayChainCli { } fn description() -> String { - "Litentry node\n\nThe command-line arguments provided first will be \ + "Heima node\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ heima-node -- " @@ -159,7 +159,7 @@ impl SubstrateCli for RelayChainCli { } fn copyright_start_year() -> i32 { - 2017 + 2019 } fn load_spec(&self, id: &str) -> std::result::Result, String> { @@ -170,10 +170,10 @@ impl SubstrateCli for RelayChainCli { /// Creates partial components for the runtimes that are supported by the benchmarks. macro_rules! construct_benchmark_partials { ($config:expr, |$partials:ident| $code:expr) => { - if $config.chain_spec.is_litentry() { - let $partials = new_partial::( + if $config.chain_spec.is_heima() { + let $partials = new_partial::( &$config, - build_import_queue::, + build_import_queue::, false, true, )?; @@ -196,14 +196,14 @@ macro_rules! construct_async_run { (|$components:ident, $cli:ident, $cmd:ident, $config:ident| $( $code:tt )* ) => {{ let runner = $cli.create_runner($cmd)?; - if runner.config().chain_spec.is_litentry() { + if runner.config().chain_spec.is_heima() { runner.async_run(|$config| { let $components = new_partial::< - litentry_parachain_runtime::RuntimeApi, + heima_parachain_runtime::RuntimeApi, _ >( &$config, - build_import_queue::, + build_import_queue::, false, $cli.delayed_best_block, )?; @@ -284,12 +284,12 @@ pub fn run() -> Result<()> { Some(Subcommand::ExportGenesisHead(cmd)) => { let runner = cli.create_runner(cmd)?; - if runner.config().chain_spec.is_litentry() { + if runner.config().chain_spec.is_heima() { runner.sync_run(|config| { let sc_service::PartialComponents { client, .. } = - new_partial::( + new_partial::( &config, - build_import_queue::, + build_import_queue::, false, cli.delayed_best_block, )?; @@ -428,8 +428,8 @@ pub fn run() -> Result<()> { let additional_config = AdditionalConfig { evm_tracing_config, enable_evm_rpc: cli.enable_evm_rpc }; - if config.chain_spec.is_litentry() { - start_node::( + if config.chain_spec.is_heima() { + start_node::( config, polkadot_config, collator_options, diff --git a/parachain/runtime/paseo/src/lib.rs b/parachain/runtime/paseo/src/lib.rs index c818154946..9e60311463 100644 --- a/parachain/runtime/paseo/src/lib.rs +++ b/parachain/runtime/paseo/src/lib.rs @@ -24,7 +24,7 @@ #[macro_use] extern crate frame_benchmarking; -use core_primitives::LITENTRY_PARA_ID; +use core_primitives::HEIMA_PARA_ID; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use cumulus_primitives_core::AggregateMessageOrigin; use frame_support::{ @@ -951,7 +951,7 @@ impl pallet_evm::FeeCalculator for TransactionPaymentAsGasPrice { parameter_types! { pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); - pub ChainId: u64 = LITENTRY_PARA_ID.into(); + pub ChainId: u64 = HEIMA_PARA_ID.into(); pub BlockGasLimit: U256 = U256::from( NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS );