Skip to main content

TempoConsensusApiServer

Trait TempoConsensusApiServer 

Source
pub trait TempoConsensusApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get_finalization<'life0, 'async_trait>(
        &'life0 self,
        query: Query,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<CertifiedBlock>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_latest<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<ConsensusState>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_identity_transition_proof<'life0, 'async_trait>(
        &'life0 self,
        from_epoch: Option<u64>,
        full: Option<bool>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<IdentityTransitionResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_events<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the TempoConsensusApi RPC API.

Required Methods§

Source

fn get_finalization<'life0, 'async_trait>( &'life0 self, query: Query, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<CertifiedBlock>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get finalization by height query.

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

Source

fn get_latest<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<ConsensusState>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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<'life0, 'async_trait>( &'life0 self, from_epoch: Option<u64>, full: Option<bool>, ) -> Pin<Box<dyn Future<Output = RpcResult<IdentityTransitionResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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§