@hiero-ledger/sdk
    Preparing search index...

    Class MirrorNodeHttpRetryPolicy

    How a mirror node REST call is retried and bounded.

    This is a value, not client state: it is resolved per call as package default, then the Client's policy, then any per-query setter, and is carried into the call by value. It is separate from the gRPC retry knobs on Client (maxAttempts, minBackoff, maxBackoff), which govern consensus node requests only and are never aliased onto HTTP.

    Every field has a default, and no construction path yields a partially defaulted instance: new MirrorNodeHttpRetryPolicy({ maxAttempts: 3 }) keeps every other field at its default. Derive a changed copy from an existing value with new MirrorNodeHttpRetryPolicy({ ...policy, maxAttempts: 3 }).

    On a loopback mirror base URL (localhost, 127.0.0.1) the package default is maxAttempts: 15 and totalDeadline: 90000, so a mirror node still starting under a local test harness is waited for. An explicit policy set on the client overrides that as it would anywhere else.

    Index

    Constructors

    • Parameters

      • Optionalprops: {
            initialBackoff?: number;
            maxAttempts?: number;
            maxBackoff?: number;
            perAttemptTimeout?: number;
            retryableStatusCodes?: readonly number[];
            totalDeadline?: number;
        } = {}
        • OptionalinitialBackoff?: number

          base of the exponential backoff in milliseconds, default 250. With full jitter the wait before retry n is drawn uniformly from [0, min(maxBackoff, initialBackoff * 2^n)), so this is not a floor.

        • OptionalmaxAttempts?: number

          attempts per request (one initial request plus up to maxAttempts - 1 retries), counted afresh for every page of a paginated call. Default 5, minimum 1.

        • OptionalmaxBackoff?: number

          cap on the computed backoff in milliseconds, default 8 s. A Retry-After header is bounded by the remaining total deadline instead, never by this.

        • OptionalperAttemptTimeout?: number

          bound on one attempt, end to end, in milliseconds. Default 30 s. 0 means no per-attempt cap; the total bound still applies.

        • OptionalretryableStatusCodes?: readonly number[]

          default [408, 429, 500, 502, 503, 504].

        • OptionaltotalDeadline?: number

          bound on the whole call, every page and every backoff included, in milliseconds. 0 (the default) inherits Client.requestTimeout.

      Returns MirrorNodeHttpRetryPolicy

    Properties

    initialBackoff: number
    maxAttempts: number
    maxBackoff: number
    perAttemptTimeout: number
    retryableStatusCodes: readonly number[]
    totalDeadline: number

    Accessors

    Methods

    • No value resolves to the DEFAULT instance itself, which is how a Client tells an unset policy from an explicit one.

      Parameters

      • value:
            | undefined
            | null
            | MirrorNodeHttpRetryPolicy
            | {
                initialBackoff?: number;
                maxAttempts?: number;
                maxBackoff?: number;
                perAttemptTimeout?: number;
                retryableStatusCodes?: readonly number[];
                totalDeadline?: number;
            }

      Returns MirrorNodeHttpRetryPolicy