mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add debug functions
This commit is contained in:
27
crates/net/rpc-api/src/debug.rs
Normal file
27
crates/net/rpc-api/src/debug.rs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc};
|
||||||
|
use reth_primitives::{BlockId, Bytes, H256};
|
||||||
|
use reth_rpc_types::RichBlock;
|
||||||
|
|
||||||
|
/// Debug rpc interface.
|
||||||
|
#[rpc(server)]
|
||||||
|
pub trait DebugApi {
|
||||||
|
/// Returns an RLP-encoded header.
|
||||||
|
#[method(name = "debug_getRawHeader")]
|
||||||
|
async fn raw_header(&self, block_id: BlockId) -> Result<Bytes>;
|
||||||
|
|
||||||
|
/// Returns an RLP-encoded block.
|
||||||
|
#[method(name = "debug_getRawBlock")]
|
||||||
|
async fn raw_block(&self, block_id: BlockId) -> Result<Bytes>;
|
||||||
|
|
||||||
|
/// Returns a EIP-2718 binary-encoded transaction.
|
||||||
|
#[method(name = "debug_getRawTransaction")]
|
||||||
|
async fn raw_transaction(&self, hash: H256) -> Result<Bytes>;
|
||||||
|
|
||||||
|
/// Returns an array of EIP-2718 binary-encoded receipts.
|
||||||
|
#[method(name = "debug_getRawReceipts")]
|
||||||
|
async fn raw_receipts(&self, block_id: BlockId) -> Result<Vec<Bytes>>;
|
||||||
|
|
||||||
|
/// Returns an array of recent bad blocks that the client has seen on the network.
|
||||||
|
#[method(name = "debug_getRawReceipts")]
|
||||||
|
async fn bad_blocks(&self) -> Result<Vec<RichBlock>>;
|
||||||
|
}
|
||||||
@ -9,6 +9,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Provides all RPC interfaces.
|
//! Provides all RPC interfaces.
|
||||||
|
|
||||||
|
mod debug;
|
||||||
mod eth;
|
mod eth;
|
||||||
mod eth_filter;
|
mod eth_filter;
|
||||||
mod eth_pubsub;
|
mod eth_pubsub;
|
||||||
@ -17,6 +18,6 @@ mod trace;
|
|||||||
mod web3;
|
mod web3;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
eth::EthApiServer, eth_filter::EthFilterApiServer, eth_pubsub::EthPubSubApiServer,
|
debug::DebugApiServer, eth::EthApiServer, eth_filter::EthFilterApiServer,
|
||||||
net::NetApiServer, web3::Web3ApiServer,
|
eth_pubsub::EthPubSubApiServer, net::NetApiServer, web3::Web3ApiServer,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user