mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add miner rpc bindings (#13099)
This commit is contained in:
@ -21,6 +21,7 @@ mod engine;
|
||||
mod ganache;
|
||||
mod hardhat;
|
||||
mod mev;
|
||||
mod miner;
|
||||
mod net;
|
||||
mod otterscan;
|
||||
mod reth;
|
||||
@ -40,6 +41,7 @@ pub mod servers {
|
||||
debug::{DebugApiServer, DebugExecutionWitnessApiServer},
|
||||
engine::{EngineApiServer, EngineEthApiServer},
|
||||
mev::{MevFullApiServer, MevSimApiServer},
|
||||
miner::MinerApiServer,
|
||||
net::NetApiServer,
|
||||
otterscan::OtterscanServer,
|
||||
reth::RethApiServer,
|
||||
@ -70,6 +72,7 @@ pub mod clients {
|
||||
ganache::GanacheApiClient,
|
||||
hardhat::HardhatApiClient,
|
||||
mev::{MevFullApiClient, MevSimApiClient},
|
||||
miner::MinerApiClient,
|
||||
net::NetApiClient,
|
||||
otterscan::OtterscanClient,
|
||||
reth::RethApiClient,
|
||||
|
||||
21
crates/rpc/rpc-api/src/miner.rs
Normal file
21
crates/rpc/rpc-api/src/miner.rs
Normal file
@ -0,0 +1,21 @@
|
||||
use alloy_primitives::{Bytes, U128};
|
||||
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
|
||||
|
||||
/// Miner namespace rpc interface that can control miner/builder settings
|
||||
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "miner"))]
|
||||
#[cfg_attr(feature = "client", rpc(server, client, namespace = "miner"))]
|
||||
pub trait MinerApi {
|
||||
/// Sets the extra data string that is included when this miner mines a block.
|
||||
///
|
||||
/// Returns an error if the extra data is too long.
|
||||
#[method(name = "setExtra")]
|
||||
fn set_extra(&self, record: Bytes) -> RpcResult<bool>;
|
||||
|
||||
/// Sets the minimum accepted gas price for the miner.
|
||||
#[method(name = "setGasPrice")]
|
||||
fn set_gas_price(&self, gas_price: U128) -> RpcResult<bool>;
|
||||
|
||||
/// Sets the gaslimit to target towards during mining.
|
||||
#[method(name = "setGasLimit")]
|
||||
fn set_gas_limit(&self, gas_price: U128) -> RpcResult<bool>;
|
||||
}
|
||||
Reference in New Issue
Block a user