// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
// This file is part of Pezkuwi.
// Pezkuwi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Pezkuwi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see .
//! Pezkuwi service. Specialized wrapper over bizinikiwi service.
#![deny(unused_results)]
pub mod benchmarking;
pub mod chain_spec;
mod fake_runtime_api;
mod grandpa_support;
mod relay_chain_selection;
mod teyrchains_db;
#[cfg(feature = "full-node")]
pub mod builder;
#[cfg(feature = "full-node")]
pub mod overseer;
#[cfg(feature = "full-node")]
pub mod workers;
#[cfg(feature = "full-node")]
pub use crate::builder::{new_full, NewFull, NewFullParams};
#[cfg(feature = "full-node")]
pub use self::overseer::{
CollatorOverseerGen, ExtendedOverseerGenArgs, OverseerGen, OverseerGenArgs,
ValidatorOverseerGen,
};
#[cfg(test)]
mod tests;
#[cfg(feature = "full-node")]
use crate::builder::{new_partial, new_partial_basics};
#[cfg(feature = "full-node")]
use {
pezkuwi_node_core_approval_voting as approval_voting_subsystem,
pezkuwi_node_core_av_store::Error as AvailabilityError,
pezkuwi_node_core_chain_selection as chain_selection_subsystem,
};
use pezkuwi_node_subsystem_util::database::Database;
use pezkuwi_overseer::SpawnGlue;
#[cfg(feature = "full-node")]
pub use {
pezkuwi_overseer::{Handle, Overseer, OverseerConnector, OverseerHandle},
pezkuwi_primitives::runtime_api::TeyrchainHost,
pezsc_client_api::AuxStore,
pezsp_authority_discovery::AuthorityDiscoveryApi,
pezsp_blockchain::{HeaderBackend, HeaderMetadata},
pezsp_consensus_babe::BabeApi,
relay_chain_selection::SelectRelayChain,
};
use std::{path::PathBuf, sync::Arc};
use pezsc_service::SpawnTaskHandle;
use prometheus_endpoint::Registry;
pub use chain_spec::{GenericChainSpec, PezkuwichainChainSpec, ZagrosChainSpec};
pub use pezkuwi_primitives::{Block, BlockId, BlockNumber, CollatorPair, Hash, Id as ParaId};
pub use pezsc_client_api::{Backend, CallExecutor};
pub use pezsc_consensus::{BlockImport, LongestChain};
pub use pezsc_executor::NativeExecutionDispatch;
use pezsc_executor::WasmExecutor;
pub use pezsc_service::{
config::{DatabaseSource, PrometheusConfig},
ChainSpec, Configuration, Error as BizinikiwiServiceError, PruningMode, Role, TFullBackend,
TFullCallExecutor, TFullClient, TaskManager, TransactionPoolOptions,
};
pub use pezsp_api::{ApiRef, ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi};
pub use pezsp_consensus::{Proposal, SelectChain};
pub use pezsp_runtime::{
generic,
traits::{self as runtime_traits, BlakeTwo256, Block as BlockT, Header as HeaderT, NumberFor},
};
#[cfg(feature = "pezkuwichain-native")]
pub use {pezkuwichain_runtime, pezkuwichain_runtime_constants};
#[cfg(feature = "zagros-native")]
pub use {zagros_runtime, zagros_runtime_constants};
pub use fake_runtime_api::{GetLastTimestamp, RuntimeApi};
#[cfg(feature = "full-node")]
pub type FullBackend = pezsc_service::TFullBackend;
#[cfg(feature = "full-node")]
pub type FullClient = pezsc_service::TFullClient<
Block,
RuntimeApi,
WasmExecutor<(
pezsp_io::BizinikiwiHostFunctions,
pezframe_benchmarking::benchmarking::HostFunctions,
)>,
>;
/// The minimum period of blocks on which justifications will be
/// imported and generated.
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
/// The number of hours to keep finalized data in the availability store for live networks.
const KEEP_FINALIZED_FOR_LIVE_NETWORKS: u32 = 25;
/// Provides the header and block number for a hash.
///
/// Decouples `pezsc_client_api::Backend` and `pezsp_blockchain::HeaderBackend`.
pub trait HeaderProvider: Send + Sync + 'static
where
Block: BlockT,
Error: std::fmt::Debug + Send + Sync + 'static,
{
/// Obtain the header for a hash.
fn header(
&self,
hash: ::Hash,
) -> Result