feat(rpc): add rpc_ namespace (#2928)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Sanket Shanbhag
2023-06-02 16:25:25 +05:30
committed by GitHub
parent 65b6276926
commit 5b72a73815
7 changed files with 103 additions and 1 deletions

View File

@ -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,

View 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>;
}