Documentation
¶
Overview ¶
Package api implements the random beacon API.
Index ¶
Constants ¶
View Source
const ( // ModuleName is a unique module name for the beacon module. ModuleName = "beacon" // BeaconSize is the size of the beacon in bytes. BeaconSize = 32 )
Variables ¶
View Source
var ErrBeaconNotAvailable = errors.New(ModuleName, 1, "beacon: random beacon not available")
ErrBeaconNotAvailable is the error returned when a beacon is not available for the requested height for any reason.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// GetBeacon gets the beacon for the provided block height.
// Calling this method with height `0`, should return the
// beacon for latest finalized block.
GetBeacon(context.Context, int64) ([]byte, error)
// StateToGenesis returns the genesis state at specified block height.
StateToGenesis(context.Context, int64) (*Genesis, error)
}
Backend is a random beacon implementation.
type ConsensusParameters ¶
type ConsensusParameters struct {
// DebugDeterministic is true iff the output should be deterministic.
DebugDeterministic bool `json:"debug_deterministic,omitempty"`
}
ConsensusParameters are the beacon consensus parameters.
type Genesis ¶
type Genesis struct {
// Parameters are the beacon consensus parameters.
Parameters ConsensusParameters `json:"params"`
}
Genesis is the beacon genesis state.
func (*Genesis) SanityCheck ¶
SanityCheck does basic sanity checking on the genesis state.
Click to show internal directories.
Click to hide internal directories.