pub struct RelayerClient<T> { /* private fields */ }Expand description
/ Relayers offer a TPU and TPU forward proxy for Solana validators. / Validators can connect and fetch the TPU configuration for the relayer and start to advertise the / relayer’s information in gossip. / They can also subscribe to packets which arrived on the TPU ports at the relayer
Implementations§
Source§impl RelayerClient<Channel>
impl RelayerClient<Channel>
Source§impl<T> RelayerClient<T>
impl<T> RelayerClient<T>
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> RelayerClient<InterceptedService<T, F>>
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn get_tpu_configs(
&mut self,
request: impl IntoRequest<GetTpuConfigsRequest>,
) -> Result<Response<GetTpuConfigsResponse>, Status>
pub async fn get_tpu_configs( &mut self, request: impl IntoRequest<GetTpuConfigsRequest>, ) -> Result<Response<GetTpuConfigsResponse>, Status>
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.
Sourcepub async fn subscribe_packets(
&mut self,
request: impl IntoRequest<SubscribePacketsRequest>,
) -> Result<Response<Streaming<SubscribePacketsResponse>>, Status>
pub async fn subscribe_packets( &mut self, request: impl IntoRequest<SubscribePacketsRequest>, ) -> Result<Response<Streaming<SubscribePacketsResponse>>, Status>
Validators can subscribe to packets from the relayer and receive a multiplexed signal that contains a mixture of packets and heartbeats
Trait Implementations§
Source§impl<T: Clone> Clone for RelayerClient<T>
impl<T: Clone> Clone for RelayerClient<T>
Source§fn clone(&self) -> RelayerClient<T>
fn clone(&self) -> RelayerClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for RelayerClient<T>
impl<T> RefUnwindSafe for RelayerClient<T>where
T: RefUnwindSafe,
impl<T> Send for RelayerClient<T>where
T: Send,
impl<T> Sync for RelayerClient<T>where
T: Sync,
impl<T> Unpin for RelayerClient<T>where
T: Unpin,
impl<T> UnwindSafe for RelayerClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].