iotex-core: github.com/iotexproject/iotex-core/action/protocol/rolldpos Index | Files

package rolldpos

import "github.com/iotexproject/iotex-core/action/protocol/rolldpos"

Index

Package Files

epoch.go

type Option Uses

type Option func(*Protocol) error

Option is optional setting for epoch protocol

func EnableDardanellesSubEpoch Uses

func EnableDardanellesSubEpoch(height, numSubEpochs uint64) Option

EnableDardanellesSubEpoch will set give numSubEpochs at give height.

type Protocol Uses

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

Protocol defines an epoch protocol

func FindProtocol Uses

func FindProtocol(registry *protocol.Registry) *Protocol

FindProtocol return a registered protocol from registry

func MustGetProtocol Uses

func MustGetProtocol(registry *protocol.Registry) *Protocol

MustGetProtocol return a registered protocol from registry

func NewProtocol Uses

func NewProtocol(numCandidateDelegates, numDelegates, numSubEpochs uint64, opts ...Option) *Protocol

NewProtocol returns a new rolldpos protocol

func (*Protocol) ForceRegister Uses

func (p *Protocol) ForceRegister(r *protocol.Registry) error

ForceRegister registers the protocol with a unique ID and force replacing the previous protocol if it exists

func (*Protocol) GetEpochHeight Uses

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

GetEpochHeight returns the start height of an epoch

func (*Protocol) GetEpochLastBlockHeight Uses

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

GetEpochLastBlockHeight returns the last height of an epoch

func (*Protocol) GetEpochNum Uses

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

GetEpochNum returns the number of the epoch for a given height

func (*Protocol) GetSubEpochNum Uses

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

GetSubEpochNum returns the sub epoch number of a block height

func (*Protocol) Handle Uses

func (p *Protocol) Handle(context.Context, action.Action, protocol.StateManager) (*action.Receipt, error)

Handle handles a modification

func (*Protocol) NumCandidateDelegates Uses

func (p *Protocol) NumCandidateDelegates() uint64

NumCandidateDelegates returns the number of delegate candidates for an epoch

func (*Protocol) NumDelegates Uses

func (p *Protocol) NumDelegates() uint64

NumDelegates returns the number of delegates in an epoch

func (*Protocol) NumSubEpochs Uses

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

NumSubEpochs returns the number of subEpochs given a block height

func (*Protocol) ReadState Uses

func (p *Protocol) ReadState(ctx context.Context, sm protocol.StateReader, method []byte, args ...[]byte) ([]byte, error)

ReadState read the state on blockchain via protocol

func (*Protocol) Register Uses

func (p *Protocol) Register(r *protocol.Registry) error

Register registers the protocol with a unique ID

func (*Protocol) Validate Uses

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

Validate validates a modification

Package rolldpos imports 6 packages (graph) and is imported by 7 packages. Updated 2019-12-06. Refresh now. Tools for package owners.