Back to

Package grpc

Latest Go to latest

The highest tagged major version is .

Published: 5 days ago | Licenses: Apache-2.0 , MIT | Module:


Package grpc provides a drand client implementation that uses drand's gRPC API.

The client connects to a drand gRPC endpoint to fetch randomness. The gRPC client has some advantages over the HTTP client - it is more compact on-the-wire and supports streaming and authentication.


package main

import (


const (
	grpcAddr = "example.drand.grpc.server:4444"
	certPath = "/path/to/drand-grpc.cert"

var chainHash, _ = hex.DecodeString("8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce")

func main() {
	gc, err := grpc.New(grpcAddr, certPath, false)

	c, err := client.New(

A path to a file that holds TLS credentials for the drand server is required to validate server connections. Alternatively set the final parameter to `true` to enable _insecure_ connections (not recommended).


func New

func New(address, certPath string, insecure bool) (client.Client, error)

New creates a drand client backed by a GRPC connection.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier