Skip to main content

RethApiServer

Trait RethApiServer 

Source
pub trait RethApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn reth_get_balance_changes_in_block(
        &self,
        block_id: BlockId,
    ) -> impl Future<Output = Result<HashMap<Address, Uint<256, 4>, FbBuildHasher<20>>, ErrorObject<'static>>> + Send;
    fn reth_get_block_execution_outcome(
        &self,
        block_id: BlockId,
        count: Option<Uint<64, 1>>,
    ) -> impl Future<Output = Result<Option<Box<RawValue>>, ErrorObject<'static>>> + Send;
    fn reth_jit(
        &self,
        action: RethJitAction,
    ) -> impl Future<Output = Result<(), ErrorObject<'static>>> + Send;
    fn reth_subscribe_chain_notifications(
        &self,
        subscription_sink: PendingSubscriptionSink,
    ) -> impl Future<Output = Result<(), SubscriptionError>> + Send;
    fn reth_subscribe_persisted_block(
        &self,
        subscription_sink: PendingSubscriptionSink,
    ) -> impl Future<Output = Result<(), SubscriptionError>> + Send;
    fn reth_subscribe_finalized_chain_notifications(
        &self,
        subscription_sink: PendingSubscriptionSink,
    ) -> impl Future<Output = Result<(), SubscriptionError>> + Send;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

re-export of all server traits Server trait implementation for the RethApi RPC API.

Required Methods§

Source

fn reth_get_balance_changes_in_block( &self, block_id: BlockId, ) -> impl Future<Output = Result<HashMap<Address, Uint<256, 4>, FbBuildHasher<20>>, ErrorObject<'static>>> + Send

Returns all ETH balance changes in a block

Source

fn reth_get_block_execution_outcome( &self, block_id: BlockId, count: Option<Uint<64, 1>>, ) -> impl Future<Output = Result<Option<Box<RawValue>>, ErrorObject<'static>>> + Send

Re-executes a block (or a range of blocks) and returns the execution outcome including receipts, state changes, and EIP-7685 requests.

If count is provided, re-executes count consecutive blocks starting from block_id and returns the merged execution outcome.

The receipt type depends on the node’s network, which this trait cannot name, so the outcome is returned serialized.

Source

fn reth_jit( &self, action: RethJitAction, ) -> impl Future<Output = Result<(), ErrorObject<'static>>> + Send

Controls the JIT backend, if one is configured.

Source

fn reth_subscribe_chain_notifications( &self, subscription_sink: PendingSubscriptionSink, ) -> impl Future<Output = Result<(), SubscriptionError>> + Send

Subscribe to json ChainNotifications

Source

fn reth_subscribe_persisted_block( &self, subscription_sink: PendingSubscriptionSink, ) -> impl Future<Output = Result<(), SubscriptionError>> + Send

Subscribe to persisted block notifications.

Emits a notification with the block number and hash when a new block is persisted to disk.

Source

fn reth_subscribe_finalized_chain_notifications( &self, subscription_sink: PendingSubscriptionSink, ) -> impl Future<Output = Result<(), SubscriptionError>> + Send

Subscribe to finalized chain notifications.

Buffers committed chain notifications and emits them once a new finalized block is received. Each notification contains all committed chain segments up to the finalized block.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Provider, EvmConfig> RethApiServer for RethApi<Provider, EvmConfig>

Source§

async fn reth_get_balance_changes_in_block( &self, block_id: BlockId, ) -> Result<HashMap<Address, Uint<256, 4>, FbBuildHasher<20>>, ErrorObject<'static>>

Handler for reth_getBalanceChangesInBlock

Source§

async fn reth_get_block_execution_outcome( &self, block_id: BlockId, count: Option<Uint<64, 1>>, ) -> Result<Option<Box<RawValue>>, ErrorObject<'static>>

Handler for reth_getBlockExecutionOutcome

Source§

async fn reth_jit( &self, action: RethJitAction, ) -> Result<(), ErrorObject<'static>>

Handler for reth_jit

Source§

async fn reth_subscribe_chain_notifications( &self, pending: PendingSubscriptionSink, ) -> Result<(), SubscriptionError>

Handler for reth_subscribeChainNotifications

Source§

async fn reth_subscribe_persisted_block( &self, pending: PendingSubscriptionSink, ) -> Result<(), SubscriptionError>

Handler for reth_subscribePersistedBlock

Source§

async fn reth_subscribe_finalized_chain_notifications( &self, pending: PendingSubscriptionSink, ) -> Result<(), SubscriptionError>

Handler for reth_subscribeFinalizedChainNotifications

Implementors§