Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

drand state

Back to all declarations

MarginSeconds

int64

Value

30

SigHexLen

untyped bigint

Value

(128 <untyped> bigint)

maxList

untyped bigint

Value

(100 <untyped> bigint)

beacons

v0.Tree

// 8-byte big-endian round -> 64 hex chars (sha256 of the signature)

Open
OID
02b6ab…c6f7:4
beacons details

Inspect ref

latest

int64

// highest round verified here (0: none)

Value

0

provider

type

Value

drand.provider

target

func(now int64) int64

target is the first round published strictly after now+MarginSeconds. It returns 0 (core: "cannot bind now, retry later") when that round is not newer than a round already verified here: the block time is then behind wall clock by more than the margin (e.g. the first block after a halt) and the round may already be public.

Open
OID
02b6ab…c6f7:6
target details

Inspect func

TargetAt

func(unix int64) int64

TargetAt is the round a bind at block time unix would get, without the staleness check. For keepers and UIs.

Open
OID
02b6ab…c6f7:8
TargetAt details

Inspect func

TimeOf

func(round int64) int64

TimeOf is the unix time at which evmnet publishes round.

Open
OID
02b6ab…c6f7:9
TimeOf details

Inspect func

Submit

func(round int64, signature string) string

Submit verifies round's drand evmnet signature (hex, the "signature" field of [https://api.drand.sh/](https://api.drand.sh/)\<ChainHash>/public/\<round>) and stores its randomness. Permissionless; the caller is never trusted. A round already stored is a no-op (returns the stored value), so concurrent submitters never fail each other. Returns the randomness (64 hex characters).

Open
OID
02b6ab…c6f7:10
Submit details

Inspect func

Register

func() string

Register registers this provider with Sinopia core (once; anyone may send it). It stays inert until the admin approves it (timelocked randomness.add).

Open
OID
02b6ab…c6f7:11
Register details

Inspect func

Has

func(round int64) bool

Has reports whether round's randomness is stored here.

Open
OID
02b6ab…c6f7:12
Has details

Inspect func

Latest

func() int64

Latest is the highest round verified here (0 if none).

Open
OID
02b6ab…c6f7:13
Latest details

Inspect func

Info

func() string

Info returns the provider's parameters and state as JSON.

Open
OID
02b6ab…c6f7:14
Info details

Inspect func

Rounds

func(offset int64, limit int64) string

Rounds lists stored rounds, newest first, as "round:randomness" lines.

Open
OID
02b6ab…c6f7:15
Rounds details

Inspect func

Render

func(path string) string

Render shows the provider on gnoweb.

Open
OID
02b6ab…c6f7:16
Render details

Inspect func

key

func(round int64) string

key encodes round as 8 big-endian bytes so avl order is numeric order.

Open
OID
02b6ab…c6f7:17
key details

Inspect func
MarginSeconds : int64 =30
SigHexLen : untyped bigint =(128 <untyped> bigint)
maxList : untyped bigint =(100 <untyped> bigint)
beacons : v0.Tree Inspect
latest : int64 =0
provider : type =drand.provider
target : func(now int64) int64 Inspect
TargetAt : func(unix int64) int64 Inspect
TimeOf : func(round int64) int64 Inspect
Submit : func(round int64, signature string) string Inspect
Register : func() string Inspect
Has : func(round int64) bool Inspect
Latest : func() int64 Inspect
Info : func() string Inspect
Rounds : func(offset int64, limit int64) string Inspect
Render : func(path string) string Inspect
key : func(round int64) string Inspect
keyRound : func(k string) int64 Inspect
itoa : func(n int64) string Inspect