Struct chain_network::grpc::server::NodeService
source · pub struct NodeService<T> {
inner: T,
legacy_node_id: Option<NodeId>,
}
Fields§
§inner: T
§legacy_node_id: Option<NodeId>
Implementations§
source§impl<T> NodeService<T>where
T: Node,
impl<T> NodeService<T>where T: Node,
pub fn new(inner: T) -> Self
fn block_service(&self) -> Result<&T::BlockService, Status>
fn fragment_service(&self) -> Result<&T::FragmentService, Status>
fn gossip_service(&self) -> Result<&T::GossipService, Status>
fn subscription_response<S>( &self, outbound: S ) -> Response<OutboundTryStream<S>>
Trait Implementations§
source§impl<T: Debug> Debug for NodeService<T>
impl<T: Debug> Debug for NodeService<T>
source§impl<T> Node for NodeService<T>where
T: Node,
impl<T> Node for NodeService<T>where T: Node,
source§fn handshake<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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,
req: 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, req: 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, __arg1: 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,
req: 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, req: 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
§type GetBlocksStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::GetBlocksStream>
type GetBlocksStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::GetBlocksStream>
Server streaming response type for the GetBlocks method.
fn get_blocks<'life0, 'async_trait>( &'life0 self, req: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetBlocksStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
§type GetHeadersStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::GetHeadersStream>
type GetHeadersStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::GetHeadersStream>
Server streaming response type for the GetHeaders method.
fn get_headers<'life0, 'async_trait>( &'life0 self, req: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetHeadersStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
§type GetFragmentsStream = OutboundTryStream<<<T as Node>::FragmentService as FragmentService>::GetFragmentsStream>
type GetFragmentsStream = OutboundTryStream<<<T as Node>::FragmentService as FragmentService>::GetFragmentsStream>
Server streaming response type for the GetFragments method.
fn get_fragments<'life0, 'async_trait>( &'life0 self, req: Request<FragmentIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetFragmentsStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
§type PullHeadersStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullHeadersStream>
type PullHeadersStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullHeadersStream>
Server streaming response type for the PullHeaders method.
source§fn pull_headers<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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.
§type PullBlocksStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullBlocksStream>
type PullBlocksStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullBlocksStream>
Server streaming response type for the PullBlocks method.
source§fn pull_blocks<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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.
§type PullBlocksToTipStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullBlocksToTipStream>
type PullBlocksToTipStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::PullBlocksToTipStream>
Server streaming response type for the PullBlocksToTip method.
fn pull_blocks_to_tip<'life0, 'async_trait>( &'life0 self, req: 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,
req: 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, req: 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,
req: 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, req: 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.§type BlockSubscriptionStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::SubscriptionStream>
type BlockSubscriptionStream = OutboundTryStream<<<T as Node>::BlockService as BlockService>::SubscriptionStream>
Server streaming response type for the BlockSubscription method.
source§fn block_subscription<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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.
§type FragmentSubscriptionStream = OutboundTryStream<<<T as Node>::FragmentService as FragmentService>::SubscriptionStream>
type FragmentSubscriptionStream = OutboundTryStream<<<T as Node>::FragmentService as FragmentService>::SubscriptionStream>
Server streaming response type for the FragmentSubscription method.
source§fn fragment_subscription<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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.
§type GossipSubscriptionStream = OutboundTryStream<<<T as Node>::GossipService as GossipService>::SubscriptionStream>
type GossipSubscriptionStream = OutboundTryStream<<<T as Node>::GossipService as GossipService>::SubscriptionStream>
Server streaming response type for the GossipSubscription method.
source§fn gossip_subscription<'life0, 'async_trait>(
&'life0 self,
req: 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, req: 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.
Auto Trait Implementations§
impl<T> RefUnwindSafe for NodeService<T>where T: RefUnwindSafe,
impl<T> Send for NodeService<T>where T: Send,
impl<T> Sync for NodeService<T>where T: Sync,
impl<T> Unpin for NodeService<T>where T: Unpin,
impl<T> UnwindSafe for NodeService<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request