Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

RPC Client Configuration

The ClientConfig struct controls how the RPC client connects to the provider and manages request behavior. In Python, configuration is done through ProviderConfig with ProviderKind.RPC.

Basic Configuration

Rust

#![allow(unused)]
fn main() {
use tiders_rpc_client::ClientConfig;

let config = ClientConfig::new("https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY");
}

Python

from tiders_core.ingest import ProviderConfig, ProviderKind

provider = ProviderConfig(
    kind=ProviderKind.RPC,
    url="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY",
)

Configuration Options

OptionTypeDefaultDescription
urlString(required)The JSON-RPC endpoint URL
bearer_tokenOption<String>NoneOptional bearer token for authentication
max_num_retriesu325000Maximum number of retries for a single RPC call
retry_backoff_msu641000Fixed per-retry delay in milliseconds (used by alloy’s RetryBackoffLayer)
retry_base_msu64300Base delay for exponential backoff (used by per-block retry loops)
retry_ceiling_msu6410000Maximum delay for exponential backoff (used by per-block retry loops)
req_timeout_millisu6430000Per-request HTTP timeout in milliseconds
compute_units_per_secondOption<u64>NoneCompute-unit rate limit for alloy’s RetryBackoffLayer
batch_sizeOption<usize>NoneInitial number of blocks per batch in simple pipeline mode; Response size (in blocks) in multi-pipeline mode (impact memory usage).
trace_methodOption<TraceMethod>NoneOverride the trace method (trace_block or debug_trace_block_by_number)
stop_on_headboolfalseStop the stream after reaching the chain head instead of entering live-polling mode
head_poll_interval_millisu641000How often to poll for new blocks during live mode, in milliseconds
buffer_sizeusize10Bounded channel capacity for the ArrowResponse stream
reorg_safe_distanceu640Number of blocks behind the head to stay, to avoid reorged data

Rust API Reference

See the ClientConfig rustdoc for all fields and methods.