Trait Relayer

Source
pub trait Relayer:
    Send
    + Sync
    + 'static {
    type SubscribePacketsStream: Stream<Item = Result<SubscribePacketsResponse, Status>> + Send + 'static;

    // Required methods
    fn get_tpu_configs<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetTpuConfigsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetTpuConfigsResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_packets<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SubscribePacketsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribePacketsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with RelayerServer.

Required Associated Types§

Source

type SubscribePacketsStream: Stream<Item = Result<SubscribePacketsResponse, Status>> + Send + 'static

Server streaming response type for the SubscribePackets method.

Required Methods§

Source

fn get_tpu_configs<'life0, 'async_trait>( &'life0 self, request: Request<GetTpuConfigsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetTpuConfigsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The relayer has TPU and TPU forward sockets that validators can leverage. A validator can fetch this config and change its TPU and TPU forward port in gossip.

Source

fn subscribe_packets<'life0, 'async_trait>( &'life0 self, request: Request<SubscribePacketsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribePacketsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Validators can subscribe to packets from the relayer and receive a multiplexed signal that contains a mixture of packets and heartbeats

Implementors§