pub trait ValidatorNode: Send {
type NotificationStream: Stream<Item = Notification> + Unpin + Send;
Show 20 methods
// Required methods
fn handle_block_proposal(
&self,
proposal: BlockProposal,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn handle_lite_certificate(
&self,
certificate: LiteCertificate<'_>,
delivery: CrossChainMessageDelivery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn handle_confirmed_certificate(
&self,
certificate: GenericCertificate<ConfirmedBlock>,
delivery: CrossChainMessageDelivery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn handle_validated_certificate(
&self,
certificate: GenericCertificate<ValidatedBlock>,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn handle_timeout_certificate(
&self,
certificate: GenericCertificate<Timeout>,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn handle_chain_info_query(
&self,
query: ChainInfoQuery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn get_version_info(
&self,
) -> impl Future<Output = Result<VersionInfo, NodeError>> + Send;
fn get_network_description(
&self,
) -> impl Future<Output = Result<NetworkDescription, NodeError>> + Send;
fn subscribe(
&self,
chains: Vec<ChainId>,
) -> impl Future<Output = Result<Self::NotificationStream, NodeError>> + Send;
fn upload_blob(
&self,
content: BlobContent,
) -> impl Future<Output = Result<BlobId, NodeError>> + Send;
fn download_blob(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<BlobContent, NodeError>> + Send;
fn download_pending_blob(
&self,
chain_id: ChainId,
blob_id: BlobId,
) -> impl Future<Output = Result<BlobContent, NodeError>> + Send;
fn handle_pending_blob(
&self,
chain_id: ChainId,
blob: BlobContent,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send;
fn download_certificate(
&self,
hash: CryptoHash,
) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send;
fn download_certificates(
&self,
hashes: Vec<CryptoHash>,
) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send;
fn download_certificates_by_heights(
&self,
chain_id: ChainId,
heights: Vec<BlockHeight>,
) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send;
fn blob_last_used_by(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send;
fn blob_last_used_by_certificate(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send;
fn missing_blob_ids(
&self,
blob_ids: Vec<BlobId>,
) -> impl Future<Output = Result<Vec<BlobId>, NodeError>> + Send;
// Provided method
fn upload_blobs(
&self,
blobs: Vec<Blob>,
) -> impl Future<Output = Result<Vec<BlobId>, NodeError>> + Send { ... }
}
Expand description
How to communicate with a validator node.
Required Associated Types§
type NotificationStream: Stream<Item = Notification> + Unpin + Send
Required Methods§
Sourcefn handle_block_proposal(
&self,
proposal: BlockProposal,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_block_proposal( &self, proposal: BlockProposal, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Proposes a new block.
Sourcefn handle_lite_certificate(
&self,
certificate: LiteCertificate<'_>,
delivery: CrossChainMessageDelivery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_lite_certificate( &self, certificate: LiteCertificate<'_>, delivery: CrossChainMessageDelivery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Processes a certificate without a value.
Sourcefn handle_confirmed_certificate(
&self,
certificate: GenericCertificate<ConfirmedBlock>,
delivery: CrossChainMessageDelivery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_confirmed_certificate( &self, certificate: GenericCertificate<ConfirmedBlock>, delivery: CrossChainMessageDelivery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Processes a confirmed certificate.
Sourcefn handle_validated_certificate(
&self,
certificate: GenericCertificate<ValidatedBlock>,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_validated_certificate( &self, certificate: GenericCertificate<ValidatedBlock>, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Processes a validated certificate.
Sourcefn handle_timeout_certificate(
&self,
certificate: GenericCertificate<Timeout>,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_timeout_certificate( &self, certificate: GenericCertificate<Timeout>, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Processes a timeout certificate.
Sourcefn handle_chain_info_query(
&self,
query: ChainInfoQuery,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_chain_info_query( &self, query: ChainInfoQuery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Handles information queries for this chain.
Sourcefn get_version_info(
&self,
) -> impl Future<Output = Result<VersionInfo, NodeError>> + Send
fn get_version_info( &self, ) -> impl Future<Output = Result<VersionInfo, NodeError>> + Send
Gets the version info for this validator node.
Sourcefn get_network_description(
&self,
) -> impl Future<Output = Result<NetworkDescription, NodeError>> + Send
fn get_network_description( &self, ) -> impl Future<Output = Result<NetworkDescription, NodeError>> + Send
Gets the network’s description.
Sourcefn subscribe(
&self,
chains: Vec<ChainId>,
) -> impl Future<Output = Result<Self::NotificationStream, NodeError>> + Send
fn subscribe( &self, chains: Vec<ChainId>, ) -> impl Future<Output = Result<Self::NotificationStream, NodeError>> + Send
Subscribes to receiving notifications for a collection of chains.
fn upload_blob( &self, content: BlobContent, ) -> impl Future<Output = Result<BlobId, NodeError>> + Send
Sourcefn download_blob(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<BlobContent, NodeError>> + Send
fn download_blob( &self, blob_id: BlobId, ) -> impl Future<Output = Result<BlobContent, NodeError>> + Send
Downloads a blob. Returns an error if the validator does not have the blob.
Sourcefn download_pending_blob(
&self,
chain_id: ChainId,
blob_id: BlobId,
) -> impl Future<Output = Result<BlobContent, NodeError>> + Send
fn download_pending_blob( &self, chain_id: ChainId, blob_id: BlobId, ) -> impl Future<Output = Result<BlobContent, NodeError>> + Send
Downloads a blob that belongs to a pending proposal or the locking block on a chain.
Sourcefn handle_pending_blob(
&self,
chain_id: ChainId,
blob: BlobContent,
) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
fn handle_pending_blob( &self, chain_id: ChainId, blob: BlobContent, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send
Handles a blob that belongs to a pending proposal or validated block certificate.
fn download_certificate( &self, hash: CryptoHash, ) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send
Sourcefn download_certificates(
&self,
hashes: Vec<CryptoHash>,
) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send
fn download_certificates( &self, hashes: Vec<CryptoHash>, ) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send
Requests a batch of certificates from the validator.
Sourcefn download_certificates_by_heights(
&self,
chain_id: ChainId,
heights: Vec<BlockHeight>,
) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send
fn download_certificates_by_heights( &self, chain_id: ChainId, heights: Vec<BlockHeight>, ) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send
Requests a batch of certificates from a specific chain by heights.
Sourcefn blob_last_used_by(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send
fn blob_last_used_by( &self, blob_id: BlobId, ) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send
Returns the hash of the Certificate
that last used a blob.
Sourcefn blob_last_used_by_certificate(
&self,
blob_id: BlobId,
) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send
fn blob_last_used_by_certificate( &self, blob_id: BlobId, ) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send
Returns the certificate that last used the blob.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.