Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source pure

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be pu...

Readme View source

v0 - Unaudited This is an initial version of this package that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

poa

Package poa implements a Proof of Authority validator set management system with simple add/remove constraints.

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

Package poa implements a Proof of Authority validator set management system.

Variables 1

Functions 2

func WithInitialSet

1func WithInitialSet(validators []validators.Validator) Option
source

WithInitialSet sets the initial PoA validator set

func NewPoA

1func NewPoA(opts ...Option) *PoA
source

NewPoA creates a new empty Proof of Authority validator set

Types 2

type PoA

struct
1type PoA struct {
2	validators *bptree.BPTree // address -> validators.Validator
3}
source

PoA specifies the Proof of Authority validator set, with simple add / remove constraints.

To add: - proposed validator must not be part of the set already - proposed validator voting power must be > 0

To remove: - proposed validator must be part of the set already

Methods on PoA

func AddValidator

method on PoA
1func (p *PoA) AddValidator(address_XXX address, pubKey string, power uint64) (validators.Validator, error)
source

func GetValidator

method on PoA
1func (p *PoA) GetValidator(address_XXX address) (validators.Validator, error)
source

func GetValidators

method on PoA
1func (p *PoA) GetValidators() []validators.Validator
source

func IsValidator

method on PoA
1func (p *PoA) IsValidator(address_XXX address) bool
source

func RemoveValidator

method on PoA
1func (p *PoA) RemoveValidator(address_XXX address) (validators.Validator, error)
source

Imports 3

Source Files 6