Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Handle DRAND API outages #90

@bajtos

Description

@bajtos

See e35c089 and https://space-meridian.slack.com/archives/C06RPCL6QGL/p1724249441844879

DRAND provides several API endpoints; see https://drand.love/docs/http-api-reference:

Protocol Labs

We should implement a fallback to other API endpoints when the primary one is down.

A possibly better & easier alternative is to use FastestNodeClient, see drand-client docs:

// if you're happy to get randomness from many APIs and automatically use the fastest
// you can construct a `FastestNodeClient` with multiple URLs
// note: the randomness beacons are cryptographically verifiable, so as long as you fill
// in the `chainVerificationParams` in the options, you don't need to worry about malicious 
// providers sending you fake randomness!
const urls = [
    'https://api.drand.sh',
    'https://drand.cloudflare.com'
    // ...
]
const fastestNodeClient = new FastestNodeClient(urls, options)
// don't forget to start the client, or it won't periodically optimise for the fastest node!
fastestNodeClient.start()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    🗃 backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions