[][src]Trait substrate_service::ServiceFactory

pub trait ServiceFactory: 'static + Sized {
    type Block: BlockT<Hash = H256>;
    type RuntimeApi: Send + Sync;
    type NetworkProtocol: NetworkSpecialization<Self::Block>;
    type RuntimeDispatch: NativeExecutionDispatch + Send + Sync + 'static;
    type FullTransactionPoolApi: ChainApi<Hash = <Self::Block as BlockT>::Hash, Block = Self::Block> + Send + 'static;
    type LightTransactionPoolApi: ChainApi<Hash = <Self::Block as BlockT>::Hash, Block = Self::Block> + 'static;
    type Genesis: RuntimeGenesis;
    type Configuration: Default;
    type FullService: ServiceTrait<FullComponents<Self>>;
    type LightService: ServiceTrait<LightComponents<Self>>;
    type FullImportQueue: ImportQueue<Self::Block> + 'static;
    type LightImportQueue: ImportQueue<Self::Block> + 'static;
    type SelectChain: SelectChain<Self::Block> + 'static;
    fn build_full_transaction_pool(
        config: TransactionPoolOptions,
        client: Arc<FullClient<Self>>
    ) -> Result<TransactionPool<Self::FullTransactionPoolApi>, Error>;
fn build_light_transaction_pool(
        config: TransactionPoolOptions,
        client: Arc<LightClient<Self>>
    ) -> Result<TransactionPool<Self::LightTransactionPoolApi>, Error>;
fn build_network_protocol(
        config: &FactoryFullConfiguration<Self>
    ) -> Result<Self::NetworkProtocol, Error>;
fn build_finality_proof_provider(
        client: Arc<FullClient<Self>>
    ) -> Result<Option<Arc<dyn FinalityProofProvider<Self::Block>>>, Error>;
fn build_select_chain(
        config: &mut FactoryFullConfiguration<Self>,
        client: Arc<FullClient<Self>>
    ) -> Result<Self::SelectChain, Error>;
fn new_full(
        config: FactoryFullConfiguration<Self>
    ) -> Result<Self::FullService, Error>;
fn new_light(
        config: FactoryFullConfiguration<Self>
    ) -> Result<Self::LightService, Error>; fn build_full_import_queue(
        config: &mut FactoryFullConfiguration<Self>,
        _client: Arc<FullClient<Self>>,
        _select_chain: Self::SelectChain,
        _transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>
    ) -> Result<Self::FullImportQueue, Error> { ... }
fn build_light_import_queue(
        config: &mut FactoryFullConfiguration<Self>,
        _client: Arc<LightClient<Self>>
    ) -> Result<(Self::LightImportQueue, BoxFinalityProofRequestBuilder<Self::Block>), Error> { ... } }

A collection of types and methods to build a service on top of the substrate service.

Associated Types

type Block: BlockT<Hash = H256>

Block type.

type RuntimeApi: Send + Sync

The type that implements the runtime API.

type NetworkProtocol: NetworkSpecialization<Self::Block>

Network protocol extensions.

type RuntimeDispatch: NativeExecutionDispatch + Send + Sync + 'static

Chain runtime.

type FullTransactionPoolApi: ChainApi<Hash = <Self::Block as BlockT>::Hash, Block = Self::Block> + Send + 'static

Extrinsic pool backend type for the full client.

type LightTransactionPoolApi: ChainApi<Hash = <Self::Block as BlockT>::Hash, Block = Self::Block> + 'static

Extrinsic pool backend type for the light client.

type Genesis: RuntimeGenesis

Genesis configuration for the runtime.

type Configuration: Default

Other configuration for service members.

type FullService: ServiceTrait<FullComponents<Self>>

Extended full service type.

type LightService: ServiceTrait<LightComponents<Self>>

Extended light service type.

type FullImportQueue: ImportQueue<Self::Block> + 'static

ImportQueue for full client

type LightImportQueue: ImportQueue<Self::Block> + 'static

ImportQueue for light clients

type SelectChain: SelectChain<Self::Block> + 'static

The Fork Choice Strategy for the chain

Loading content...

Required methods

fn build_full_transaction_pool(
    config: TransactionPoolOptions,
    client: Arc<FullClient<Self>>
) -> Result<TransactionPool<Self::FullTransactionPoolApi>, Error>

Extrinsic pool constructor for the full client.

fn build_light_transaction_pool(
    config: TransactionPoolOptions,
    client: Arc<LightClient<Self>>
) -> Result<TransactionPool<Self::LightTransactionPoolApi>, Error>

Extrinsic pool constructor for the light client.

fn build_network_protocol(
    config: &FactoryFullConfiguration<Self>
) -> Result<Self::NetworkProtocol, Error>

Build network protocol.

fn build_finality_proof_provider(
    client: Arc<FullClient<Self>>
) -> Result<Option<Arc<dyn FinalityProofProvider<Self::Block>>>, Error>

Build finality proof provider for serving network requests on full node.

fn build_select_chain(
    config: &mut FactoryFullConfiguration<Self>,
    client: Arc<FullClient<Self>>
) -> Result<Self::SelectChain, Error>

Build the Fork Choice algorithm for full client

fn new_full(
    config: FactoryFullConfiguration<Self>
) -> Result<Self::FullService, Error>

Build full service.

fn new_light(
    config: FactoryFullConfiguration<Self>
) -> Result<Self::LightService, Error>

Build light service.

Loading content...

Provided methods

fn build_full_import_queue(
    config: &mut FactoryFullConfiguration<Self>,
    _client: Arc<FullClient<Self>>,
    _select_chain: Self::SelectChain,
    _transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>
) -> Result<Self::FullImportQueue, Error>

ImportQueue for a full client

fn build_light_import_queue(
    config: &mut FactoryFullConfiguration<Self>,
    _client: Arc<LightClient<Self>>
) -> Result<(Self::LightImportQueue, BoxFinalityProofRequestBuilder<Self::Block>), Error>

ImportQueue for a light client

Loading content...

Implementors

Loading content...