pub enum Client {
Grpc(Box<GrpcClient>),
}Expand description
A client for communicating with a validator over one of the supported networks.
Variants§
Grpc(Box<GrpcClient>)
A client using the gRPC network.
Trait Implementations§
Source§impl From<GrpcClient> for Client
impl From<GrpcClient> for Client
Source§fn from(client: GrpcClient) -> Self
fn from(client: GrpcClient) -> Self
Converts to this type from the input type.
Source§impl ValidatorNode for Client
impl ValidatorNode for Client
Source§type NotificationStream = Pin<Box<dyn Stream<Item = Notification> + Send>>
type NotificationStream = Pin<Box<dyn Stream<Item = Notification> + Send>>
The type of stream of notifications returned when subscribing.
Source§async fn handle_block_proposal(
&self,
proposal: BlockProposal,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_block_proposal( &self, proposal: BlockProposal, ) -> Result<ChainInfoResponse, NodeError>
Proposes a new block.
Source§async fn handle_lite_certificate(
&self,
certificate: LiteCertificate<'_>,
delivery: CrossChainMessageDelivery,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_lite_certificate( &self, certificate: LiteCertificate<'_>, delivery: CrossChainMessageDelivery, ) -> Result<ChainInfoResponse, NodeError>
Processes a certificate without a value.
Source§async fn handle_timeout_certificate(
&self,
certificate: TimeoutCertificate,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_timeout_certificate( &self, certificate: TimeoutCertificate, ) -> Result<ChainInfoResponse, NodeError>
Processes a timeout certificate.
Source§async fn handle_confirmed_certificate(
&self,
certificate: CacheArc<ConfirmedBlockCertificate>,
delivery: CrossChainMessageDelivery,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_confirmed_certificate( &self, certificate: CacheArc<ConfirmedBlockCertificate>, delivery: CrossChainMessageDelivery, ) -> Result<ChainInfoResponse, NodeError>
Processes a confirmed certificate.
Source§async fn handle_validated_certificate(
&self,
certificate: ValidatedBlockCertificate,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_validated_certificate( &self, certificate: ValidatedBlockCertificate, ) -> Result<ChainInfoResponse, NodeError>
Processes a validated certificate.
Source§async fn handle_chain_info_query(
&self,
query: ChainInfoQuery,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_chain_info_query( &self, query: ChainInfoQuery, ) -> Result<ChainInfoResponse, NodeError>
Handles information queries for this chain.
Source§async fn subscribe(
&self,
chains: Vec<ChainId>,
) -> Result<Self::NotificationStream, NodeError>
async fn subscribe( &self, chains: Vec<ChainId>, ) -> Result<Self::NotificationStream, NodeError>
Subscribes to receiving notifications for a collection of chains.
Source§async fn get_version_info(&self) -> Result<VersionInfo, NodeError>
async fn get_version_info(&self) -> Result<VersionInfo, NodeError>
Gets the version info for this validator node.
Source§async fn get_network_description(&self) -> Result<NetworkDescription, NodeError>
async fn get_network_description(&self) -> Result<NetworkDescription, NodeError>
Gets the network’s description.
Source§async fn upload_blob(&self, content: BlobContent) -> Result<BlobId, NodeError>
async fn upload_blob(&self, content: BlobContent) -> Result<BlobId, NodeError>
Uploads a blob. Returns an error if the validator has not seen a
certificate using this blob.
Source§async fn download_blob(&self, blob_id: BlobId) -> Result<BlobContent, NodeError>
async fn download_blob(&self, blob_id: BlobId) -> Result<BlobContent, NodeError>
Downloads a blob. Returns an error if the validator does not have the blob.
Source§async fn download_blobs(
&self,
blob_ids: Vec<BlobId>,
) -> Result<BlobStream, NodeError>
async fn download_blobs( &self, blob_ids: Vec<BlobId>, ) -> Result<BlobStream, NodeError>
Downloads a batch of blobs as a stream. The stream yields one blob per
requested id, in order. On mid-stream errors, the caller can retry the
remaining blob ids against another validator.
Source§async fn download_pending_blob(
&self,
chain_id: ChainId,
blob_id: BlobId,
) -> Result<BlobContent, NodeError>
async fn download_pending_blob( &self, chain_id: ChainId, blob_id: BlobId, ) -> Result<BlobContent, NodeError>
Downloads a blob that belongs to a pending proposal or the locking block on a chain.
Source§async fn handle_pending_blob(
&self,
chain_id: ChainId,
blob: BlobContent,
) -> Result<ChainInfoResponse, NodeError>
async fn handle_pending_blob( &self, chain_id: ChainId, blob: BlobContent, ) -> Result<ChainInfoResponse, NodeError>
Handles a blob that belongs to a pending proposal or validated block certificate.
Source§async fn download_certificate(
&self,
hash: CryptoHash,
) -> Result<ConfirmedBlockCertificate, NodeError>
async fn download_certificate( &self, hash: CryptoHash, ) -> Result<ConfirmedBlockCertificate, NodeError>
Downloads the confirmed block certificate with the given hash.
Source§async fn download_certificates(
&self,
hashes: Vec<CryptoHash>,
) -> Result<Vec<ConfirmedBlockCertificate>, NodeError>
async fn download_certificates( &self, hashes: Vec<CryptoHash>, ) -> Result<Vec<ConfirmedBlockCertificate>, NodeError>
Requests a batch of certificates from the validator.
Source§async fn download_certificates_by_heights(
&self,
chain_id: ChainId,
heights: Vec<BlockHeight>,
) -> Result<Vec<ConfirmedBlockCertificate>, NodeError>
async fn download_certificates_by_heights( &self, chain_id: ChainId, heights: Vec<BlockHeight>, ) -> Result<Vec<ConfirmedBlockCertificate>, NodeError>
Requests a batch of certificates from a specific chain by heights. Read more
Source§async fn blob_last_used_by(
&self,
blob_id: BlobId,
) -> Result<CryptoHash, NodeError>
async fn blob_last_used_by( &self, blob_id: BlobId, ) -> Result<CryptoHash, NodeError>
Returns the hash of the
Certificate that last used a blob.Source§async fn missing_blob_ids(
&self,
blob_ids: Vec<BlobId>,
) -> Result<Vec<BlobId>, NodeError>
async fn missing_blob_ids( &self, blob_ids: Vec<BlobId>, ) -> Result<Vec<BlobId>, NodeError>
Returns the missing
Blobs by their IDs.Source§async fn blob_last_used_by_certificate(
&self,
blob_id: BlobId,
) -> Result<ConfirmedBlockCertificate, NodeError>
async fn blob_last_used_by_certificate( &self, blob_id: BlobId, ) -> Result<ConfirmedBlockCertificate, NodeError>
Returns the certificate that last used the blob.
Source§async fn previous_event_blocks(
&self,
chain_id: ChainId,
stream_ids: Vec<StreamId>,
) -> Result<BTreeMap<StreamId, (BlockHeight, CryptoHash)>, NodeError>
async fn previous_event_blocks( &self, chain_id: ChainId, stream_ids: Vec<StreamId>, ) -> Result<BTreeMap<StreamId, (BlockHeight, CryptoHash)>, NodeError>
Returns the previous event blocks for a chain’s streams.
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
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.