RpcNodeCore

Trait RpcNodeCore 

pub trait RpcNodeCore:
    Clone
    + Send
    + Sync
    + Unpin
    + 'static {
    type Primitives: NodePrimitives;
    type Provider: BlockReaderIdExt<Block = <Self::Primitives as NodePrimitives>::Block, Receipt = <Self::Primitives as NodePrimitives>::Receipt, Header = <Self::Primitives as NodePrimitives>::BlockHeader, Transaction = <Self::Primitives as NodePrimitives>::SignedTx> + ChainSpecProvider + StateProviderFactory + CanonStateSubscriptions<Primitives = Self::Primitives> + StageCheckpointReader + Send + Sync + Clone + Unpin + 'static
       where <Self::Provider as ChainSpecProvider>::ChainSpec: EthChainSpec<Header = <Self::Primitives as NodePrimitives>::BlockHeader> + Hardforks + EthereumHardforks;
    type Pool: TransactionPool
       where <Self::Pool as TransactionPool>::Transaction: PoolTransaction<Consensus = <Self::Primitives as NodePrimitives>::SignedTx>;
    type Evm: ConfigureEvm<Primitives = Self::Primitives> + Send + Sync + 'static;
    type Network: NetworkInfo + Clone;

    // Required methods
    fn pool(&self) -> &Self::Pool;
    fn evm_config(&self) -> &Self::Evm;
    fn network(&self) -> &Self::Network;
    fn provider(&self) -> &Self::Provider;
}
Expand description

Helper trait that provides the same interface as [FullNodeComponents] but without requiring implementation of trait bounds.

This trait is structurally equivalent to [FullNodeComponents], exposing the same associated types and methods. However, it doesn’t enforce the trait bounds required by [FullNodeComponents]. This makes it useful for RPC types that need access to node components where the full trait bounds of the components are not necessary.

Every type that is a [FullNodeComponents] also implements this trait.

Required Associated Types§

type Primitives: NodePrimitives

Blockchain data primitives.

type Provider: BlockReaderIdExt<Block = <Self::Primitives as NodePrimitives>::Block, Receipt = <Self::Primitives as NodePrimitives>::Receipt, Header = <Self::Primitives as NodePrimitives>::BlockHeader, Transaction = <Self::Primitives as NodePrimitives>::SignedTx> + ChainSpecProvider + StateProviderFactory + CanonStateSubscriptions<Primitives = Self::Primitives> + StageCheckpointReader + Send + Sync + Clone + Unpin + 'static where <Self::Provider as ChainSpecProvider>::ChainSpec: EthChainSpec<Header = <Self::Primitives as NodePrimitives>::BlockHeader> + Hardforks + EthereumHardforks

The provider type used to interact with the node.

type Pool: TransactionPool where <Self::Pool as TransactionPool>::Transaction: PoolTransaction<Consensus = <Self::Primitives as NodePrimitives>::SignedTx>

The transaction pool of the node.

type Evm: ConfigureEvm<Primitives = Self::Primitives> + Send + Sync + 'static

The node’s EVM configuration, defining settings for the Ethereum Virtual Machine.

type Network: NetworkInfo + Clone

Network API.

Required Methods§

fn pool(&self) -> &Self::Pool

Returns the transaction pool of the node.

fn evm_config(&self) -> &Self::Evm

Returns the node’s evm config.

fn network(&self) -> &Self::Network

Returns the handle to the network

fn provider(&self) -> &Self::Provider

Returns the provider of the node.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<N, Rpc> RpcNodeCore for EthApi<N, Rpc>
where N: RpcNodeCore, Rpc: RpcConvert,

§

impl<Provider, Pool, Network, Evm> RpcNodeCore for RpcNodeCoreAdapter<Provider, Pool, Network, Evm>
where Provider: ChainSpecProvider + BlockReaderIdExt<Block = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::Block, Receipt = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::Receipt, Header = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, Transaction = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx> + StateProviderFactory + CanonStateSubscriptions<Primitives = <Evm as ConfigureEvm>::Primitives> + StageCheckpointReader + Send + Sync + Unpin + Clone + 'static, <Provider as ChainSpecProvider>::ChainSpec: EthChainSpec<Header = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader> + Hardforks + EthereumHardforks, Evm: ConfigureEvm + Clone + 'static, Pool: TransactionPool + Unpin + 'static, <Pool as TransactionPool>::Transaction: PoolTransaction<Consensus = <<Evm as ConfigureEvm>::Primitives as NodePrimitives>::SignedTx>, Network: NetworkInfo + Clone + Unpin + 'static,

§

type Primitives = <Evm as ConfigureEvm>::Primitives

§

type Provider = Provider

§

type Pool = Pool

§

type Evm = Evm

§

type Network = Network

§

impl<T> RpcNodeCore for T
where T: FullNodeComponents, <T as FullNodeTypes>::Provider: ChainSpecProvider, <<T as FullNodeTypes>::Provider as ChainSpecProvider>::ChainSpec: Hardforks + EthereumHardforks,

§

type Primitives = <<T as FullNodeTypes>::Types as NodeTypes>::Primitives

§

type Provider = <T as FullNodeTypes>::Provider

§

type Pool = <T as FullNodeComponents>::Pool

§

type Evm = <T as FullNodeComponents>::Evm

§

type Network = <T as FullNodeComponents>::Network