reth_rpc_api/
miner.rs

1use alloy_primitives::{Bytes, U128};
2use jsonrpsee::{core::RpcResult, proc_macros::rpc};
3
4/// Miner namespace rpc interface that can control miner/builder settings
5#[cfg_attr(not(feature = "client"), rpc(server, namespace = "miner"))]
6#[cfg_attr(feature = "client", rpc(server, client, namespace = "miner"))]
7pub trait MinerApi {
8    /// Sets the extra data string that is included when this miner mines a block.
9    ///
10    /// Returns an error if the extra data is too long.
11    #[method(name = "setExtra")]
12    fn set_extra(&self, record: Bytes) -> RpcResult<bool>;
13
14    /// Sets the minimum accepted gas price for the miner.
15    #[method(name = "setGasPrice")]
16    fn set_gas_price(&self, gas_price: U128) -> RpcResult<bool>;
17
18    /// Sets the gaslimit to target towards during mining.
19    #[method(name = "setGasLimit")]
20    fn set_gas_limit(&self, gas_limit: U128) -> RpcResult<bool>;
21}