Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Committee ¶
type Committee struct { // InstanceID holds the identifier of the dRAND instance. InstanceID uint32 // Threshold holds the threshold of the secret sharing protocol. Threshold uint8 // Identities holds the nodes' identities of the committee members. Identities []ed25519.PublicKey // DistributedPK holds the drand distributed public key. DistributedPK []byte }
Committee defines the current committee state of a DRNG instance.
type Option ¶
type Option func(*Options)
Option is a function which sets the given option.
func SetRandomness ¶
func SetRandomness(r *Randomness) Option
SetRandomness sets the initial randomness
type Options ¶
type Options struct { // The initial committee of the DRNG. Committee *Committee // The initial randomness of the DRNG. Randomness *Randomness }
Options define state options of a DRNG.
type Randomness ¶
type Randomness struct { // Round holds the current DRNG round. Round uint64 // Randomness holds the current randomness as a slice of bytes. Randomness []byte // Timestamp holds the timestamp when the current randomness was received. Timestamp time.Time }
Randomness defines the current randomness state of a DRNG instance.
func (Randomness) Float64 ¶
func (r Randomness) Float64() float64
Float64 returns a float64 [0.0,1.0) representation of the randomness byte slice.
type State ¶
type State struct {
// contains filtered or unexported fields
}
The state of the DRNG.
func (*State) Randomness ¶
func (s *State) Randomness() Randomness
Randomness returns the randomness of the DRNG state
func (*State) UpdateCommittee ¶
Update committee updates the committee of the DRNG state
func (*State) UpdateRandomness ¶
func (s *State) UpdateRandomness(r *Randomness)
UpdateRandomness updates the randomness of the DRNG state
Click to show internal directories.
Click to hide internal directories.