get_hypersync_block_height_with_retries

Documentation for eth_defi.hypersync.hypersync_timestamp.get_hypersync_block_height_with_retries function.

get_hypersync_block_height_with_retries(client, attempts=3, retry_sleep=30, reason='block-height-check')

Get latest Hypersync block height with retry/backoff.

Hypersync height checks are one-shot API calls and can hit the same 429 rate limits as streams. Use this helper when a caller needs a height check before opening a stream.

Parameters
  • client (hypersync.HypersyncClient) – Hypersync client.

  • attempts (int) – Maximum number of attempts before raising the last HypersyncFlaky.

  • retry_sleep (int) – Sleep time between attempts, in seconds.

  • reason (str) – Human-readable operation label for logs.

Returns

Latest block number known to Hypersync.

Return type

int