Trait jormungandr_automation::jormungandr::grpc::node::node_server::Node
source · 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§
sourcetype GetBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static
type GetBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static
Server streaming response type for the GetBlocks method.
sourcetype GetHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static
type GetHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static
Server streaming response type for the GetHeaders method.
sourcetype GetFragmentsStream: Stream<Item = Result<Fragment, Status>> + Send + 'static
type GetFragmentsStream: Stream<Item = Result<Fragment, Status>> + Send + 'static
Server streaming response type for the GetFragments method.
sourcetype PullHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static
type PullHeadersStream: Stream<Item = Result<Header, Status>> + Send + 'static
Server streaming response type for the PullHeaders method.
sourcetype PullBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static
type PullBlocksStream: Stream<Item = Result<Block, Status>> + Send + 'static
Server streaming response type for the PullBlocks method.
sourcetype PullBlocksToTipStream: Stream<Item = Result<Block, Status>> + Send + 'static
type PullBlocksToTipStream: Stream<Item = Result<Block, Status>> + Send + 'static
Server streaming response type for the PullBlocksToTip method.
sourcetype BlockSubscriptionStream: Stream<Item = Result<BlockEvent, Status>> + Send + 'static
type BlockSubscriptionStream: Stream<Item = Result<BlockEvent, Status>> + Send + 'static
Server streaming response type for the BlockSubscription method.
Required Methods§
sourcefn 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 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.
sourcefn 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 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.
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,
sourcefn 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 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
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,
sourcefn 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_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.
sourcefn 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<'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.
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,
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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,
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.