pub struct TychoStreamBuilder { /* private fields */ }Implementations§
Source§impl TychoStreamBuilder
impl TychoStreamBuilder
Sourcepub fn new(tycho_url: &str, chain: Chain) -> Self
pub fn new(tycho_url: &str, chain: Chain) -> Self
Creates a new TychoStreamBuilder with the given Tycho URL and blockchain network.
Initializes the builder with default values for block time and timeout based on the chain.
Sourcepub fn exchange(self, name: &str, filter: ComponentFilter) -> Self
pub fn exchange(self, name: &str, filter: ComponentFilter) -> Self
Adds an exchange and its corresponding filter to the Tycho client.
Sourcepub fn block_time(self, block_time: u64) -> Self
pub fn block_time(self, block_time: u64) -> Self
Sets the block time for the Tycho client.
pub fn startup_timeout(self, timeout: Duration) -> Self
pub fn max_missed_blocks(self, max_missed_blocks: u64) -> Self
pub fn websockets_retry_config(self, retry_config: &RetryConfiguration) -> Self
pub fn state_synchronizer_retry_config( self, retry_config: &RetryConfiguration, ) -> Self
Sourcepub fn no_state(self, no_state: bool) -> Self
pub fn no_state(self, no_state: bool) -> Self
Configures the client to exclude state updates from the stream.
Sourcepub fn auth_key(self, auth_key: Option<String>) -> Self
pub fn auth_key(self, auth_key: Option<String>) -> Self
Sets the API key for authenticating with the Tycho server.
Optionally you can set the TYCHO_AUTH_TOKEN env var instead. Make sure to set no_tsl to false if you do this.
Sourcepub fn no_tls(self, no_tls: bool) -> Self
pub fn no_tls(self, no_tls: bool) -> Self
Disables TLS/SSL for the connection, using http and ws protocols.
Sourcepub fn include_tvl(self, include_tvl: bool) -> Self
pub fn include_tvl(self, include_tvl: bool) -> Self
Configures the client to include TVL in the stream.
If set to true, this will increase start-up time due to additional requests.
Sourcepub fn disable_compression(self) -> Self
pub fn disable_compression(self) -> Self
Disables compression for RPC and WebSocket communication. By default, messages are compressed using zstd.
Sourcepub fn enable_partial_blocks(self) -> Self
pub fn enable_partial_blocks(self) -> Self
Enables the client to receive partial block updates (flashblocks).
Sourcepub async fn build(
self,
) -> Result<(JoinHandle<()>, Receiver<Result<FeedMessage<BlockHeader>, BlockSynchronizerError>>), StreamError>
pub async fn build( self, ) -> Result<(JoinHandle<()>, Receiver<Result<FeedMessage<BlockHeader>, BlockSynchronizerError>>), StreamError>
Builds and starts the Tycho client, connecting to the Tycho server and setting up the synchronization of exchange components.
Auto Trait Implementations§
impl Freeze for TychoStreamBuilder
impl RefUnwindSafe for TychoStreamBuilder
impl Send for TychoStreamBuilder
impl Sync for TychoStreamBuilder
impl Unpin for TychoStreamBuilder
impl UnsafeUnpin for TychoStreamBuilder
impl UnwindSafe for TychoStreamBuilder
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> 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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more