Skip to main content

TempoConsensusApiClient

Trait TempoConsensusApiClient 

Source
pub trait TempoConsensusApiClient: SubscriptionClientT {
    // Provided methods
    fn get_finalization(
        &self,
        query: Query,
    ) -> impl Future<Output = Result<Option<CertifiedBlock>, Error>> + Send { ... }
    fn get_latest(
        &self,
    ) -> impl Future<Output = Result<ConsensusState, Error>> + Send { ... }
    fn get_identity_transition_proof(
        &self,
        from_epoch: Option<u64>,
        full: Option<bool>,
    ) -> impl Future<Output = Result<IdentityTransitionResponse, Error>> + Send { ... }
    fn subscribe_events(
        &self,
    ) -> impl Future<Output = Result<Subscription<Event>, Error>> + Send { ... }
}
Expand description

Client implementation for the TempoConsensusApi RPC API.

Provided Methods§

Source

fn get_finalization( &self, query: Query, ) -> impl Future<Output = Result<Option<CertifiedBlock>, Error>> + Send

Get finalization by height query.

Use "latest" to get the most recent finalization, or {"height": N} for a specific height.

Source

fn get_latest( &self, ) -> impl Future<Output = Result<ConsensusState, Error>> + Send

Get the current consensus state snapshot.

Returns the latest finalized block and the latest notarized block (if not yet finalized).

Source

fn get_identity_transition_proof( &self, from_epoch: Option<u64>, full: Option<bool>, ) -> impl Future<Output = Result<IdentityTransitionResponse, Error>> + Send

Get identity transition proofs (full DKG events).

Each proof contains the block header with the new DKG outcome, and a BLS certificate from the OLD network identity that signs the block.

  • from_epoch: Optional epoch to start searching from (defaults to latest finalized)
  • full = false (default): Returns only the most recent transition
  • full = true: Returns all transitions from the starting epoch back to genesis
Source

fn subscribe_events( &self, ) -> impl Future<Output = Result<Subscription<Event>, Error>> + Send

Subscribe to all consensus events (Notarized, Finalized, Nullified).

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§

Source§

impl<TypeJsonRpseeInternal> TempoConsensusApiClient for TypeJsonRpseeInternal
where TypeJsonRpseeInternal: SubscriptionClientT,