Structure
EsploraBlockSource
A BlockSource backed by any Esplora-compatible HTTP endpoint — mempool.space, blockstream.info, or a self-hosted Esplora instance.
struct EsploraBlockSource
Mentioned In
Overview
Important
No endpoint is hard-coded as a default. Callers MUST provide one. The library ships convenience accessors for known public instances (see URL.mempoolSpaceSignet et al.), but the choice of which network to trust is an explicit caller decision — BitcoinKernel does not silently pick a block explorer on behalf of the user.
Pacing, retry, and rate-limiting
A per-instance RequestPacer actor ensures sequential requests stay at least minimumInterRequestDelay apart (default: 100 ms).
Failures with HTTP 5xx or 429 are retried up to maximumRetries times with exponential backoff (base = baseRetryDelay, doubling each time, capped at 2^6 × base).
When the server sends a Retry-After header on a 429 or 5xx response, the client honors it in preference to the exponential-backoff delay.
Transient network errors (timeouts, DNS failures, connection drops) are retried on the same policy.
Other non-2xx responses (e.g., 400, 403) fail immediately with BlockSourceError.invalidResponse(_:).
404 maps immediately to BlockSourceError.notFound without retry.
Hash orientation
Data hashes on this type are in internal (kernel) byte order, matching the BlockSource contract. Translation to Esplora’s display-hex format happens inside the implementation at the HTTP boundary.
Topics
Initializers
Instance Methods
Relationships
Conforms To