Skip to main content

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#[rpc(server, namespace = "miner")]
6pub trait MinerApi {
7    /// Sets the extra data string that is included when this miner mines a block.
8    ///
9    /// Returns an error if the extra data is too long.
10    #[method(name = "setExtra")]
11    fn set_extra(&self, record: Bytes) -> RpcResult<bool>;
12
13    /// Sets the minimum accepted gas price for the miner.
14    #[method(name = "setGasPrice")]
15    fn set_gas_price(&self, gas_price: U128) -> RpcResult<bool>;
16
17    /// Sets the gaslimit to target towards during mining.
18    #[method(name = "setGasLimit")]
19    fn set_gas_limit(&self, gas_limit: U128) -> RpcResult<bool>;
20}