@hiveio/dhive
    Preparing search index...

    Class NodeHealthTracker

    Index
    • Get a snapshot of current health state for diagnostics.

      Returns Map<
          string,
          {
              apiFailures: Record<string, { count: number }>;
              consecutiveFailures: number;
              headBlock: number;
              healthy: boolean;
          },
      >

    • Return nodes ordered by health for a specific API call. Healthy nodes come first (preserving original order), then unhealthy nodes as fallback.

      Parameters

      • allNodes: string[]
      • Optionalapi: string

      Returns string[]

    • Check if a node is considered healthy for a given API.

      Parameters

      • node: string
      • Optionalapi: string

      Returns boolean

    • Check if a node is currently rate-limited (429 cooldown active).

      Parameters

      • node: string

      Returns boolean

    • Record an API/plugin-specific failure (e.g. "method not found", "plugin not enabled"). Only increments the per-API counter, NOT the global consecutive failure counter. This prevents a node with a disabled plugin from being penalized for all APIs.

      Parameters

      • node: string
      • api: string

      Returns void

    • Record a network-level failure (timeout, connection refused, HTTP error). Increments both the global consecutive failure counter and the API-specific counter.

      Parameters

      • node: string
      • api: string

      Returns void

    • Record that a node returned HTTP 429 (Too Many Requests). The node will be skipped until the rate limit expires.

      Parameters

      • node: string
      • OptionalretryAfterSeconds: number

        Value from the Retry-After header, or undefined to use default.

      Returns void

    • Record a successful call to a node for a specific API. Clears consecutive failure counter and API-specific failures for this API.

      Parameters

      • node: string
      • api: string

      Returns void

    • Reset all health tracking data.

      Returns void

    • Update head block number for a node. Called passively when get_dynamic_global_properties responses are observed.

      Parameters

      • node: string
      • headBlock: number

      Returns void