pub trait AdminApi<N, T>: Send + Sync {
// Required methods
fn add_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<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 = TransportResult<NodeInfo>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_peer_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<Subscription<PeerEvent>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
admin-api
only.Expand description
Admin namespace rpc interface that gives access to several non-standard RPC methods.
Required Methods§
Sourcefn add_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Requests adding the given peer, returning a boolean representing whether or not the peer was accepted for tracking.
Sourcefn add_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Requests adding the given peer as a trusted peer, which the node will always connect to even when its peer slots are full.
Sourcefn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Requests to remove the given peer, returning true if the enode was successfully parsed and the peer was removed.
Sourcefn remove_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_trusted_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 str,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Requests to remove the given peer, returning a boolean representing whether or not the
enode url passed was validated. A return value of true
does not necessarily mean that the
peer was disconnected.
Sourcefn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<PeerInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<Vec<PeerInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the list of peers currently connected to the node.
Sourcefn node_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<NodeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn node_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<NodeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns general information about the node as well as information about the running p2p
protocols (e.g. eth
, snap
).
Sourcefn subscribe_peer_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<Subscription<PeerEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Available on crate feature pubsub
only.
fn subscribe_peer_events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<Subscription<PeerEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
pubsub
only.Subscribe to events received by peers over the network.