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<BoxBody>,
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<BoxBody>,
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<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::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.
Sourcepub async fn handle_certificate(
&mut self,
request: impl IntoRequest<HandleCertificateRequest>,
) -> Result<Response<ChainInfoResult>, Status>
pub async fn handle_certificate( &mut self, request: impl IntoRequest<HandleCertificateRequest>, ) -> Result<Response<ChainInfoResult>, Status>
Process a certificate.
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_genesis_config_hash(
&mut self,
request: impl IntoRequest<()>,
) -> Result<Response<CryptoHash>, Status>
pub async fn get_genesis_config_hash( &mut self, request: impl IntoRequest<()>, ) -> Result<Response<CryptoHash>, Status>
Request the genesis configuration hash of the network this node is part of.
Sourcepub async fn download_blob_content(
&mut self,
request: impl IntoRequest<BlobId>,
) -> Result<Response<BlobContent>, Status>
pub async fn download_blob_content( &mut self, request: impl IntoRequest<BlobId>, ) -> Result<Response<BlobContent>, Status>
Downloads a blob content.
Sourcepub async fn download_certificate_value(
&mut self,
request: impl IntoRequest<CryptoHash>,
) -> Result<Response<CertificateValue>, Status>
pub async fn download_certificate_value( &mut self, request: impl IntoRequest<CryptoHash>, ) -> Result<Response<CertificateValue>, Status>
Downloads a certificate value.
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>
Downloads 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>
Downloads a batch of certificates.
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>
Returns the hash of the Certificate
that last used a blob.
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 · 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> UnwindSafe for ValidatorNodeClient<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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::Request
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
.