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§
Structs§
- Http
Client - HTTP Client for drand
Queries a specified HTTP endpoint given by
chain
, with specificoptions
By default, the client verifies answers, and caches retrieved chain informations