Trait reth_rpc_api::servers::AdminApiServer

source ·
pub trait AdminApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn add_peer(&self, record: NodeRecord) -> RpcResult<bool>;
    fn remove_peer(&self, record: AnyNode) -> RpcResult<bool>;
    fn add_trusted_peer(&self, record: AnyNode) -> RpcResult<bool>;
    fn remove_trusted_peer(&self, record: AnyNode) -> RpcResult<bool>;
    fn peers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<PeerInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn node_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<NodeInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_peer_events<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the AdminApi RPC API.

Required Methods§

source

fn add_peer(&self, record: NodeRecord) -> RpcResult<bool>

Adds the given node record to the peerset.

source

fn remove_peer(&self, record: AnyNode) -> RpcResult<bool>

Disconnects from a remote node if the connection exists.

Returns true if the peer was successfully removed.

source

fn add_trusted_peer(&self, record: AnyNode) -> RpcResult<bool>

Adds the given node record to the trusted peerset.

source

fn remove_trusted_peer(&self, record: AnyNode) -> RpcResult<bool>

Removes a remote node from the trusted peer set, but it does not disconnect it automatically.

Returns true if the peer was successfully removed.

source

fn peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<PeerInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The peers administrative property can be queried for all the information known about the connected remote nodes at the networking granularity. These include general information about the nodes themselves as participants of the devp2p P2P overlay protocol, as well as specialized information added by each of the running application protocols

source

fn node_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<NodeInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the ENR of the node.

source

fn subscribe_peer_events<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates an RPC subscription which serves events received from the network.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§