beacon

package
v0.2103.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package beacon implements the combined beacon and epochtime application.

Index

Constants

View Source
const (
	// AppID is the unique application identifier.
	AppID uint8 = 0x40

	// AppName is the ABCI application name.
	// Run before all other applications.
	AppName string = "000_beacon"
)

Variables

View Source
var (
	// EventType is the ABCI event type for beacon/epoch events.
	EventType = api.EventTypeForApp(AppName)

	// QueryApp is the query for filtering events procecessed by the
	// beacon application.
	QueryApp = api.QueryForApp(AppName)

	// KeyEpoch is the ABCI event attribute for specifying the set epoch.
	KeyEpoch = []byte("epoch")

	// KeyBeacon is the ABCI event attribute key for the new beacons.
	KeyBeacon = []byte("beacon")

	// MethodSetEpoch is the method name for setting epochs.
	MethodSetEpoch = transaction.NewMethodName(AppName, "SetEpoch", beacon.EpochTime(0))

	// Methods is a list of all methods supported by the beacon application.
	Methods = []transaction.MethodName{
		MethodSetEpoch,
		beacon.MethodPVSSCommit,
		beacon.MethodPVSSReveal,
	}
)
View Source
var (
	DebugEntropyCtx = []byte("Ekb-Dumm")
	DebugEntropy    = []byte("If you change this, you will fuck up the byzantine tests!!")
)
View Source
var (
	// KeyDisableRuntimes is the ABCI event attribute for signaling
	// that runtimes should be disabled due to beacon failure.
	KeyDisableRuntimes = []byte("disable_runtimes")
)

Functions

func GetBeacon

func GetBeacon(epoch beacon.EpochTime, entropyCtx, entropy []byte) []byte

GetBeacon derives the actual beacon from the epoch and entropy source.

func New

func New() api.Application

New constructs a new beacon application instance.

Types

type Query

type Query interface {
	Beacon(context.Context) ([]byte, error)
	Epoch(context.Context) (beacon.EpochTime, int64, error)
	FutureEpoch(context.Context) (*beacon.EpochTimeState, error)
	Genesis(context.Context) (*beacon.Genesis, error)
	ConsensusParameters(context.Context) (*beacon.ConsensusParameters, error)

	PVSSState(context.Context) (*beacon.PVSSState, error)
}

Query is the beacon query interface.

type QueryFactory

type QueryFactory struct {
	// contains filtered or unexported fields
}

QueryFactory is the beacon query factory.

func NewQueryFactory

func NewQueryFactory(state abciAPI.ApplicationQueryState) *QueryFactory

NewQueryFactory returns a new QueryFactory backed by the given state instance.

func (*QueryFactory) QueryAt

func (sf *QueryFactory) QueryAt(ctx context.Context, height int64) (Query, error)

QueryAt returns the beacon query interface for a specific height.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL