ar.ioar.io Documentation

Resiliency

Wayfinder includes built-in resiliency features:

  • Gateway retry: If a gateway returns a 5xx error or a network failure occurs, Wayfinder selects a gateway again and retries, up to 3 attempts in total. Each new selection passes the gateways that already failed as exclude, so the built-in strategies pick a different gateway when they have one: RandomRoutingStrategy and RoundRobinRoutingStrategy skip the failed gateways, FastestPingRoutingStrategy pings the failed gateways only when no other gateway answers, PreferredWithFallbackRoutingStrategy moves to its fallback, and SimpleCacheRoutingStrategy replaces a cached gateway that failed. When every gateway in the pool has already failed, these strategies return one of the failed gateways rather than throwing, so it is tried again. StaticRoutingStrategy has one gateway, so every attempt goes to it. A custom strategy that ignores exclude can return the same gateway again. Client errors (4xx) are returned immediately without retry.
  • Fetch timeouts: All outbound requests include configurable timeouts — 10s for metadata (HEAD, peer list), 30s for data retrieval — to prevent indefinite hangs on slow or dead gateways.
  • Gateway health checks: PingRoutingStrategy verifies the selected gateway responds before routing to it. If it does not, it selects again with that gateway excluded.
  • Peer list retries: TrustedPeersGatewaysProvider retries when a gateway returns an empty peer list, then fails loudly rather than silently yielding no gateways — and the default provider falls back to the trusted gateway so that failure degrades routing instead of stopping it.
  • Registry pagination failures are fatal: NetworkGatewaysProvider retries a failed page and throws once retries are exhausted, rather than returning a partial registry. Because limit is applied after sorting, a partial read would return the wrong gateways rather than merely fewer.
  • Full-registry pagination: NetworkGatewaysProvider reads the whole on-chain registry before applying limit, so limit selects the top-ranked gateways rather than whichever ones happened to come back first. It pages at the SDK maximum, so this is a single request for a registry of the current size.

How is this guide?