mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat(rpc): add rpc_ namespace (#2928)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -16,6 +16,7 @@ mod eth;
|
||||
mod eth_filter;
|
||||
mod eth_pubsub;
|
||||
mod net;
|
||||
mod rpc;
|
||||
mod trace;
|
||||
mod txpool;
|
||||
mod web3;
|
||||
@ -33,6 +34,7 @@ pub mod servers {
|
||||
eth_filter::EthFilterApiServer,
|
||||
eth_pubsub::EthPubSubApiServer,
|
||||
net::NetApiServer,
|
||||
rpc::RpcApiServer,
|
||||
trace::TraceApiServer,
|
||||
txpool::TxPoolApiServer,
|
||||
web3::Web3ApiServer,
|
||||
@ -52,6 +54,7 @@ pub mod clients {
|
||||
engine::{EngineApiClient, EngineEthApiClient},
|
||||
eth::EthApiClient,
|
||||
net::NetApiClient,
|
||||
rpc::RpcApiServer,
|
||||
trace::TraceApiClient,
|
||||
txpool::TxPoolApiClient,
|
||||
web3::Web3ApiClient,
|
||||
|
||||
11
crates/rpc/rpc-api/src/rpc.rs
Normal file
11
crates/rpc/rpc-api/src/rpc.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
|
||||
use reth_rpc_types::RpcModules;
|
||||
|
||||
/// RPC namespace, used to find the versions of all rpc modules
|
||||
#[cfg_attr(not(feature = "client"), rpc(server))]
|
||||
#[cfg_attr(feature = "client", rpc(server, client))]
|
||||
pub trait RpcApi {
|
||||
/// Lists enabled APIs and the version of each.
|
||||
#[method(name = "rpc_modules")]
|
||||
fn rpc_modules(&self) -> RpcResult<RpcModules>;
|
||||
}
|
||||
Reference in New Issue
Block a user