mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-09 20:11:03 +00:00
Complete terminology rebrand to Pezkuwi ecosystem
Applied global changes: Polkadot->Pezkuwi, Parachain->TeyrChain, pallet->pezpallet, frame->pezframe. Updated authors in Cargo.toml to include Kurdistan Tech Institute and pezkuwichain team. Used Cargo aliases to maintain SDK compatibility while using rebranded names in source code.
This commit is contained in:
@@ -21,10 +21,10 @@ serde_json = { workspace = true }
|
||||
# Local
|
||||
generic-runtime-template = { path = "../runtime" }
|
||||
|
||||
# Substrate
|
||||
frame-benchmarking = { workspace = true }
|
||||
frame-benchmarking-cli = { workspace = true }
|
||||
pallet-transaction-payment-rpc = { workspace = true }
|
||||
# Bizinikiwi
|
||||
pezframe-benchmarking = { workspace = true }
|
||||
pezframe-benchmarking-cli = { workspace = true }
|
||||
pezpallet-transaction-payment-rpc = { workspace = true }
|
||||
sc-basic-authorship = { workspace = true }
|
||||
sc-chain-spec = { workspace = true }
|
||||
sc-cli = { workspace = true }
|
||||
@@ -50,13 +50,13 @@ sp-io = { workspace = true }
|
||||
sp-keystore = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-timestamp = { workspace = true }
|
||||
substrate-frame-rpc-system = { workspace = true }
|
||||
substrate-prometheus-endpoint = { workspace = true }
|
||||
bizinikiwi-pezframe-rpc-system = { workspace = true }
|
||||
bizinikiwi-prometheus-endpoint = { workspace = true }
|
||||
|
||||
# Polkadot
|
||||
polkadot-cli = { workspace = true }
|
||||
polkadot-primitives = { workspace = true }
|
||||
xcm = { workspace = true }
|
||||
# Pezkuwi
|
||||
pezkuwi-cli = { workspace = true }
|
||||
pezkuwi-primitives = { workspace = true }
|
||||
staging-xcm = { workspace = true }
|
||||
|
||||
# Cumulus
|
||||
color-print = { workspace = true }
|
||||
@@ -67,31 +67,31 @@ cumulus-client-consensus-common = { workspace = true }
|
||||
cumulus-client-consensus-proposer = { workspace = true }
|
||||
cumulus-client-service = { workspace = true }
|
||||
cumulus-primitives-core = { workspace = true }
|
||||
cumulus-primitives-parachain-inherent = { workspace = true }
|
||||
cumulus-primitives-teyrchain-inherent = { workspace = true }
|
||||
cumulus-relay-chain-interface = { workspace = true }
|
||||
|
||||
# Tanssi
|
||||
nimbus-consensus = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
substrate-build-script-utils = { workspace = true }
|
||||
bizinikiwi-build-script-utils = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
async-backing = []
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking-cli/runtime-benchmarks",
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"pezframe-benchmarking-cli/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"generic-runtime-template/runtime-benchmarks",
|
||||
"polkadot-cli/runtime-benchmarks",
|
||||
"polkadot-primitives/runtime-benchmarks",
|
||||
"pezkuwi-cli/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-service/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
]
|
||||
tanssi = []
|
||||
try-runtime = [
|
||||
"generic-runtime-template/try-runtime",
|
||||
"polkadot-cli/try-runtime",
|
||||
"pezkuwi-cli/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||
use bizinikiwi_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||
|
||||
fn main() {
|
||||
generate_cargo_keys();
|
||||
|
||||
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
|
||||
use sp_core::{sr25519, Pair, Public};
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// Specialized `ChainSpec` for the normal parachain runtime.
|
||||
/// Specialized `ChainSpec` for the normal teyrchain runtime.
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
|
||||
|
||||
/// The default XCM version to set in genesis config.
|
||||
@@ -25,9 +25,9 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Extensions {
|
||||
/// The relay chain of the Parachain.
|
||||
/// The relay chain of the TeyrChain.
|
||||
pub relay_chain: String,
|
||||
/// The id of the Parachain.
|
||||
/// The id of the TeyrChain.
|
||||
pub para_id: u32,
|
||||
}
|
||||
|
||||
@@ -186,8 +186,8 @@ fn testnet_genesis(
|
||||
"balances": {
|
||||
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
|
||||
},
|
||||
"parachainInfo": {
|
||||
"parachainId": id,
|
||||
"teyrchainInfo": {
|
||||
"teyrchainId": id,
|
||||
},
|
||||
"collatorSelection": {
|
||||
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
|
||||
@@ -206,7 +206,7 @@ fn testnet_genesis(
|
||||
.collect::<Vec<_>>(),
|
||||
},
|
||||
"treasury": {},
|
||||
"polkadotXcm": {
|
||||
"pezkuwiXcm": {
|
||||
"safeXcmVersion": Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
"sudo": { "key": Some(root) }
|
||||
@@ -223,11 +223,11 @@ fn testnet_genesis(
|
||||
"balances": {
|
||||
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
|
||||
},
|
||||
"parachainInfo": {
|
||||
"parachainId": id,
|
||||
"teyrchainInfo": {
|
||||
"teyrchainId": id,
|
||||
},
|
||||
"treasury": {},
|
||||
"polkadotXcm": {
|
||||
"pezkuwiXcm": {
|
||||
"safeXcmVersion": Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
"sudo": { "key": Some(root) }
|
||||
|
||||
@@ -24,19 +24,19 @@ pub enum Subcommand {
|
||||
/// Remove the whole chain.
|
||||
PurgeChain(cumulus_client_cli::PurgeChainCmd),
|
||||
|
||||
/// Export the genesis head data of the parachain.
|
||||
/// Export the genesis head data of the teyrchain.
|
||||
///
|
||||
/// Head data is the encoded block header.
|
||||
#[command(alias = "export-genesis-state")]
|
||||
ExportGenesisHead(cumulus_client_cli::ExportGenesisHeadCommand),
|
||||
|
||||
/// Export the genesis wasm of the parachain.
|
||||
/// Export the genesis wasm of the teyrchain.
|
||||
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),
|
||||
|
||||
/// Sub-commands concerned with benchmarking.
|
||||
/// The pallet benchmarking moved to the `pallet` sub-command.
|
||||
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
|
||||
#[command(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
Benchmark(pezframe_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
/// Try-runtime has migrated to a standalone
|
||||
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
|
||||
@@ -47,14 +47,14 @@ pub enum Subcommand {
|
||||
|
||||
const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
|
||||
r#"<bold><underline>Examples:</></>
|
||||
<bold>parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json</>
|
||||
<bold>teyrchain-template-node build-spec --disable-default-bootnode > plain-teyrchain-chainspec.json</>
|
||||
Export a chainspec for a local testnet in json format.
|
||||
<bold>parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain paseo-local</>
|
||||
Launch a full node with chain specification loaded from plain-parachain-chainspec.json.
|
||||
<bold>parachain-template-node</>
|
||||
Launch a full node with default parachain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>parachain-template-node --collator</>
|
||||
Launch a collator with default parachain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>teyrchain-template-node --chain plain-teyrchain-chainspec.json --tmp -- --chain paseo-local</>
|
||||
Launch a full node with chain specification loaded from plain-teyrchain-chainspec.json.
|
||||
<bold>teyrchain-template-node</>
|
||||
Launch a full node with default teyrchain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>teyrchain-template-node --collator</>
|
||||
Launch a collator with default teyrchain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
"#
|
||||
);
|
||||
#[derive(Debug, clap::Parser)]
|
||||
@@ -89,7 +89,7 @@ pub struct Cli {
|
||||
#[derive(Debug)]
|
||||
pub struct RelayChainCli {
|
||||
/// The actual relay chain cli object.
|
||||
pub base: polkadot_cli::RunCmd,
|
||||
pub base: pezkuwi_cli::RunCmd,
|
||||
|
||||
/// Optional chain id that should be passed to the relay chain.
|
||||
pub chain_id: Option<String>,
|
||||
@@ -107,7 +107,7 @@ impl RelayChainCli {
|
||||
) -> Self {
|
||||
let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec);
|
||||
let chain_id = extension.map(|e| e.relay_chain.clone());
|
||||
let base_path = para_config.base_path.path().join("polkadot");
|
||||
let base_path = para_config.base_path.path().join("pezkuwi");
|
||||
Self {
|
||||
base_path: Some(base_path),
|
||||
chain_id,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use pezframe_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use generic_runtime_template::Block;
|
||||
use log::info;
|
||||
use sc_cli::{
|
||||
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
|
||||
NetworkParams, Result, RpcEndpoint, SharedParams, SubstrateCli,
|
||||
NetworkParams, Result, RpcEndpoint, SharedParams, BizinikiwiCli,
|
||||
};
|
||||
use sc_service::config::{BasePath, PrometheusConfig};
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
@@ -25,9 +25,9 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
})
|
||||
}
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
impl BizinikiwiCli for Cli {
|
||||
fn impl_name() -> String {
|
||||
"Parachain Collator Template".into()
|
||||
"TeyrChain Collator Template".into()
|
||||
}
|
||||
|
||||
fn impl_version() -> String {
|
||||
@@ -36,9 +36,9 @@ impl SubstrateCli for Cli {
|
||||
|
||||
fn description() -> String {
|
||||
format!(
|
||||
"Parachain Collator Template\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{} <parachain-args> -- <relay-chain-args>",
|
||||
"TeyrChain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the teyrchain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <teyrchain-args> -- <relay-chain-args>",
|
||||
Self::executable_name()
|
||||
)
|
||||
}
|
||||
@@ -48,7 +48,7 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/polkadot-sdk/issues/new".into()
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
@@ -60,9 +60,9 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
}
|
||||
|
||||
impl SubstrateCli for RelayChainCli {
|
||||
impl BizinikiwiCli for RelayChainCli {
|
||||
fn impl_name() -> String {
|
||||
"Parachain Collator Template".into()
|
||||
"TeyrChain Collator Template".into()
|
||||
}
|
||||
|
||||
fn impl_version() -> String {
|
||||
@@ -71,9 +71,9 @@ impl SubstrateCli for RelayChainCli {
|
||||
|
||||
fn description() -> String {
|
||||
format!(
|
||||
"Parachain Collator Template\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{} <parachain-args> -- <relay-chain-args>",
|
||||
"TeyrChain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the teyrchain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <teyrchain-args> -- <relay-chain-args>",
|
||||
Self::executable_name()
|
||||
)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ impl SubstrateCli for RelayChainCli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/polkadot-sdk/issues/new".into()
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
@@ -91,7 +91,7 @@ impl SubstrateCli for RelayChainCli {
|
||||
}
|
||||
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||
polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
|
||||
pezkuwi_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,19 +147,19 @@ pub fn run() -> Result<()> {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
runner.sync_run(|config| {
|
||||
let polkadot_cli = RelayChainCli::new(
|
||||
let pezkuwi_cli = RelayChainCli::new(
|
||||
&config,
|
||||
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()),
|
||||
);
|
||||
|
||||
let polkadot_config = SubstrateCli::create_configuration(
|
||||
&polkadot_cli,
|
||||
&polkadot_cli,
|
||||
let pezkuwi_config = BizinikiwiCli::create_configuration(
|
||||
&pezkuwi_cli,
|
||||
&pezkuwi_cli,
|
||||
config.tokio_handle.clone(),
|
||||
)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
|
||||
cmd.run(config, polkadot_config)
|
||||
cmd.run(config, pezkuwi_config)
|
||||
})
|
||||
},
|
||||
Some(Subcommand::ExportGenesisHead(cmd)) => {
|
||||
@@ -230,31 +230,31 @@ pub fn run() -> Result<()> {
|
||||
|
||||
let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
|
||||
.map(|e| e.para_id)
|
||||
.ok_or("Could not find parachain ID in chain-spec.")?;
|
||||
.ok_or("Could not find teyrchain ID in chain-spec.")?;
|
||||
|
||||
let polkadot_cli = RelayChainCli::new(
|
||||
let pezkuwi_cli = RelayChainCli::new(
|
||||
&config,
|
||||
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()),
|
||||
);
|
||||
|
||||
let id = ParaId::from(para_id);
|
||||
|
||||
let parachain_account =
|
||||
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(
|
||||
let teyrchain_account =
|
||||
AccountIdConversion::<pezkuwi_primitives::AccountId>::into_account_truncating(
|
||||
&id,
|
||||
);
|
||||
|
||||
let tokio_handle = config.tokio_handle.clone();
|
||||
let polkadot_config =
|
||||
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
|
||||
let pezkuwi_config =
|
||||
BizinikiwiCli::create_configuration(&pezkuwi_cli, &pezkuwi_cli, tokio_handle)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
|
||||
info!("Parachain Account: {parachain_account}");
|
||||
info!("TeyrChain Account: {teyrchain_account}");
|
||||
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
|
||||
|
||||
crate::service::start_parachain_node(
|
||||
crate::service::start_teyrchain_node(
|
||||
config,
|
||||
polkadot_config,
|
||||
pezkuwi_config,
|
||||
collator_options,
|
||||
id,
|
||||
hwbench,
|
||||
@@ -318,7 +318,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
where
|
||||
F: FnOnce(&mut sc_cli::LoggerBuilder),
|
||||
{
|
||||
unreachable!("PolkadotCli is never initialized; qed");
|
||||
unreachable!("PezkuwiCli is never initialized; qed");
|
||||
}
|
||||
|
||||
fn chain_id(&self, is_dev: bool) -> Result<String> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Substrate Parachain Node Template CLI
|
||||
//! Bizinikiwi TeyrChain Node Template CLI
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! A collection of node-specific RPC methods.
|
||||
//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Substrate nodes. This file extends those RPC definitions with
|
||||
//! Bizinikiwi provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Bizinikiwi nodes. This file extends those RPC definitions with
|
||||
//! capabilities that are specific to this project's runtime configuration.
|
||||
|
||||
#![warn(missing_docs)]
|
||||
@@ -37,13 +37,13 @@ where
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: bizinikiwi_pezframe_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: BlockBuilder<Block>,
|
||||
P: TransactionPool + Sync + Send + 'static,
|
||||
{
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use substrate_frame_rpc_system::{System, SystemApiServer};
|
||||
use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use bizinikiwi_pezframe_rpc_system::{System, SystemApiServer};
|
||||
|
||||
let mut module = RpcExtension::new(());
|
||||
let FullDeps { client, pool } = deps;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
|
||||
//! Service and ServiceFactory implementation. Specialized wrapper over bizinikiwi service.
|
||||
|
||||
// std
|
||||
use std::{sync::Arc, time::Duration};
|
||||
@@ -7,12 +7,12 @@ use cumulus_client_cli::CollatorOptions;
|
||||
// Cumulus Imports
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_collator::service::CollatorService;
|
||||
use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;
|
||||
use cumulus_client_consensus_common::TeyrChainBlockImport as TTeyrChainBlockImport;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_consensus_proposer::Proposer;
|
||||
use cumulus_client_service::{
|
||||
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
|
||||
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, ParachainHostFunctions,
|
||||
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, TeyrChainHostFunctions,
|
||||
StartRelayChainTasksParams,
|
||||
};
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
@@ -23,8 +23,8 @@ use cumulus_primitives_core::ParaId;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_relay_chain_interface::OverseerHandle;
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
// Substrate Imports
|
||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
// Bizinikiwi Imports
|
||||
use pezframe_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
// Local Runtime Types
|
||||
use generic_runtime_template::{
|
||||
apis::RuntimeApi,
|
||||
@@ -42,24 +42,24 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use sp_keystore::KeystorePtr;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
use bizinikiwi_prometheus_endpoint::Registry;
|
||||
|
||||
type ParachainExecutor = WasmExecutor<ParachainHostFunctions>;
|
||||
type TeyrChainExecutor = WasmExecutor<TeyrChainHostFunctions>;
|
||||
|
||||
type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;
|
||||
type TeyrChainClient = TFullClient<Block, RuntimeApi, TeyrChainExecutor>;
|
||||
|
||||
type ParachainBackend = TFullBackend<Block>;
|
||||
type TeyrChainBackend = TFullBackend<Block>;
|
||||
|
||||
type ParachainBlockImport = TParachainBlockImport<Block, Arc<ParachainClient>, ParachainBackend>;
|
||||
type TeyrChainBlockImport = TTeyrChainBlockImport<Block, Arc<TeyrChainClient>, TeyrChainBackend>;
|
||||
|
||||
/// Assembly of PartialComponents (enough to run chain ops subcommands)
|
||||
pub type Service = PartialComponents<
|
||||
ParachainClient,
|
||||
ParachainBackend,
|
||||
TeyrChainClient,
|
||||
TeyrChainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>,
|
||||
(ParachainBlockImport, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>,
|
||||
(TeyrChainBlockImport, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>;
|
||||
|
||||
/// Starts a `ServiceBuilder` for a full service.
|
||||
@@ -83,7 +83,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
.default_heap_pages
|
||||
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||
|
||||
let executor = ParachainExecutor::builder()
|
||||
let executor = TeyrChainExecutor::builder()
|
||||
.with_execution_method(config.executor.wasm_method)
|
||||
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||
@@ -123,7 +123,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
import_queue(config, client.clone(), backend.clone(), &task_manager);
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let (block_import, import_queue) = {
|
||||
let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
|
||||
let block_import = TeyrChainBlockImport::new(client.clone(), backend.clone());
|
||||
(
|
||||
block_import.clone(),
|
||||
build_import_queue(
|
||||
@@ -148,20 +148,20 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
})
|
||||
}
|
||||
|
||||
/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.
|
||||
/// Start a node with the given teyrchain `Configuration` and relay chain `Configuration`.
|
||||
///
|
||||
/// This is the actual implementation that is abstract over the executor and the runtime api.
|
||||
#[sc_tracing::logging::prefix_logs_with("Parachain")]
|
||||
#[sc_tracing::logging::prefix_logs_with("TeyrChain")]
|
||||
async fn start_node_impl(
|
||||
parachain_config: Configuration,
|
||||
polkadot_config: Configuration,
|
||||
teyrchain_config: Configuration,
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<ParachainClient>)> {
|
||||
let parachain_config = prepare_node_config(parachain_config);
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
let teyrchain_config = prepare_node_config(teyrchain_config);
|
||||
|
||||
let params = new_partial(¶chain_config)?;
|
||||
let params = new_partial(&teyrchain_config)?;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let (block_import, mut telemetry, telemetry_worker_handle) = params.other;
|
||||
#[cfg(feature = "tanssi")]
|
||||
@@ -171,8 +171,8 @@ async fn start_node_impl(
|
||||
_,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
>::new(
|
||||
¶chain_config.network,
|
||||
parachain_config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
|
||||
&teyrchain_config.network,
|
||||
teyrchain_config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
|
||||
);
|
||||
|
||||
let client = params.client.clone();
|
||||
@@ -180,8 +180,8 @@ async fn start_node_impl(
|
||||
let mut task_manager = params.task_manager;
|
||||
|
||||
let relay_chain_interface = build_relay_chain_interface(
|
||||
polkadot_config,
|
||||
¶chain_config,
|
||||
pezkuwi_config,
|
||||
&teyrchain_config,
|
||||
telemetry_worker_handle,
|
||||
&mut task_manager,
|
||||
collator_options.clone(),
|
||||
@@ -195,15 +195,15 @@ async fn start_node_impl(
|
||||
#[cfg(feature = "tanssi")]
|
||||
let (relay_chain_interface, _) = relay_chain_interface;
|
||||
|
||||
let validator = parachain_config.role.is_authority();
|
||||
let validator = teyrchain_config.role.is_authority();
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let prometheus_registry = parachain_config.prometheus_registry().cloned();
|
||||
let prometheus_registry = teyrchain_config.prometheus_registry().cloned();
|
||||
let transaction_pool = params.transaction_pool.clone();
|
||||
let import_queue_service = params.import_queue.service();
|
||||
|
||||
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
|
||||
build_network(BuildNetworkParams {
|
||||
parachain_config: ¶chain_config,
|
||||
teyrchain_config: &teyrchain_config,
|
||||
net_config,
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
@@ -215,12 +215,12 @@ async fn start_node_impl(
|
||||
})
|
||||
.await?;
|
||||
|
||||
if parachain_config.offchain_worker.enabled {
|
||||
if teyrchain_config.offchain_worker.enabled {
|
||||
use futures::FutureExt;
|
||||
let offchain_workers =
|
||||
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
|
||||
runtime_api_provider: client.clone(),
|
||||
is_validator: parachain_config.role.is_authority(),
|
||||
is_validator: teyrchain_config.role.is_authority(),
|
||||
keystore: Some(params.keystore_container.keystore()),
|
||||
offchain_db: backend.offchain_storage(),
|
||||
transaction_pool: Some(OffchainTransactionPoolFactory::new(
|
||||
@@ -255,7 +255,7 @@ async fn start_node_impl(
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
task_manager: &mut task_manager,
|
||||
config: parachain_config,
|
||||
config: teyrchain_config,
|
||||
keystore: params.keystore_container.keystore(),
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
backend,
|
||||
@@ -348,15 +348,15 @@ async fn start_node_impl(
|
||||
|
||||
#[cfg(feature = "tanssi")]
|
||||
pub fn import_queue(
|
||||
parachain_config: &Configuration,
|
||||
client: Arc<ParachainClient>,
|
||||
backend: Arc<ParachainBackend>,
|
||||
teyrchain_config: &Configuration,
|
||||
client: Arc<TeyrChainClient>,
|
||||
backend: Arc<TeyrChainBackend>,
|
||||
task_manager: &TaskManager,
|
||||
) -> (ParachainBlockImport, sc_consensus::BasicQueue<Block>) {
|
||||
) -> (TeyrChainBlockImport, sc_consensus::BasicQueue<Block>) {
|
||||
// The nimbus import queue ONLY checks the signature correctness
|
||||
// Any other checks corresponding to the author-correctness should be done
|
||||
// in the runtime
|
||||
let block_import = ParachainBlockImport::new(client.clone(), backend);
|
||||
let block_import = TeyrChainBlockImport::new(client.clone(), backend);
|
||||
|
||||
let import_queue = nimbus_consensus::import_queue(
|
||||
client,
|
||||
@@ -367,7 +367,7 @@ pub fn import_queue(
|
||||
Ok((time,))
|
||||
},
|
||||
&task_manager.spawn_essential_handle(),
|
||||
parachain_config.prometheus_registry(),
|
||||
teyrchain_config.prometheus_registry(),
|
||||
false,
|
||||
)
|
||||
.expect("function never fails");
|
||||
@@ -375,11 +375,11 @@ pub fn import_queue(
|
||||
(block_import, import_queue)
|
||||
}
|
||||
|
||||
/// Build the import queue for the parachain runtime.
|
||||
/// Build the import queue for the teyrchain runtime.
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn build_import_queue(
|
||||
client: Arc<ParachainClient>,
|
||||
block_import: ParachainBlockImport,
|
||||
client: Arc<TeyrChainClient>,
|
||||
block_import: TeyrChainBlockImport,
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
@@ -405,14 +405,14 @@ fn build_import_queue(
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn start_consensus(
|
||||
client: Arc<ParachainClient>,
|
||||
#[cfg(feature = "async-backing")] backend: Arc<ParachainBackend>,
|
||||
block_import: ParachainBlockImport,
|
||||
client: Arc<TeyrChainClient>,
|
||||
#[cfg(feature = "async-backing")] backend: Arc<TeyrChainBackend>,
|
||||
block_import: TeyrChainBlockImport,
|
||||
prometheus_registry: Option<&Registry>,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
relay_chain_interface: Arc<dyn RelayChainInterface>,
|
||||
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>>,
|
||||
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>>,
|
||||
keystore: KeystorePtr,
|
||||
relay_chain_slot_duration: Duration,
|
||||
para_id: ParaId,
|
||||
@@ -489,13 +489,13 @@ fn start_consensus(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Start a parachain node.
|
||||
pub async fn start_parachain_node(
|
||||
parachain_config: Configuration,
|
||||
polkadot_config: Configuration,
|
||||
/// Start a teyrchain node.
|
||||
pub async fn start_teyrchain_node(
|
||||
teyrchain_config: Configuration,
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<ParachainClient>)> {
|
||||
start_node_impl(parachain_config, polkadot_config, collator_options, para_id, hwbench).await
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
start_node_impl(teyrchain_config, pezkuwi_config, collator_options, para_id, hwbench).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user