pub trait TxPoolApiServer: Sized + Send + Sync + 'static {
    // Required methods
    fn content(
        &self
    ) -> Result<TxPoolResult<HashMap<H160, HashMap<U256, Transaction>>>, ErrorObject<'static>>;
    fn inspect(
        &self
    ) -> Result<TxPoolResult<HashMap<H160, HashMap<U256, Summary>>>, ErrorObject<'static>>;
    fn status(&self) -> Result<TxPoolResult<U256>, ErrorObject<'static>>;

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

Server trait implementation for the TxPoolApi RPC API.

Required Methods§

source

fn content( &self ) -> Result<TxPoolResult<HashMap<H160, HashMap<U256, Transaction>>>, ErrorObject<'static>>

The content inspection property can be queried to list the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.

The result is an object with two fields pending and queued. Each of these fields are associative arrays, in which each entry maps an origin-address to a batch of scheduled transactions. These batches themselves are maps associating nonces with actual transactions.

For details, see txpool_content (geth) or txpool_content (nethermind).

source

fn inspect( &self ) -> Result<TxPoolResult<HashMap<H160, HashMap<U256, Summary>>>, ErrorObject<'static>>

The inspect inspection property can be queried to list a textual summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. This is a method specifically tailored to developers to quickly see the transactions in the pool and find any potential issues.

The result is an object with two fields pending and queued. Each of these fields are associative arrays, in which each entry maps an origin-address to a batch of scheduled transactions. These batches themselves are maps associating nonces with transactions summary strings.

For details, see txpool_inspect (geth) or txpool_inspect (nethermind).

source

fn status(&self) -> Result<TxPoolResult<U256>, ErrorObject<'static>>

The status inspection property can be queried for the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.

The result is an object with two fields pending and queued, each of which is a counter representing the number of transactions in that particular state.

For details, see txpool_status (geth) or txpool_status (nethermind).

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B, C, A> TxPoolApiServer for TxPool<B, C, A>
where B: BlockT, C: ProvideRuntimeApi<B> + HeaderBackend<B> + 'static, C::Api: EthereumRuntimeRPCApi<B>, A: ChainApi<Block = B> + 'static,