Skip to content

The drand go cli (not the daemon)

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

drand/go-clients

Repository files navigation

go-clients is a Go client library and a set of useful binaries for the drand ecosystem

This repo contains most notably:

  • Go code for interfacing with the drand networks through both HTTP and Gossipsub
  • a client CLI tool to fetch and verify drand beacons from the various available sources in your terminal
  • a gossipsub relay to relay drand beacons on gossipsub

Migration from drand/drand

Prior to drand V2 release, the drand client code lived in the drand/drand repo. Since its V2 release, the drand daemon code aims at being more minimalist and having as few dependencies as possible. Most notably this meant removing the libp2p code that was exclusively used for Gossip relays and Gossip client, and also trimming down the amount of HTTP-related code.

From now on, this repo is meant to provide the Go Client code to interact with drand, query drand beacons and verify them through either the HTTP or the Gossip relays.

Note that drand does not provide public gRPC endpoints since ~2020, therefore the gRPC client code has been moved to the internal package of the relays (to allow relays to directly interface with a working daemon using gRPC).

There are relatively few changes to the public APIs of the client code and simply using the drand/go-clients/http packages should be enough. We recommend using go-doc to see the usage documentation and examples.

Most notable changes from the drand/drand V1 APIs

The Result interface now follows the Protobuf getter format:

Result.Round() -> Result.GetRound()
Result.Randomness() -> Result.GetRandomness()
Result.Signature() -> Result.GetSignature()
Result.PreviousSignature() -> Result.GetPreviousSignature()

meaning PublicRandResponse now satisfies directly the Result interface.

The HTTP client now returns a concrete type and doesn't need to be cast to a HTTP client to use e.g. SetUserAgent.

The client option WithVerifiedResult was renamed WithTrustedResult, to properly convey its function.

Note also that among other packages you might be using in the github.com/drand/drand/v2 packages, the crypto.GetSchemeByIDWithDefault function was renamed crypto.GetSchemeByID; and the Beacon struct now lives in the github.com/drand/drand/v2/common package rather than in the chain one.


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:

About

The drand go cli (not the daemon)

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published