Struct skar_client::Client
source · pub struct Client { /* private fields */ }Implementations§
source§impl Client
impl Client
sourcepub async fn create_parquet_folder(
&self,
query: Query,
path: String
) -> Result<()>
pub async fn create_parquet_folder( &self, query: Query, path: String ) -> Result<()>
Create a parquet file by executing a query.
If the query can’t be finished in a single request, this function will keep on making requests using the pagination mechanism (next_block) until it reaches the end. It will stream data into the parquet file as it comes from the server.
Path should point to a folder that will contain the parquet files in the end.
sourcepub async fn get_height(&self) -> Result<u64>
pub async fn get_height(&self) -> Result<u64>
Get the height of the source hypersync instance
sourcepub async fn get_height_with_retry(&self) -> Result<u64>
pub async fn get_height_with_retry(&self) -> Result<u64>
Get the height of the source hypersync instance Internally calls get_height. On an error from the source hypersync instance, sleeps for 1 second (increasing by 1 each failure up to max of 5 seconds) and retries query until success.
sourcepub async fn send<Format: TransportFormat>(
&self,
query: &Query
) -> Result<QueryResponse>
pub async fn send<Format: TransportFormat>( &self, query: &Query ) -> Result<QueryResponse>
Send a query request to the source hypersync instance.
Returns a query response which contains block, tx and log data. Format can be ArrowIpc or Parquet.
sourcepub async fn send_with_retry<Format: TransportFormat>(
&self,
query: &Query
) -> Result<QueryResponse>
pub async fn send_with_retry<Format: TransportFormat>( &self, query: &Query ) -> Result<QueryResponse>
Send a query request to the source hypersync instance. Internally calls send. On an error from the source hypersync instance, sleeps for 1 second (increasing by 1 each failure up to max of 5 seconds) and retries query until success.
Returns a query response which contains block, tx and log data. Format can be ArrowIpc or Parquet.