[][src]Trait substrate_service::Components

pub trait Components: Sized + 'static {
    type Factory: ServiceFactory;
    type Backend: 'static + Backend<FactoryBlock<Self::Factory>, Blake2Hasher>;
    type Executor: 'static + CallExecutor<FactoryBlock<Self::Factory>, Blake2Hasher> + Send + Sync + Clone;
    type RuntimeApi: Send + Sync;
    type RuntimeServices: ServiceTrait<Self>;
    type TransactionPoolApi: 'static + ChainApi<Hash = <FactoryBlock<Self::Factory> as BlockT>::Hash, Block = FactoryBlock<Self::Factory>>;
    type ImportQueue: ImportQueue<FactoryBlock<Self::Factory>> + 'static;
    fn build_client(
        config: &FactoryFullConfiguration<Self::Factory>,
        executor: CodeExecutor<Self::Factory>
    ) -> Result<(Arc<ComponentClient<Self>>, Option<Arc<OnDemand<FactoryBlock<Self::Factory>>>>), Error>;
fn build_transaction_pool(
        config: TransactionPoolOptions,
        client: Arc<ComponentClient<Self>>
    ) -> Result<TransactionPool<Self::TransactionPoolApi>, Error>;
fn build_import_queue(
        config: &mut FactoryFullConfiguration<Self::Factory>,
        client: Arc<ComponentClient<Self>>
    ) -> Result<Self::ImportQueue, Error>; }

A collection of types and function to generalize over full / light client type.

Associated Types

type Factory: ServiceFactory

Associated service factory.

type Backend: 'static + Backend<FactoryBlock<Self::Factory>, Blake2Hasher>

Client backend.

type Executor: 'static + CallExecutor<FactoryBlock<Self::Factory>, Blake2Hasher> + Send + Sync + Clone

Client executor.

type RuntimeApi: Send + Sync

The type that implements the runtime API.

type RuntimeServices: ServiceTrait<Self>

A type that can start all runtime-dependent services.

type TransactionPoolApi: 'static + ChainApi<Hash = <FactoryBlock<Self::Factory> as BlockT>::Hash, Block = FactoryBlock<Self::Factory>>

Extrinsic pool type.

type ImportQueue: ImportQueue<FactoryBlock<Self::Factory>> + 'static

Our Import Queue

Loading content...

Required methods

fn build_client(
    config: &FactoryFullConfiguration<Self::Factory>,
    executor: CodeExecutor<Self::Factory>
) -> Result<(Arc<ComponentClient<Self>>, Option<Arc<OnDemand<FactoryBlock<Self::Factory>>>>), Error>

Create client.

fn build_transaction_pool(
    config: TransactionPoolOptions,
    client: Arc<ComponentClient<Self>>
) -> Result<TransactionPool<Self::TransactionPoolApi>, Error>

Create extrinsic pool.

fn build_import_queue(
    config: &mut FactoryFullConfiguration<Self::Factory>,
    client: Arc<ComponentClient<Self>>
) -> Result<Self::ImportQueue, Error>

instance of import queue for clients

Loading content...

Implementors

impl<Factory: ServiceFactory> Components for FullComponents<Factory>[src]

type Factory = Factory

type Executor = FullExecutor<Factory>

type Backend = FullBackend<Factory>

type TransactionPoolApi = <Factory as ServiceFactory>::FullTransactionPoolApi

type ImportQueue = Factory::FullImportQueue

type RuntimeApi = Factory::RuntimeApi

type RuntimeServices = Factory::FullService

impl<Factory: ServiceFactory> Components for LightComponents<Factory>[src]

type Factory = Factory

type Executor = LightExecutor<Factory>

type Backend = LightBackend<Factory>

type TransactionPoolApi = <Factory as ServiceFactory>::LightTransactionPoolApi

type ImportQueue = <Factory as ServiceFactory>::LightImportQueue

type RuntimeApi = Factory::RuntimeApi

type RuntimeServices = Factory::LightService

Loading content...