pub trait Node: Send + Sync + 'static {
    type GetBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static;
    type GetHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static;
    type GetFragmentsStream: Stream<Item = Result<Fragment, Status>> + Send + 'static;
    type PullHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static;
    type PullBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static;
    type PullBlocksToTipStream: Stream<Item = Result<Block, Status>> + Send + 'static;
    type BlockSubscriptionStream: Stream<Item = Result<BlockEvent, Status>> + Send + 'static;
    type FragmentSubscriptionStream: Stream<Item = Result<Fragment, Status>> + Send + 'static;
    type GossipSubscriptionStream: Stream<Item = Result<Gossip, Status>> + Send + 'static;

Show 15 methods // Required methods fn handshake<'life0, 'async_trait>( &'life0 self, request: Request<HandshakeRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<HandshakeResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn client_auth<'life0, 'async_trait>( &'life0 self, request: Request<ClientAuthRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<ClientAuthResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn tip<'life0, 'async_trait>( &'life0 self, request: Request<TipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<TipResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn peers<'life0, 'async_trait>( &'life0 self, request: Request<PeersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<PeersResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_blocks<'life0, 'async_trait>( &'life0 self, request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetBlocksStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_headers<'life0, 'async_trait>( &'life0 self, request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetHeadersStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_fragments<'life0, 'async_trait>( &'life0 self, request: Request<FragmentIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetFragmentsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pull_headers<'life0, 'async_trait>( &'life0 self, request: Request<PullHeadersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullHeadersStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pull_blocks<'life0, 'async_trait>( &'life0 self, request: Request<PullBlocksRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pull_blocks_to_tip<'life0, 'async_trait>( &'life0 self, request: Request<PullBlocksToTipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksToTipStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn push_headers<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<PushHeadersResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn upload_blocks<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Block>> ) -> Pin<Box<dyn Future<Output = Result<Response<UploadBlocksResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn block_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fragment_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Fragment>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::FragmentSubscriptionStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn gossip_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Gossip>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GossipSubscriptionStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with NodeServer.

Required Associated Types§

source

type GetBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static

Server streaming response type for the GetBlocks method.

source

type GetHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static

Server streaming response type for the GetHeaders method.

source

type GetFragmentsStream: Stream<Item = Result<Fragment, Status>> + Send + 'static

Server streaming response type for the GetFragments method.

source

type PullHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static

Server streaming response type for the PullHeaders method.

source

type PullBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static

Server streaming response type for the PullBlocks method.

source

type PullBlocksToTipStream: Stream<Item = Result<Block, Status>> + Send + 'static

Server streaming response type for the PullBlocksToTip method.

source

type BlockSubscriptionStream: Stream<Item = Result<BlockEvent, Status>> + Send + 'static

Server streaming response type for the BlockSubscription method.

source

type FragmentSubscriptionStream: Stream<Item = Result<Fragment, Status>> + Send + 'static

Server streaming response type for the FragmentSubscription method.

source

type GossipSubscriptionStream: Stream<Item = Result<Gossip, Status>> + Send + 'static

Server streaming response type for the GossipSubscription method.

Required Methods§

source

fn handshake<'life0, 'async_trait>( &'life0 self, request: Request<HandshakeRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<HandshakeResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Initial handshake and authentication of the server node.

source

fn client_auth<'life0, 'async_trait>( &'life0 self, request: Request<ClientAuthRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<ClientAuthResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Optional authentication of the client node. Called after Handshake.

source

fn tip<'life0, 'async_trait>( &'life0 self, request: Request<TipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<TipResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn peers<'life0, 'async_trait>( &'life0 self, request: Request<PeersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<PeersResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Requests for some peers

source

fn get_blocks<'life0, 'async_trait>( &'life0 self, request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetBlocksStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_headers<'life0, 'async_trait>( &'life0 self, request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetHeadersStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_fragments<'life0, 'async_trait>( &'life0 self, request: Request<FragmentIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetFragmentsStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn pull_headers<'life0, 'async_trait>( &'life0 self, request: Request<PullHeadersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullHeadersStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Requests headers of blocks in the chain in the chronological order, given a selection of possible starting blocks known by the requester, and the identifier of the end block to be included in the returned sequence.

source

fn pull_blocks<'life0, 'async_trait>( &'life0 self, request: Request<PullBlocksRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Requests blocks in the chain in the chronological order, given a selection of possible starting blocks known by the requester, and the identifier of the end block to be included in the returned sequence.

source

fn pull_blocks_to_tip<'life0, 'async_trait>( &'life0 self, request: Request<PullBlocksToTipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksToTipStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn push_headers<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<PushHeadersResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Sends headers of blocks to the service in response to a missing item received from the BlockSubscription response stream. The headers are streamed the in chronological order of the chain.

source

fn upload_blocks<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Block>> ) -> Pin<Box<dyn Future<Output = Result<Response<UploadBlocksResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Uploads blocks to the service in response to a solicit item received from the BlockSubscription response stream.

source

fn block_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Establishes a bidirectional stream to exchange information on new blocks created or accepted by the peers.

source

fn fragment_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Fragment>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::FragmentSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Establishes a bidirectional stream to exchange information on new block fragments created or accepted by the peers.

source

fn gossip_subscription<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<Gossip>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GossipSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Establishes a bidirectional stream to exchange information on new network peers.

Implementors§