ethportal_api

Trait StateNetworkApiServer

Source
pub trait StateNetworkApiServer:
    Sized
    + Send
    + Sync
    + 'static {
Show 20 methods // Required methods fn routing_table_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<RoutingTableInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn radius<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<DataRadius>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_enr<'life0, 'async_trait>( &'life0 self, enr: Enr, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_enr<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = RpcResult<Enr>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn delete_enr<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn lookup_enr<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = RpcResult<Enr>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn ping<'life0, 'async_trait>( &'life0 self, enr: Enr, ) -> Pin<Box<dyn Future<Output = RpcResult<PongInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_nodes<'life0, 'async_trait>( &'life0 self, enr: Enr, distances: Vec<u16>, ) -> Pin<Box<dyn Future<Output = RpcResult<FindNodesInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn recursive_find_nodes<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Enr>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_content<'life0, 'async_trait>( &'life0 self, enr: Enr, content_key: StateContentKey, ) -> Pin<Box<dyn Future<Output = RpcResult<FindContentInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_content<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, ) -> Pin<Box<dyn Future<Output = RpcResult<GetContentInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn trace_get_content<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, ) -> Pin<Box<dyn Future<Output = RpcResult<TraceContentInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn paginate_local_content_keys<'life0, 'async_trait>( &'life0 self, offset: u64, limit: u64, ) -> Pin<Box<dyn Future<Output = RpcResult<PaginateLocalContentInfo<StateContentKey>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn gossip<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn trace_gossip<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<TraceGossipInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn offer<'life0, 'async_trait>( &'life0 self, enr: Enr, content_items: Vec<(StateContentKey, RawContentValue)>, ) -> Pin<Box<dyn Future<Output = RpcResult<AcceptInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn trace_offer<'life0, 'async_trait>( &'life0 self, enr: Enr, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<OfferTrace>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn store<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn local_content<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, ) -> Pin<Box<dyn Future<Output = RpcResult<RawContentValue>> + 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 StateNetworkApi RPC API.

Required Methods§

Source

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

Returns meta information about overlay routing table.

Source

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

Returns the node data radios

Source

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

Write an Ethereum Node Record to the overlay routing table.

Source

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

Fetch the latest ENR associated with the given node ID.

Source

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

Delete Node ID from the overlay routing table.

Source

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

Fetch the ENR representation associated with the given Node ID.

Source

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

Send a PING message to the designated node and wait for a PONG response

Source

fn find_nodes<'life0, 'async_trait>( &'life0 self, enr: Enr, distances: Vec<u16>, ) -> Pin<Box<dyn Future<Output = RpcResult<FindNodesInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a FINDNODES request for nodes that fall within the given set of distances, to the designated peer and wait for a response

Source

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

Lookup a target node within in the network

Source

fn find_content<'life0, 'async_trait>( &'life0 self, enr: Enr, content_key: StateContentKey, ) -> Pin<Box<dyn Future<Output = RpcResult<FindContentInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send FINDCONTENT message to get the content with a content key.

Source

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

First checks local storage if content is not found lookup a target content key in the network

Source

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

First checks local storage if content is not found lookup a target content key in the network. Return tracing info.

Source

fn paginate_local_content_keys<'life0, 'async_trait>( &'life0 self, offset: u64, limit: u64, ) -> Pin<Box<dyn Future<Output = RpcResult<PaginateLocalContentInfo<StateContentKey>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pagination of local content keys

Source

fn gossip<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send the provided content value to interested peers. Clients may choose to send to some or all peers. Return the number of peers that the content was gossiped to.

Source

fn trace_gossip<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<TraceGossipInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send the provided content value to interested peers. Clients may choose to send to some or all peers. Return tracing info detailing the gossip propagation.

Source

fn offer<'life0, 'async_trait>( &'life0 self, enr: Enr, content_items: Vec<(StateContentKey, RawContentValue)>, ) -> Pin<Box<dyn Future<Output = RpcResult<AcceptInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an OFFER request with given ContentItems, to the designated peer and wait for a response. Does not store the content locally. Returns the content keys bitlist upon successful content transmission or empty bitlist receive.

Source

fn trace_offer<'life0, 'async_trait>( &'life0 self, enr: Enr, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<OfferTrace>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an OFFER request with given ContentItems, to the designated peer. Does not store the content locally. Returns trace info for offer.

Source

fn store<'life0, 'async_trait>( &'life0 self, content_key: StateContentKey, content_value: RawContentValue, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store content key with a content data to the local database.

Source

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

Get a content from the local database

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§