Type Alias EthApiNodeBackend

Source
pub type EthApiNodeBackend<N> = EthApiInner<<N as RpcNodeCore>::Provider, <N as RpcNodeCore>::Pool, <N as RpcNodeCore>::Network, <N as RpcNodeCore>::Evm>;
Expand description

Adapter for EthApiInner, which holds all the data required to serve core eth_ API.

Aliased Type§

struct EthApiNodeBackend<N> { /* private fields */ }

Layout§

Note: Encountered an error during type layout; the type failed to be normalized.

Implementations

Source§

impl<Provider, Pool, Network, EvmConfig> EthApiInner<Provider, Pool, Network, EvmConfig>
where Provider: BlockReaderIdExt,

Source

pub fn new( provider: Provider, pool: Pool, network: Network, eth_cache: EthStateCache<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>, gas_oracle: GasPriceOracle<Provider>, gas_cap: impl Into<GasCap>, max_simulate_blocks: u64, eth_proof_window: u64, blocking_task_pool: BlockingTaskPool, fee_history_cache: FeeHistoryCache, evm_config: EvmConfig, task_spawner: Box<dyn TaskSpawner>, proof_permits: usize, ) -> EthApiInner<Provider, Pool, Network, EvmConfig>

Creates a new, shareable instance using the default tokio task spawner.

Source§

impl<Provider, Pool, Network, EvmConfig> EthApiInner<Provider, Pool, Network, EvmConfig>
where Provider: BlockReader,

Source

pub const fn provider(&self) -> &Provider

Returns a handle to data on disk.

Source

pub const fn cache( &self, ) -> &EthStateCache<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>

Returns a handle to data in memory.

Source

pub const fn pending_block( &self, ) -> &Mutex<Option<PendingBlock<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>>>

Returns a handle to the pending block.

Source

pub const fn task_spawner(&self) -> &dyn TaskSpawner

Returns a handle to the task spawner.

Source

pub const fn blocking_task_pool(&self) -> &BlockingTaskPool

Returns a handle to the blocking thread pool.

Source

pub const fn evm_config(&self) -> &EvmConfig

Returns a handle to the EVM config.

Source

pub const fn pool(&self) -> &Pool

Returns a handle to the transaction pool.

Source

pub const fn gas_cap(&self) -> u64

Returns the gas cap.

Source

pub const fn max_simulate_blocks(&self) -> u64

Returns the max_simulate_blocks.

Source

pub const fn gas_oracle(&self) -> &GasPriceOracle<Provider>

Returns a handle to the gas oracle.

Source

pub const fn fee_history_cache(&self) -> &FeeHistoryCache

Returns a handle to the fee history cache.

Source

pub const fn signers( &self, ) -> &RwLock<RawRwLock, Vec<Box<dyn EthSigner<<Provider as TransactionsProvider>::Transaction>>>>

Returns a handle to the signers.

Source

pub const fn starting_block(&self) -> Uint<256, 4>

Returns the starting block.

Source

pub const fn network(&self) -> &Network

Returns the inner Network

Source

pub const fn eth_proof_window(&self) -> u64

The maximum number of blocks into the past for generating state proofs.

Source

pub const fn blocking_task_guard(&self) -> &BlockingTaskGuard

Returns reference to [BlockingTaskGuard].

Source

pub fn subscribe_to_raw_transactions(&self) -> Receiver<Bytes>

Returns [broadcast::Receiver] of new raw transactions

Source

pub fn broadcast_raw_transaction(&self, raw_tx: Bytes)

Broadcasts raw transaction if there are active subscribers.