rolldpos

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: Apache-2.0 Imports: 3 Imported by: 4 modules, 14 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ProtocolID = "rolldpos"

ProtocolID is the identity of this protocol

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

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

Protocol defines an epoch protocol

func NewProtocol

func NewProtocol(numCandidateDelegates uint64, numDelegates uint64, numSubEpochs uint64) *Protocol

NewProtocol returns a new rolldpos protocol

func (*Protocol) GetEpochHeight

func (p *Protocol) GetEpochHeight(epochNum uint64) uint64

GetEpochHeight returns the start height of an epoch

func (*Protocol) GetEpochLastBlockHeight

func (p *Protocol) GetEpochLastBlockHeight(epochNum uint64) uint64

GetEpochLastBlockHeight returns the last height of an epoch

func (*Protocol) GetEpochNum

func (p *Protocol) GetEpochNum(height uint64) uint64

GetEpochNum returns the number of the epoch for a given height

func (*Protocol) GetSubEpochNum

func (p *Protocol) GetSubEpochNum(height uint64) uint64

GetSubEpochNum returns the sub epoch number of a block height

func (*Protocol) Handle

Handle handles a modification

func (*Protocol) NumCandidateDelegates

func (p *Protocol) NumCandidateDelegates() uint64

NumCandidateDelegates returns the number of delegate candidates for an epoch

func (*Protocol) NumDelegates

func (p *Protocol) NumDelegates() uint64

NumDelegates returns the number of delegates in an epoch

func (*Protocol) NumSubEpochs

func (p *Protocol) NumSubEpochs() uint64

NumSubEpochs returns the number of sub-epochs in an epoch

func (*Protocol) ReadState

func (p *Protocol) ReadState(context.Context, protocol.StateManager, []byte, ...[]byte) ([]byte, error)

ReadState read the state on blockchain via protocol

func (*Protocol) Validate

func (p *Protocol) Validate(context.Context, action.Action) error

Validate validates a modification

Jump to

Keyboard shortcuts

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