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§
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_genesis_config_hash(
&self,
) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send
fn get_genesis_config_hash( &self, ) -> impl Future<Output = Result<CryptoHash, NodeError>> + Send
Gets the network’s genesis config hash.
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 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.
Object Safety§
This trait is not object safe.