[][src]Struct sc_service::ServiceBuilder

pub struct ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> { /* fields omitted */ }

Aggregator for the components required to build a service.

Usage

Call ServiceBuilder::new_full or ServiceBuilder::new_light, then call the various with_ methods to add the required components that you built yourself:

After this is done, call build to construct the service.

The order in which the with_* methods are called doesn't matter, as the correct binding of generics is done when you call build.

Methods

impl<TGen, TCSExt> ServiceBuilder<(), (), TGen, TCSExt, (), (), (), (), (), (), (), (), ()> where
    TGen: RuntimeGenesis,
    TCSExt: Extension
[src]

pub fn new_full<TBl: BlockT, TRtApi, TExecDisp: NativeExecutionDispatch + 'static>(
    config: Configuration<TGen, TCSExt>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TFullClient<TBl, TRtApi, TExecDisp>, Arc<OnDemand<TBl>>, (), (), BoxFinalityProofRequestBuilder<TBl>, Arc<dyn FinalityProofProvider<TBl>>, (), (), TFullBackend<TBl>>, Error>
[src]

Start the service builder with a configuration.

pub fn new_light<TBl: BlockT, TRtApi, TExecDisp: NativeExecutionDispatch + 'static>(
    config: Configuration<TGen, TCSExt>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TLightClient<TBl, TRtApi, TExecDisp>, Arc<OnDemand<TBl>>, (), (), BoxFinalityProofRequestBuilder<TBl>, Arc<dyn FinalityProofProvider<TBl>>, (), (), TLightBackend<TBl>>, Error>
[src]

Start the service builder with a configuration.

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>[src]

pub fn client(&self) -> &Arc<TCl>[src]

Returns a reference to the client that was stored in this builder.

pub fn backend(&self) -> &Arc<Backend>[src]

Returns a reference to the backend that was used in this builder.

pub fn select_chain(&self) -> Option<&TSc>[src]

Returns a reference to the select-chain that was stored in this builder.

pub fn keystore(&self) -> Arc<RwLock<Keystore>>[src]

Returns a reference to the keystore

pub fn pool(&self) -> Arc<TExPool>[src]

Returns a reference to the transaction pool stored in this builder

pub fn fetcher(&self) -> Option<TFchr> where
    TFchr: Clone
[src]

Returns a reference to the fetcher, only available if builder was created with new_light.

pub fn remote_backend(&self) -> Option<Arc<dyn RemoteBlockchain<TBl>>>[src]

Returns a reference to the remote_backend, only available if builder was created with new_light.

pub fn with_opt_select_chain<USc>(
    self,
    select_chain_builder: impl FnOnce(&Configuration<TGen, TCSExt>, &Arc<Backend>) -> Result<Option<USc>, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, USc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>, Error>
[src]

Defines which head-of-chain strategy to use.

pub fn with_select_chain<USc>(
    self,
    builder: impl FnOnce(&Configuration<TGen, TCSExt>, &Arc<Backend>) -> Result<USc, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, USc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>, Error>
[src]

Defines which head-of-chain strategy to use.

pub fn with_import_queue<UImpQu>(
    self,
    builder: impl FnOnce(&Configuration<TGen, TCSExt>, Arc<TCl>, Option<TSc>, Arc<TExPool>) -> Result<UImpQu, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, TFprb, TFpp, TExPool, TRpc, Backend>, Error> where
    TSc: Clone
[src]

Defines which import queue to use.

pub fn with_opt_finality_proof_provider(
    self,
    builder: impl FnOnce(Arc<TCl>, Arc<Backend>) -> Result<Option<Arc<dyn FinalityProofProvider<TBl>>>, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, Arc<dyn FinalityProofProvider<TBl>>, TExPool, TRpc, Backend>, Error>
[src]

Defines which strategy to use for providing finality proofs.

pub fn with_finality_proof_provider(
    self,
    build: impl FnOnce(Arc<TCl>, Arc<Backend>) -> Result<Arc<dyn FinalityProofProvider<TBl>>, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, Arc<dyn FinalityProofProvider<TBl>>, TExPool, TRpc, Backend>, Error>
[src]

Defines which strategy to use for providing finality proofs.

pub fn with_import_queue_and_opt_fprb<UImpQu, UFprb>(
    self,
    builder: impl FnOnce(&Configuration<TGen, TCSExt>, Arc<TCl>, Arc<Backend>, Option<TFchr>, Option<TSc>, Arc<TExPool>) -> Result<(UImpQu, Option<UFprb>), Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, UFprb, TFpp, TExPool, TRpc, Backend>, Error> where
    TSc: Clone,
    TFchr: Clone
[src]

Defines which import queue to use.

pub fn with_import_queue_and_fprb<UImpQu, UFprb>(
    self,
    builder: impl FnOnce(&Configuration<TGen, TCSExt>, Arc<TCl>, Arc<Backend>, Option<TFchr>, Option<TSc>, Arc<TExPool>) -> Result<(UImpQu, UFprb), Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, UFprb, TFpp, TExPool, TRpc, Backend>, Error> where
    TSc: Clone,
    TFchr: Clone
[src]

Defines which import queue to use.

pub fn with_transaction_pool<UExPool>(
    self,
    transaction_pool_builder: impl FnOnce(Options, Arc<TCl>, Option<TFchr>) -> Result<(UExPool, Option<Pin<Box<dyn Future<Output = ()> + Send>>>), Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, UExPool, TRpc, Backend>, Error> where
    TSc: Clone,
    TFchr: Clone
[src]

Defines which transaction pool to use.

pub fn with_rpc_extensions<URpc>(
    self,
    rpc_ext_builder: impl FnOnce(&Self) -> Result<URpc, Error>
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, URpc, Backend>, Error> where
    TSc: Clone,
    TFchr: Clone
[src]

Defines the RPC extensions to use.

pub fn with_prometheus_registry(self, registry: Registry) -> Self[src]

Use an existing prometheus Registry to record metrics into.

impl<TBl, TRtApi, TGen, TCSExt, TBackend, TExec, TSc, TImpQu, TExPool, TRpc> ServiceBuilder<TBl, TRtApi, TGen, TCSExt, Client<TBackend, TExec, TBl, TRtApi>, Arc<OnDemand<TBl>>, TSc, TImpQu, BoxFinalityProofRequestBuilder<TBl>, Arc<dyn FinalityProofProvider<TBl>>, TExPool, TRpc, TBackend> where
    Client<TBackend, TExec, TBl, TRtApi>: ProvideRuntimeApi<TBl>,
    <Client<TBackend, TExec, TBl, TRtApi> as ProvideRuntimeApi<TBl>>::Api: Metadata<TBl> + OffchainWorkerApi<TBl> + TaggedTransactionQueue<TBl> + SessionKeys<TBl> + ApiErrorExt<Error = Error> + ApiExt<TBl, StateBackend = TBackend::State>,
    TBl: BlockT,
    TRtApi: 'static + Send + Sync,
    TGen: RuntimeGenesis,
    TCSExt: Extension,
    TBackend: 'static + Backend<TBl> + Send,
    TExec: 'static + CallExecutor<TBl> + Send + Sync + Clone,
    TSc: Clone,
    TImpQu: 'static + ImportQueue<TBl>,
    TExPool: MaintainedTransactionPool<Block = TBl, Hash = <TBl as BlockT>::Hash> + MallocSizeOfWasm + 'static,
    TRpc: RpcExtension<Metadata> + Clone
[src]

pub fn with_execution_extensions_factory(
    self,
    execution_extensions_factory: Box<dyn ExtensionsFactory>
) -> Result<Self, Error>
[src]

Set an ExecutionExtensionsFactory

pub fn build(
    self
) -> Result<Service<TBl, Client<TBackend, TExec, TBl, TRtApi>, TSc, NetworkStatus<TBl>, NetworkService<TBl, <TBl as BlockT>::Hash>, TExPool, OffchainWorkers<Client<TBackend, TExec, TBl, TRtApi>, TBackend::OffchainStorage, TBl>>, Error>
[src]

Builds the service.

Trait Implementations

impl<TBl, TRtApi, TGen, TCSExt, TBackend, TExecDisp, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> ServiceBuilderCommand for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, Client<TBackend, LocalCallExecutor<TBackend, NativeExecutor<TExecDisp>>, TBl, TRtApi>, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> where
    TBl: BlockT,
    TBackend: 'static + Backend<TBl> + Send,
    TExecDisp: 'static + NativeExecutionDispatch,
    TImpQu: 'static + ImportQueue<TBl>,
    TRtApi: 'static + Send + Sync
[src]

type Block = TBl

Block type this API operates on.

type NativeDispatch = TExecDisp

Native execution dispatch required by some commands.

Auto Trait Implementations

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> !RefUnwindSafe for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> Send for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> where
    Backend: Send + Sync,
    TBl: Send,
    TCSExt: Send,
    TCl: Send + Sync,
    TExPool: Send + Sync,
    TFchr: Send,
    TFpp: Send,
    TFprb: Send,
    TImpQu: Send,
    TRpc: Send,
    TRtApi: Send,
    TSc: Send

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> !Sync for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> Unpin for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> where
    TBl: Unpin,
    TCSExt: Unpin,
    TFchr: Unpin,
    TFpp: Unpin,
    TFprb: Unpin,
    TImpQu: Unpin,
    TRpc: Unpin,
    TRtApi: Unpin,
    TSc: Unpin

impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend> !UnwindSafe for ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,