reth_rpc_api/
net.rs
1use alloy_primitives::U64;
2use jsonrpsee::{core::RpcResult, proc_macros::rpc};
3
4#[cfg_attr(not(feature = "client"), rpc(server, namespace = "net"))]
6#[cfg_attr(feature = "client", rpc(server, client, namespace = "net"))]
7pub trait NetApi {
8 #[method(name = "version")]
10 fn version(&self) -> RpcResult<String>;
11
12 #[method(name = "peerCount")]
14 fn peer_count(&self) -> RpcResult<U64>;
15
16 #[method(name = "listening")]
19 fn is_listening(&self) -> RpcResult<bool>;
20}