linera_core::node

Trait ValidatorNode

Source
pub trait ValidatorNode: Send {
    type NotificationStream: Stream<Item = Notification> + Unpin + Send;

Show 17 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_genesis_config_hash( &self, ) -> impl Future<Output = Result<CryptoHash, 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 blob_last_used_by( &self, blob_id: BlobId, ) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send; fn missing_blob_ids( &self, blob_ids: Vec<BlobId>, ) -> impl Future<Output = Result<Vec<BlobId>, NodeError>> + Send;
}
Expand description

How to communicate with a validator node.

Required Associated Types§

Required Methods§

Source

fn handle_block_proposal( &self, proposal: BlockProposal, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Proposes a new block.

Source

fn handle_lite_certificate( &self, certificate: LiteCertificate<'_>, delivery: CrossChainMessageDelivery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Processes a certificate without a value.

Source

fn handle_confirmed_certificate( &self, certificate: GenericCertificate<ConfirmedBlock>, delivery: CrossChainMessageDelivery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Processes a confirmed certificate.

Source

fn handle_validated_certificate( &self, certificate: GenericCertificate<ValidatedBlock>, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Processes a validated certificate.

Source

fn handle_timeout_certificate( &self, certificate: GenericCertificate<Timeout>, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Processes a timeout certificate.

Source

fn handle_chain_info_query( &self, query: ChainInfoQuery, ) -> impl Future<Output = Result<ChainInfoResponse, NodeError>> + Send

Handles information queries for this chain.

Source

fn get_version_info( &self, ) -> impl Future<Output = Result<VersionInfo, NodeError>> + Send

Gets the version info for this validator node.

Source

fn get_genesis_config_hash( &self, ) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send

Gets the network’s genesis config hash.

Source

fn subscribe( &self, chains: Vec<ChainId>, ) -> impl Future<Output = Result<Self::NotificationStream, NodeError>> + Send

Subscribes to receiving notifications for a collection of chains.

Source

fn upload_blob( &self, content: BlobContent, ) -> impl Future<Output = Result<BlobId, NodeError>> + Send

Source

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.

Source

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.

Source

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.

Source

fn download_certificate( &self, hash: CryptoHash, ) -> impl Future<Output = Result<ConfirmedBlockCertificate, NodeError>> + Send

Source

fn download_certificates( &self, hashes: Vec<CryptoHash>, ) -> impl Future<Output = Result<Vec<ConfirmedBlockCertificate>, NodeError>> + Send

Requests a batch of certificates from the validator.

Source

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.

Source

fn missing_blob_ids( &self, blob_ids: Vec<BlobId>, ) -> impl Future<Output = Result<Vec<BlobId>, NodeError>> + Send

Returns the missing Blobs by their IDs.

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.

Implementors§