pub struct ValidatorNodeClient<T> { /* private fields */ }Expand description
How to communicate with a validator or a local node.
Implementations§
Source§impl<T> ValidatorNodeClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> ValidatorNodeClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ValidatorNodeClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn handle_block_proposal(
&mut self,
request: impl IntoRequest<BlockProposal>,
) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_block_proposal( &mut self, request: impl IntoRequest<BlockProposal>, ) -> Result<Response<ChainInfoResult>, Status>
Propose a new block.
Sourcepub async fn handle_lite_certificate(
&mut self,
request: impl IntoRequest<LiteCertificate>,
) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_lite_certificate( &mut self, request: impl IntoRequest<LiteCertificate>, ) -> Result<Response<ChainInfoResult>, Status>
Process a certificate without value.
pub async fn handle_confirmed_certificate( &mut self, request: impl IntoRequest<HandleConfirmedCertificateRequest>, ) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_validated_certificate( &mut self, request: impl IntoRequest<HandleValidatedCertificateRequest>, ) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_timeout_certificate( &mut self, request: impl IntoRequest<HandleTimeoutCertificateRequest>, ) -> Result<Response<ChainInfoResult>, Status>
Sourcepub async fn handle_chain_info_query(
&mut self,
request: impl IntoRequest<ChainInfoQuery>,
) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_chain_info_query( &mut self, request: impl IntoRequest<ChainInfoQuery>, ) -> Result<Response<ChainInfoResult>, Status>
Handle information queries for this chain.
Sourcepub async fn subscribe(
&mut self,
request: impl IntoRequest<SubscriptionRequest>,
) -> Result<Response<Streaming<Notification>>, Status>
pub async fn subscribe( &mut self, request: impl IntoRequest<SubscriptionRequest>, ) -> Result<Response<Streaming<Notification>>, Status>
Subscribe to notifications for a set of Chain Ids.
Sourcepub async fn get_version_info(
&mut self,
request: impl IntoRequest<()>,
) -> Result<Response<VersionInfo>, Status>
pub async fn get_version_info( &mut self, request: impl IntoRequest<()>, ) -> Result<Response<VersionInfo>, Status>
Request the node’s version info.
Sourcepub async fn get_network_description(
&mut self,
request: impl IntoRequest<()>,
) -> Result<Response<NetworkDescription>, Status>
pub async fn get_network_description( &mut self, request: impl IntoRequest<()>, ) -> Result<Response<NetworkDescription>, Status>
Request the network description seen by this node.
Sourcepub async fn download_blob(
&mut self,
request: impl IntoRequest<BlobId>,
) -> Result<Response<BlobContent>, Status>
pub async fn download_blob( &mut self, request: impl IntoRequest<BlobId>, ) -> Result<Response<BlobContent>, Status>
Download a blob.
Sourcepub async fn download_blobs(
&mut self,
request: impl IntoRequest<BlobIds>,
) -> Result<Response<Streaming<BlobContent>>, Status>
pub async fn download_blobs( &mut self, request: impl IntoRequest<BlobIds>, ) -> Result<Response<Streaming<BlobContent>>, Status>
Download a batch of blobs as a stream.
Sourcepub async fn download_pending_blob(
&mut self,
request: impl IntoRequest<PendingBlobRequest>,
) -> Result<Response<PendingBlobResult>, Status>
pub async fn download_pending_blob( &mut self, request: impl IntoRequest<PendingBlobRequest>, ) -> Result<Response<PendingBlobResult>, Status>
Download a blob that belongs to a pending block on the given chain.
Sourcepub async fn handle_pending_blob(
&mut self,
request: impl IntoRequest<HandlePendingBlobRequest>,
) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_pending_blob( &mut self, request: impl IntoRequest<HandlePendingBlobRequest>, ) -> Result<Response<ChainInfoResult>, Status>
Handle a blob that belongs to a pending block on the given chain.
Sourcepub async fn upload_blob(
&mut self,
request: impl IntoRequest<BlobContent>,
) -> Result<Response<BlobId>, Status>
pub async fn upload_blob( &mut self, request: impl IntoRequest<BlobContent>, ) -> Result<Response<BlobId>, Status>
Upload a blob. Returns an error if the validator has not seen a certificate using this blob.
Sourcepub async fn download_certificate(
&mut self,
request: impl IntoRequest<CryptoHash>,
) -> Result<Response<Certificate>, Status>
pub async fn download_certificate( &mut self, request: impl IntoRequest<CryptoHash>, ) -> Result<Response<Certificate>, Status>
Download a certificate.
Sourcepub async fn download_certificates(
&mut self,
request: impl IntoRequest<CertificatesBatchRequest>,
) -> Result<Response<CertificatesBatchResponse>, Status>
pub async fn download_certificates( &mut self, request: impl IntoRequest<CertificatesBatchRequest>, ) -> Result<Response<CertificatesBatchResponse>, Status>
Download a batch of certificates.
Sourcepub async fn download_certificates_by_heights(
&mut self,
request: impl IntoRequest<DownloadCertificatesByHeightsRequest>,
) -> Result<Response<CertificatesBatchResponse>, Status>
pub async fn download_certificates_by_heights( &mut self, request: impl IntoRequest<DownloadCertificatesByHeightsRequest>, ) -> Result<Response<CertificatesBatchResponse>, Status>
/ Download a batch of certificates by heights.
Sourcepub async fn download_raw_certificates_by_heights(
&mut self,
request: impl IntoRequest<DownloadCertificatesByHeightsRequest>,
) -> Result<Response<RawCertificatesBatch>, Status>
pub async fn download_raw_certificates_by_heights( &mut self, request: impl IntoRequest<DownloadCertificatesByHeightsRequest>, ) -> Result<Response<RawCertificatesBatch>, Status>
Download a batch of certificates, in serialized form, by their heights.
Sourcepub async fn blob_last_used_by(
&mut self,
request: impl IntoRequest<BlobId>,
) -> Result<Response<CryptoHash>, Status>
pub async fn blob_last_used_by( &mut self, request: impl IntoRequest<BlobId>, ) -> Result<Response<CryptoHash>, Status>
Return the hash of the Certificate that last used a blob.
Sourcepub async fn missing_blob_ids(
&mut self,
request: impl IntoRequest<BlobIds>,
) -> Result<Response<BlobIds>, Status>
pub async fn missing_blob_ids( &mut self, request: impl IntoRequest<BlobIds>, ) -> Result<Response<BlobIds>, Status>
Return the BlobIds that are not contained as Blob.
Sourcepub async fn blob_last_used_by_certificate(
&mut self,
request: impl IntoRequest<BlobId>,
) -> Result<Response<Certificate>, Status>
pub async fn blob_last_used_by_certificate( &mut self, request: impl IntoRequest<BlobId>, ) -> Result<Response<Certificate>, Status>
Returns the certificate that last used the blob.
Sourcepub async fn previous_event_blocks(
&mut self,
request: impl IntoRequest<PreviousEventBlocksRequest>,
) -> Result<Response<PreviousEventBlocksResponse>, Status>
pub async fn previous_event_blocks( &mut self, request: impl IntoRequest<PreviousEventBlocksRequest>, ) -> Result<Response<PreviousEventBlocksResponse>, Status>
Returns the previous event blocks for a chain’s streams.
Trait Implementations§
Source§impl<T: Clone> Clone for ValidatorNodeClient<T>
impl<T: Clone> Clone for ValidatorNodeClient<T>
Source§fn clone(&self) -> ValidatorNodeClient<T>
fn clone(&self) -> ValidatorNodeClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for ValidatorNodeClient<T>
impl<T> RefUnwindSafe for ValidatorNodeClient<T>where
T: RefUnwindSafe,
impl<T> Send for ValidatorNodeClient<T>where
T: Send,
impl<T> Sync for ValidatorNodeClient<T>where
T: Sync,
impl<T> Unpin for ValidatorNodeClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for ValidatorNodeClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ValidatorNodeClient<T>where
T: UnwindSafe,
Blanket Implementations§
impl<_INNER> AutoTraits for _INNER
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
T in a tonic::Requestimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
impl<T> Post for Twhere
T: Send + 'static,
Source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length bytes from memory from the provided location.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.