reth::rpc::api

Trait MinerApiServer

Source
pub trait MinerApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn set_extra(&self, record: Bytes) -> Result<bool, ErrorObject<'static>>;
    fn set_gas_price(
        &self,
        gas_price: Uint<128, 2>,
    ) -> Result<bool, ErrorObject<'static>>;
    fn set_gas_limit(
        &self,
        gas_price: Uint<128, 2>,
    ) -> Result<bool, ErrorObject<'static>>;

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

Server trait implementation for the MinerApi RPC API.

Required Methods§

Source

fn set_extra(&self, record: Bytes) -> Result<bool, ErrorObject<'static>>

Sets the extra data string that is included when this miner mines a block.

Returns an error if the extra data is too long.

Source

fn set_gas_price( &self, gas_price: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>

Sets the minimum accepted gas price for the miner.

Source

fn set_gas_limit( &self, gas_price: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>

Sets the gaslimit to target towards during mining.

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MinerApiServer for MinerApi

Source§

fn set_extra(&self, _record: Bytes) -> Result<bool, ErrorObject<'static>>

Source§

fn set_gas_price( &self, _gas_price: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>

Source§

fn set_gas_limit( &self, _gas_price: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>

Implementors§