Crate drand_core

Source
Expand description

§drand-core

drand-core is a library to retrieve public randomness generated by drand beacons. It features an HTTP client, and verification method.

The format specification is at drand.love/docs/specification. drand was designed in Scalable Bias-Resistant Distributed Randomness.

The reference interroperable Go implementation is available at drand/drand.

§Usage

use drand_core::HttpClient;

// Create a new client
let client: HttpClient = "https://drand.cloudflare.com".try_into().unwrap();

// Get the latest beacon. By default, it verifies its signature against the chain info.
let beacon = client.latest().unwrap();

// Print the beacon
println!("{:?}", beacon);

Re-exports§

pub use chain::ChainOptions;

Modules§

beacon
chain

Structs§

HttpClient
HTTP Client for drand Queries a specified HTTP endpoint given by chain, with specific options By default, the client verifies answers, and caches retrieved chain informations

Enums§

DrandError