tycho_client/
lib.rs

1//! # Tycho Client
2//!
3//! This is the client implementation for the Tycho-Indexer, a high-performance indexing service.
4//!
5//! ## Snapshot+Updates Pattern
6//!
7//! The Tycho-Indexer expects clients to connect using the snapshot+deltas pattern. This approach
8//! aims to provide the most up-to-date and accurate state of data at any given point in time.
9//!
10//! The core concept is that the client first retrieves a "snapshot" of the current state of data
11//! from the server using the rpc methods. This snapshot may consist of any relevant data that
12//! is important for the client. After receiving the initial snapshot, the client then continually
13//! receives smaller delta updates, which represent changes or modifications made after the snapshot
14//! was taken.
15//!
16//! This pattern is efficient and reduces the load on both the client and server when dealing with
17//! large amounts of data. The client only needs to handle the heavy payload once (the snapshot),
18//! while subsequent updates are smaller and more manageable. It also ensures that the client always
19//! has the most recent version of the data without needing to poll or request it from the server
20//! constantly.
21//!
22//! The following modules implement the different parts of the client:
23//!
24//! - `rpc` module provides utilities for retrieving snapshots, and associated data such as tokens.
25//! - `updates` module handles receiving and processing updates messages from the server.
26const TYCHO_SERVER_VERSION: &str = "v1";
27
28pub mod cli;
29pub mod deltas;
30pub mod feed;
31pub mod rpc;
32pub mod stream;
33
34#[cfg(test)]
35#[macro_use]
36extern crate pretty_assertions;
37
38pub use deltas::{DeltasError, WsDeltasClient};
39pub use rpc::{HttpRPCClient, RPCError, SnapshotParameters};