Trait linera_core::node::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S> ValidatorNode for LocalValidatorClient<S>
where S: Storage + Clone + Send + Sync + 'static,