http-relay

command module
v0.0.0-...-708f711 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0, MIT Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

drand HTTP relay

This repo is a complete rewrite of the HTTP relays that could initially be found in drand/drand repo to be a self-sufficient binary that connects to a (set of) drand node(s) and queries them in the provided order in case of errors (i.e. the latter ones in the list are fallbacks in case the first one is down.)

This is also conveniently implemented using Chi and Chi middleware, allowing us to easily provide local caching, authentication, rate-limiting based on authentication, and other features in the future as needed.

How to use the HTTP relays

Ideally a drand v2 node should only talk gRPC. Therefore, this repo replaces the --public-listen flag from drand to allow to serve drand beacons over HTTP.

The relay connect to a drand node (or multiple) using gRPC, and then proceed to query beacons from these nodes to serve them over HTTP. The relay are also in charge of properly setting the Cache-Control headers for beacons, to allow for optimal caching and CDN usage for serving beacons.

Typically usage, assuming you have a drand node running as:

drand start --private-listen 0.0.0.0:443 --public-listen 0.0.0.0:8080 --verbose

You can replace the --public-listen 0.0.0.0:8080 flag with this relay by running:

make
./drand-relay-http --grpc-connect "127.0.0.1:443" --bind 0.0.0.0:8080 --verbose --metrics 127.0.0.1:9992

the --verbose and --metrics flags are optional, especially the --verbose one since it exposes DEBUG level gRPC logs.


License

This project is licensed using the Permissive License Stack which means that all contributions are available under the most permissive commonly-used licenses, and dependent projects can pick the license that best suits them.

Therefore, the project is dual-licensed under Apache 2.0 and MIT terms:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址