mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-26 14:37:57 +00:00
Update documentation and templates for Pezkuwi branding
This commit is contained in:
@@ -25,31 +25,31 @@ generic-runtime-template = { path = "../runtime" }
|
||||
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 }
|
||||
sc-client-api = { workspace = true }
|
||||
sc-consensus = { workspace = true }
|
||||
sc-executor = { workspace = true }
|
||||
sc-network = { workspace = true }
|
||||
sc-network-sync = { workspace = true }
|
||||
sc-offchain = { workspace = true }
|
||||
sc-rpc = { workspace = true }
|
||||
sc-service = { workspace = true }
|
||||
sc-sysinfo = { workspace = true }
|
||||
sc-telemetry = { workspace = true }
|
||||
sc-tracing = { workspace = true }
|
||||
sc-transaction-pool = { workspace = true }
|
||||
sc-transaction-pool-api = { workspace = true }
|
||||
sp-api = { workspace = true }
|
||||
sp-block-builder = { workspace = true }
|
||||
sp-blockchain = { workspace = true }
|
||||
sp-consensus-aura = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-keystore = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-timestamp = { workspace = true }
|
||||
pezsc-basic-authorship = { workspace = true }
|
||||
pezsc-chain-spec = { workspace = true }
|
||||
pezsc-cli = { workspace = true }
|
||||
pezsc-client-api = { workspace = true }
|
||||
pezsc-consensus = { workspace = true }
|
||||
pezsc-executor = { workspace = true }
|
||||
pezsc-network = { workspace = true }
|
||||
pezsc-network-sync = { workspace = true }
|
||||
pezsc-offchain = { workspace = true }
|
||||
pezsc-rpc = { workspace = true }
|
||||
pezsc-service = { workspace = true }
|
||||
pezsc-sysinfo = { workspace = true }
|
||||
pezsc-telemetry = { workspace = true }
|
||||
pezsc-tracing = { workspace = true }
|
||||
pezsc-transaction-pool = { workspace = true }
|
||||
pezsc-transaction-pool-api = { workspace = true }
|
||||
pezsp-api = { workspace = true }
|
||||
pezsp-block-builder = { workspace = true }
|
||||
pezsp-blockchain = { workspace = true }
|
||||
pezsp-consensus-aura = { workspace = true }
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
pezsp-keystore = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
pezsp-timestamp = { workspace = true }
|
||||
bizinikiwi-pezframe-rpc-system = { workspace = true }
|
||||
bizinikiwi-prometheus-endpoint = { workspace = true }
|
||||
|
||||
@@ -58,17 +58,17 @@ pezkuwi-cli = { workspace = true }
|
||||
pezkuwi-primitives = { workspace = true }
|
||||
staging-xcm = { workspace = true }
|
||||
|
||||
# Cumulus
|
||||
# Pezpezcumulus
|
||||
color-print = { workspace = true }
|
||||
cumulus-client-cli = { workspace = true }
|
||||
cumulus-client-collator = { workspace = true }
|
||||
cumulus-client-consensus-aura = { workspace = true }
|
||||
cumulus-client-consensus-common = { workspace = true }
|
||||
cumulus-client-consensus-proposer = { workspace = true }
|
||||
cumulus-client-service = { workspace = true }
|
||||
cumulus-primitives-core = { workspace = true }
|
||||
cumulus-primitives-teyrchain-inherent = { workspace = true }
|
||||
cumulus-relay-chain-interface = { workspace = true }
|
||||
pezcumulus-client-cli = { workspace = true }
|
||||
pezcumulus-client-collator = { workspace = true }
|
||||
pezcumulus-client-consensus-aura = { workspace = true }
|
||||
pezcumulus-client-consensus-common = { workspace = true }
|
||||
pezcumulus-client-consensus-proposer = { workspace = true }
|
||||
pezcumulus-client-service = { workspace = true }
|
||||
pezcumulus-primitives-core = { workspace = true }
|
||||
pezcumulus-primitives-teyrchain-inherent = { workspace = true }
|
||||
pezcumulus-relay-chain-interface = { workspace = true }
|
||||
|
||||
# Tanssi
|
||||
nimbus-consensus = { workspace = true }
|
||||
@@ -85,14 +85,14 @@ runtime-benchmarks = [
|
||||
"generic-runtime-template/runtime-benchmarks",
|
||||
"pezkuwi-cli/runtime-benchmarks",
|
||||
"pezkuwi-primitives/runtime-benchmarks",
|
||||
"sc-service/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezsc-service/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
tanssi = []
|
||||
try-runtime = [
|
||||
"generic-runtime-template/try-runtime",
|
||||
"pezkuwi-cli/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use generic_runtime_template::{constants::currency::EXISTENTIAL_DEPOSIT, AuraId};
|
||||
use generic_runtime_template::{AccountId, Signature};
|
||||
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
|
||||
use sc_service::ChainType;
|
||||
use pezsc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
|
||||
use pezsc_service::ChainType;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_core::{sr25519, Pair, Public};
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
use pezsp_core::{sr25519, Pair, Public};
|
||||
use pezsp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// Specialized `ChainSpec` for the normal teyrchain runtime.
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
|
||||
pub type ChainSpec = pezsc_service::GenericChainSpec<Extensions>;
|
||||
|
||||
/// The default XCM version to set in genesis config.
|
||||
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
|
||||
@@ -33,8 +33,8 @@ pub struct Extensions {
|
||||
|
||||
impl Extensions {
|
||||
/// Try to get the extension from the given `ChainSpec`.
|
||||
pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
|
||||
sc_chain_spec::get_extension(chain_spec.extensions())
|
||||
pub fn try_get(chain_spec: &dyn pezsc_service::ChainSpec) -> Option<&Self> {
|
||||
pezsc_chain_spec::get_extension(chain_spec.extensions())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ pub fn template_session_keys(keys: AuraId) -> generic_runtime_template::SessionK
|
||||
|
||||
pub fn development_config() -> ChainSpec {
|
||||
// Give your base currency a unit name and decimal places
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
let mut properties = pezsc_chain_spec::Properties::new();
|
||||
properties.insert("tokenSymbol".into(), "UNIT".into());
|
||||
properties.insert("tokenDecimals".into(), 12.into());
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
@@ -123,7 +123,7 @@ pub fn development_config() -> ChainSpec {
|
||||
|
||||
pub fn local_testnet_config() -> ChainSpec {
|
||||
// Give your base currency a unit name and decimal places
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
let mut properties = pezsc_chain_spec::Properties::new();
|
||||
properties.insert("tokenSymbol".into(), "UNIT".into());
|
||||
properties.insert("tokenDecimals".into(), 12.into());
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
|
||||
@@ -4,34 +4,34 @@ use std::path::PathBuf;
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
pub enum Subcommand {
|
||||
/// Build a chain specification.
|
||||
BuildSpec(sc_cli::BuildSpecCmd),
|
||||
BuildSpec(pezsc_cli::BuildSpecCmd),
|
||||
|
||||
/// Validate blocks.
|
||||
CheckBlock(sc_cli::CheckBlockCmd),
|
||||
CheckBlock(pezsc_cli::CheckBlockCmd),
|
||||
|
||||
/// Export blocks.
|
||||
ExportBlocks(sc_cli::ExportBlocksCmd),
|
||||
ExportBlocks(pezsc_cli::ExportBlocksCmd),
|
||||
|
||||
/// Export the state of a given block into a chain spec.
|
||||
ExportState(sc_cli::ExportStateCmd),
|
||||
ExportState(pezsc_cli::ExportStateCmd),
|
||||
|
||||
/// Import blocks.
|
||||
ImportBlocks(sc_cli::ImportBlocksCmd),
|
||||
ImportBlocks(pezsc_cli::ImportBlocksCmd),
|
||||
|
||||
/// Revert the chain to a previous state.
|
||||
Revert(sc_cli::RevertCmd),
|
||||
Revert(pezsc_cli::RevertCmd),
|
||||
|
||||
/// Remove the whole chain.
|
||||
PurgeChain(cumulus_client_cli::PurgeChainCmd),
|
||||
PurgeChain(pezcumulus_client_cli::PurgeChainCmd),
|
||||
|
||||
/// 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),
|
||||
ExportGenesisHead(pezcumulus_client_cli::ExportGenesisHeadCommand),
|
||||
|
||||
/// Export the genesis wasm of the teyrchain.
|
||||
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),
|
||||
ExportGenesisWasm(pezcumulus_client_cli::ExportGenesisWasmCommand),
|
||||
|
||||
/// Sub-commands concerned with benchmarking.
|
||||
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
|
||||
@@ -39,7 +39,7 @@ pub enum Subcommand {
|
||||
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
|
||||
/// [CLI](<https://github.com/pezkuwichain/try-runtime-cli>). The subcommand exists as a stub and
|
||||
/// deprecation notice. It will be removed entirely some time after January
|
||||
/// 2024.
|
||||
TryRuntime,
|
||||
@@ -69,7 +69,7 @@ pub struct Cli {
|
||||
pub subcommand: Option<Subcommand>,
|
||||
|
||||
#[command(flatten)]
|
||||
pub run: cumulus_client_cli::RunCmd,
|
||||
pub run: pezcumulus_client_cli::RunCmd,
|
||||
|
||||
/// Disable automatic hardware benchmarks.
|
||||
///
|
||||
@@ -102,7 +102,7 @@ impl RelayChainCli {
|
||||
/// Parse the relay chain CLI parameters using the para chain
|
||||
/// `Configuration`.
|
||||
pub fn new<'a>(
|
||||
para_config: &sc_service::Configuration,
|
||||
para_config: &pezsc_service::Configuration,
|
||||
relay_chain_args: impl Iterator<Item = &'a String>,
|
||||
) -> Self {
|
||||
let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use pezcumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use pezframe_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use generic_runtime_template::Block;
|
||||
use log::info;
|
||||
use sc_cli::{
|
||||
use pezsc_cli::{
|
||||
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
|
||||
NetworkParams, Result, RpcEndpoint, SharedParams, BizinikiwiCli,
|
||||
};
|
||||
use sc_service::config::{BasePath, PrometheusConfig};
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use pezsc_service::config::{BasePath, PrometheusConfig};
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
|
||||
use crate::{
|
||||
chain_spec,
|
||||
@@ -48,14 +48,14 @@ impl BizinikiwiCli for Cli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
"https://github.com/pezkuwichain/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
2020
|
||||
}
|
||||
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn pezsc_service::ChainSpec>, String> {
|
||||
load_spec(id)
|
||||
}
|
||||
}
|
||||
@@ -83,14 +83,14 @@ impl BizinikiwiCli for RelayChainCli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
"https://github.com/pezkuwichain/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
2020
|
||||
}
|
||||
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn pezsc_service::ChainSpec>, String> {
|
||||
pezkuwi_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
|
||||
}
|
||||
}
|
||||
@@ -181,9 +181,9 @@ pub fn run() -> Result<()> {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
// Switch on the concrete benchmark sub-command-
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
BenchmarkCmd::Pezpallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| cmd.run_with_spec::<sp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec)))
|
||||
runner.sync_run(|config| cmd.run_with_spec::<pezsp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec)))
|
||||
} else {
|
||||
Err("Benchmarking wasn't enabled when building the node. \
|
||||
You can enable it with `--features runtime-benchmarks`."
|
||||
@@ -195,7 +195,7 @@ pub fn run() -> Result<()> {
|
||||
}),
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
BenchmarkCmd::Storage(_) =>
|
||||
Err(sc_cli::Error::Input(
|
||||
Err(pezsc_cli::Error::Input(
|
||||
"Compile with --features=runtime-benchmarks \
|
||||
to enable storage benchmarks."
|
||||
.into(),
|
||||
@@ -215,7 +215,7 @@ pub fn run() -> Result<()> {
|
||||
_ => Err("Benchmarking sub-command unsupported".into()),
|
||||
}
|
||||
},
|
||||
Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()),
|
||||
Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/pezkuwichain/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()),
|
||||
None => {
|
||||
let runner = cli.create_runner(&cli.run.normalize())?;
|
||||
let collator_options = cli.run.collator_options();
|
||||
@@ -224,7 +224,7 @@ pub fn run() -> Result<()> {
|
||||
let hwbench = (!cli.no_hardware_benchmarks)
|
||||
.then_some(config.database.path().map(|database_path| {
|
||||
let _ = std::fs::create_dir_all(database_path);
|
||||
sc_sysinfo::gather_hwbench(Some(database_path), &SUBSTRATE_REFERENCE_HARDWARE)
|
||||
pezsc_sysinfo::gather_hwbench(Some(database_path), &SUBSTRATE_REFERENCE_HARDWARE)
|
||||
}))
|
||||
.flatten();
|
||||
|
||||
@@ -302,7 +302,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
Ok(self.shared_params().base_path()?.or_else(|| self.base_path.clone().map(Into::into)))
|
||||
}
|
||||
|
||||
fn rpc_addr(&self, default_listen_port: u16) -> sc_cli::Result<Option<Vec<RpcEndpoint>>> {
|
||||
fn rpc_addr(&self, default_listen_port: u16) -> pezsc_cli::Result<Option<Vec<RpcEndpoint>>> {
|
||||
self.base.base.rpc_addr(default_listen_port)
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
|
||||
fn init<F>(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()>
|
||||
where
|
||||
F: FnOnce(&mut sc_cli::LoggerBuilder),
|
||||
F: FnOnce(&mut pezsc_cli::LoggerBuilder),
|
||||
{
|
||||
unreachable!("PezkuwiCli is never initialized; qed");
|
||||
}
|
||||
@@ -327,11 +327,11 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
Ok(if chain_id.is_empty() { self.chain_id.clone().unwrap_or_default() } else { chain_id })
|
||||
}
|
||||
|
||||
fn role(&self, is_dev: bool) -> Result<sc_service::Role> {
|
||||
fn role(&self, is_dev: bool) -> Result<pezsc_service::Role> {
|
||||
self.base.base.role(is_dev)
|
||||
}
|
||||
|
||||
fn transaction_pool(&self, is_dev: bool) -> Result<sc_service::config::TransactionPoolOptions> {
|
||||
fn transaction_pool(&self, is_dev: bool) -> Result<pezsc_service::config::TransactionPoolOptions> {
|
||||
self.base.base.transaction_pool(is_dev)
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
self.base.base.trie_cache_maximum_size()
|
||||
}
|
||||
|
||||
fn rpc_methods(&self) -> Result<sc_service::config::RpcMethods> {
|
||||
fn rpc_methods(&self) -> Result<pezsc_service::config::RpcMethods> {
|
||||
self.base.base.rpc_methods()
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
fn telemetry_endpoints(
|
||||
&self,
|
||||
chain_spec: &Box<dyn ChainSpec>,
|
||||
) -> Result<Option<sc_telemetry::TelemetryEndpoints>> {
|
||||
) -> Result<Option<pezsc_telemetry::TelemetryEndpoints>> {
|
||||
self.base.base.telemetry_endpoints(chain_spec)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ mod cli;
|
||||
mod command;
|
||||
mod rpc;
|
||||
|
||||
fn main() -> sc_cli::Result<()> {
|
||||
fn main() -> pezsc_cli::Result<()> {
|
||||
command::run()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! A collection of node-specific RPC methods.
|
||||
//! Bizinikiwi provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! Bizinikiwi provides the `pezsc-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.
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use generic_runtime_template::{opaque::Block, AccountId, Balance, Nonce};
|
||||
use sc_client_api::AuxStore;
|
||||
use sc_transaction_pool_api::TransactionPool;
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_block_builder::BlockBuilder;
|
||||
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
||||
use pezsc_client_api::AuxStore;
|
||||
use pezsc_transaction_pool_api::TransactionPool;
|
||||
use pezsp_api::ProvideRuntimeApi;
|
||||
use pezsp_block_builder::BlockBuilder;
|
||||
use pezsp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
|
||||
|
||||
/// A type representing all RPC extensions.
|
||||
pub type RpcExtension = jsonrpsee::RpcModule<()>;
|
||||
|
||||
@@ -3,26 +3,26 @@
|
||||
// std
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use cumulus_client_cli::CollatorOptions;
|
||||
// Cumulus Imports
|
||||
use pezcumulus_client_cli::CollatorOptions;
|
||||
// Pezcumulus Imports
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_collator::service::CollatorService;
|
||||
use cumulus_client_consensus_common::TeyrChainBlockImport as TTeyrChainBlockImport;
|
||||
use pezcumulus_client_collator::service::CollatorService;
|
||||
use pezcumulus_client_consensus_common::TeyrChainBlockImport as TTeyrChainBlockImport;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_consensus_proposer::Proposer;
|
||||
use cumulus_client_service::{
|
||||
use pezcumulus_client_consensus_proposer::Proposer;
|
||||
use pezcumulus_client_service::{
|
||||
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
|
||||
BuildNetworkParams, CollatorSybilResistance, DARecoveryProfile, TeyrChainHostFunctions,
|
||||
StartRelayChainTasksParams,
|
||||
};
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_primitives_core::relay_chain::CollatorPair;
|
||||
use pezcumulus_primitives_core::relay_chain::CollatorPair;
|
||||
#[cfg(feature = "async-backing")]
|
||||
use cumulus_primitives_core::relay_chain::ValidationCode;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use pezcumulus_primitives_core::relay_chain::ValidationCode;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_relay_chain_interface::OverseerHandle;
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use pezcumulus_relay_chain_interface::OverseerHandle;
|
||||
use pezcumulus_relay_chain_interface::RelayChainInterface;
|
||||
// Bizinikiwi Imports
|
||||
use pezframe_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
// Local Runtime Types
|
||||
@@ -30,17 +30,17 @@ use generic_runtime_template::{
|
||||
apis::RuntimeApi,
|
||||
opaque::{Block, Hash},
|
||||
};
|
||||
use sc_client_api::Backend;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||
use sc_network::NetworkBlock;
|
||||
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||
use pezsc_client_api::Backend;
|
||||
use pezsc_consensus::ImportQueue;
|
||||
use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||
use pezsc_network::NetworkBlock;
|
||||
use pezsc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use sc_telemetry::TelemetryHandle;
|
||||
use sc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
|
||||
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
|
||||
use pezsc_telemetry::TelemetryHandle;
|
||||
use pezsc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
|
||||
use pezsc_transaction_pool_api::OffchainTransactionPoolFactory;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use sp_keystore::KeystorePtr;
|
||||
use pezsp_keystore::KeystorePtr;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use bizinikiwi_prometheus_endpoint::Registry;
|
||||
|
||||
@@ -57,8 +57,8 @@ pub type Service = PartialComponents<
|
||||
TeyrChainClient,
|
||||
TeyrChainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>,
|
||||
pezsc_consensus::DefaultImportQueue<Block>,
|
||||
pezsc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>,
|
||||
(TeyrChainBlockImport, Option<Telemetry>, Option<TelemetryWorkerHandle>),
|
||||
>;
|
||||
|
||||
@@ -66,12 +66,12 @@ pub type Service = PartialComponents<
|
||||
///
|
||||
/// Use this macro if you don't actually need the full service, but just the builder in order to
|
||||
/// be able to perform chain operations.
|
||||
pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error> {
|
||||
pub fn new_partial(config: &Configuration) -> Result<Service, pezsc_service::Error> {
|
||||
let telemetry = config
|
||||
.telemetry_endpoints
|
||||
.clone()
|
||||
.filter(|x| !x.is_empty())
|
||||
.map(|endpoints| -> Result<_, sc_telemetry::Error> {
|
||||
.map(|endpoints| -> Result<_, pezsc_telemetry::Error> {
|
||||
let worker = TelemetryWorker::new(16)?;
|
||||
let telemetry = worker.handle().new_telemetry(endpoints);
|
||||
Ok((worker, telemetry))
|
||||
@@ -92,7 +92,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
.build();
|
||||
|
||||
let (client, backend, keystore_container, task_manager) =
|
||||
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
|
||||
pezsc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
|
||||
config,
|
||||
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
||||
executor,
|
||||
@@ -108,7 +108,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
});
|
||||
|
||||
let transaction_pool = Arc::from(
|
||||
sc_transaction_pool::Builder::new(
|
||||
pezsc_transaction_pool::Builder::new(
|
||||
task_manager.spawn_essential_handle(),
|
||||
client.clone(),
|
||||
config.role.is_authority().into(),
|
||||
@@ -151,14 +151,14 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error>
|
||||
/// 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("TeyrChain")]
|
||||
#[pezsc_tracing::logging::prefix_logs_with("TeyrChain")]
|
||||
async fn start_node_impl(
|
||||
teyrchain_config: Configuration,
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
hwbench: Option<pezsc_sysinfo::HwBench>,
|
||||
) -> pezsc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
let teyrchain_config = prepare_node_config(teyrchain_config);
|
||||
|
||||
let params = new_partial(&teyrchain_config)?;
|
||||
@@ -166,10 +166,10 @@ async fn start_node_impl(
|
||||
let (block_import, mut telemetry, telemetry_worker_handle) = params.other;
|
||||
#[cfg(feature = "tanssi")]
|
||||
let (_, mut telemetry, telemetry_worker_handle) = params.other;
|
||||
let net_config = sc_network::config::FullNetworkConfiguration::<
|
||||
let net_config = pezsc_network::config::FullNetworkConfiguration::<
|
||||
_,
|
||||
_,
|
||||
sc_network::NetworkWorker<Block, Hash>,
|
||||
pezsc_network::NetworkWorker<Block, Hash>,
|
||||
>::new(
|
||||
&teyrchain_config.network,
|
||||
teyrchain_config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
|
||||
@@ -188,7 +188,7 @@ async fn start_node_impl(
|
||||
hwbench.clone(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
.map_err(|e| pezsc_service::Error::Application(Box::new(e) as Box<_>))?;
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let (relay_chain_interface, collator_key) = relay_chain_interface;
|
||||
@@ -218,7 +218,7 @@ async fn start_node_impl(
|
||||
if teyrchain_config.offchain_worker.enabled {
|
||||
use futures::FutureExt;
|
||||
let offchain_workers =
|
||||
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
|
||||
pezsc_offchain::OffchainWorkers::new(pezsc_offchain::OffchainWorkerOptions {
|
||||
runtime_api_provider: client.clone(),
|
||||
is_validator: teyrchain_config.role.is_authority(),
|
||||
keystore: Some(params.keystore_container.keystore()),
|
||||
@@ -250,7 +250,7 @@ async fn start_node_impl(
|
||||
})
|
||||
};
|
||||
|
||||
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||
pezsc_service::spawn_tasks(pezsc_service::SpawnTasksParams {
|
||||
rpc_builder,
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
@@ -269,7 +269,7 @@ async fn start_node_impl(
|
||||
})?;
|
||||
|
||||
if let Some(hwbench) = hwbench {
|
||||
sc_sysinfo::print_hwbench(&hwbench);
|
||||
pezsc_sysinfo::print_hwbench(&hwbench);
|
||||
// Here you can check whether the hardware meets your chains' requirements. Putting a link
|
||||
// in there and swapping out the requirements for your own are probably a good idea. The
|
||||
// requirements for a para-chain are dictated by its relay-chain.
|
||||
@@ -289,7 +289,7 @@ async fn start_node_impl(
|
||||
task_manager.spawn_handle().spawn(
|
||||
"telemetry_hwbench",
|
||||
None,
|
||||
sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),
|
||||
pezsc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ async fn start_node_impl(
|
||||
|
||||
let overseer_handle = relay_chain_interface
|
||||
.overseer_handle()
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e)))?;
|
||||
.map_err(|e| pezsc_service::Error::Application(Box::new(e)))?;
|
||||
|
||||
start_relay_chain_tasks(StartRelayChainTasksParams {
|
||||
client: client.clone(),
|
||||
@@ -352,7 +352,7 @@ pub fn import_queue(
|
||||
client: Arc<TeyrChainClient>,
|
||||
backend: Arc<TeyrChainBackend>,
|
||||
task_manager: &TaskManager,
|
||||
) -> (TeyrChainBlockImport, sc_consensus::BasicQueue<Block>) {
|
||||
) -> (TeyrChainBlockImport, pezsc_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
|
||||
@@ -362,7 +362,7 @@ pub fn import_queue(
|
||||
client,
|
||||
block_import.clone(),
|
||||
move |_, _| async move {
|
||||
let time = sp_timestamp::InherentDataProvider::from_system_time();
|
||||
let time = pezsp_timestamp::InherentDataProvider::from_system_time();
|
||||
|
||||
Ok((time,))
|
||||
},
|
||||
@@ -383,9 +383,9 @@ fn build_import_queue(
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error> {
|
||||
Ok(cumulus_client_consensus_aura::equivocation_import_queue::fully_verifying_import_queue::<
|
||||
sp_consensus_aura::sr25519::AuthorityPair,
|
||||
) -> Result<pezsc_consensus::DefaultImportQueue<Block>, pezsc_service::Error> {
|
||||
Ok(pezcumulus_client_consensus_aura::equivocation_import_queue::fully_verifying_import_queue::<
|
||||
pezsp_consensus_aura::sr25519::AuthorityPair,
|
||||
_,
|
||||
_,
|
||||
_,
|
||||
@@ -394,7 +394,7 @@ fn build_import_queue(
|
||||
client,
|
||||
block_import,
|
||||
move |_, _| async move {
|
||||
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
||||
let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time();
|
||||
Ok(timestamp)
|
||||
},
|
||||
&task_manager.spawn_essential_handle(),
|
||||
@@ -412,20 +412,20 @@ fn start_consensus(
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
relay_chain_interface: Arc<dyn RelayChainInterface>,
|
||||
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>>,
|
||||
transaction_pool: Arc<pezsc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>>,
|
||||
keystore: KeystorePtr,
|
||||
relay_chain_slot_duration: Duration,
|
||||
para_id: ParaId,
|
||||
collator_key: CollatorPair,
|
||||
overseer_handle: OverseerHandle,
|
||||
announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>,
|
||||
) -> Result<(), sc_service::Error> {
|
||||
) -> Result<(), pezsc_service::Error> {
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
use cumulus_client_consensus_aura::collators::basic::{self as basic_aura, Params};
|
||||
use pezcumulus_client_consensus_aura::collators::basic::{self as basic_aura, Params};
|
||||
#[cfg(feature = "async-backing")]
|
||||
use cumulus_client_consensus_aura::collators::lookahead::{self as aura, Params};
|
||||
use pezcumulus_client_consensus_aura::collators::lookahead::{self as aura, Params};
|
||||
|
||||
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||
let proposer_factory = pezsc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||
task_manager.spawn_handle(),
|
||||
client.clone(),
|
||||
transaction_pool,
|
||||
@@ -477,11 +477,11 @@ fn start_consensus(
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
let fut = basic_aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _>(
|
||||
let fut = basic_aura::run::<Block, pezsp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _>(
|
||||
params,
|
||||
);
|
||||
#[cfg(feature = "async-backing")]
|
||||
let fut = aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _>(
|
||||
let fut = aura::run::<Block, pezsp_consensus_aura::sr25519::AuthorityPair, _, _, _, _, _, _, _, _>(
|
||||
params,
|
||||
);
|
||||
task_manager.spawn_essential_handle().spawn("aura", None, fut);
|
||||
@@ -495,7 +495,7 @@ pub async fn start_teyrchain_node(
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
hwbench: Option<pezsc_sysinfo::HwBench>,
|
||||
) -> pezsc_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