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,
impl<Provider, Pool, Network, EvmConfig> EthApiInner<Provider, Pool, Network, EvmConfig>where
Provider: BlockReaderIdExt,
Sourcepub 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>
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,
impl<Provider, Pool, Network, EvmConfig> EthApiInner<Provider, Pool, Network, EvmConfig>where
Provider: BlockReader,
Sourcepub const fn cache(
&self,
) -> &EthStateCache<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>
pub const fn cache( &self, ) -> &EthStateCache<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>
Returns a handle to data in memory.
Sourcepub const fn pending_block(
&self,
) -> &Mutex<Option<PendingBlock<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>>>
pub const fn pending_block( &self, ) -> &Mutex<Option<PendingBlock<<Provider as BlockReader>::Block, <Provider as ReceiptProvider>::Receipt>>>
Returns a handle to the pending block.
Sourcepub const fn task_spawner(&self) -> &dyn TaskSpawner
pub const fn task_spawner(&self) -> &dyn TaskSpawner
Returns a handle to the task spawner.
Sourcepub const fn blocking_task_pool(&self) -> &BlockingTaskPool
pub const fn blocking_task_pool(&self) -> &BlockingTaskPool
Returns a handle to the blocking thread pool.
Sourcepub const fn evm_config(&self) -> &EvmConfig
pub const fn evm_config(&self) -> &EvmConfig
Returns a handle to the EVM config.
Sourcepub const fn max_simulate_blocks(&self) -> u64
pub const fn max_simulate_blocks(&self) -> u64
Returns the max_simulate_blocks
.
Sourcepub const fn gas_oracle(&self) -> &GasPriceOracle<Provider>
pub const fn gas_oracle(&self) -> &GasPriceOracle<Provider>
Returns a handle to the gas oracle.
Sourcepub const fn fee_history_cache(&self) -> &FeeHistoryCache
pub const fn fee_history_cache(&self) -> &FeeHistoryCache
Returns a handle to the fee history cache.
Sourcepub const fn signers(
&self,
) -> &RwLock<RawRwLock, Vec<Box<dyn EthSigner<<Provider as TransactionsProvider>::Transaction>>>>
pub const fn signers( &self, ) -> &RwLock<RawRwLock, Vec<Box<dyn EthSigner<<Provider as TransactionsProvider>::Transaction>>>>
Returns a handle to the signers.
Sourcepub const fn starting_block(&self) -> Uint<256, 4>
pub const fn starting_block(&self) -> Uint<256, 4>
Returns the starting block.
Sourcepub const fn eth_proof_window(&self) -> u64
pub const fn eth_proof_window(&self) -> u64
The maximum number of blocks into the past for generating state proofs.
Sourcepub const fn blocking_task_guard(&self) -> &BlockingTaskGuard
pub const fn blocking_task_guard(&self) -> &BlockingTaskGuard
Returns reference to [BlockingTaskGuard
].
Sourcepub fn subscribe_to_raw_transactions(&self) -> Receiver<Bytes>
pub fn subscribe_to_raw_transactions(&self) -> Receiver<Bytes>
Returns [broadcast::Receiver
] of new raw transactions
Sourcepub fn broadcast_raw_transaction(&self, raw_tx: Bytes)
pub fn broadcast_raw_transaction(&self, raw_tx: Bytes)
Broadcasts raw transaction if there are active subscribers.