bcm

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultValidatorsWindowSize = 10

Blocks to average validator power over

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

type Blockchain struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func DecodeBlockchain

func DecodeBlockchain(encodedState []byte) (*Blockchain, error)

func LoadOrNewBlockchain

func LoadOrNewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc, logger *logging.Logger) (*Blockchain, error)

func (*Blockchain) AppHashAfterLastBlock

func (bc *Blockchain) AppHashAfterLastBlock() []byte

func (*Blockchain) ChainID

func (bc *Blockchain) ChainID() string

func (*Blockchain) CommitBlock

func (bc *Blockchain) CommitBlock(blockTime time.Time,
	blockHash, appHash []byte) (totalPowerChange, totalFlow *big.Int, err error)

func (*Blockchain) CurrentValidators

func (bc *Blockchain) CurrentValidators() *validator.Set

func (*Blockchain) Encode

func (bc *Blockchain) Encode() ([]byte, error)

func (*Blockchain) GenesisDoc

func (bc *Blockchain) GenesisDoc() genesis.GenesisDoc

func (*Blockchain) GenesisHash

func (bc *Blockchain) GenesisHash() []byte

func (*Blockchain) LastBlockHash

func (bc *Blockchain) LastBlockHash() []byte

func (*Blockchain) LastBlockHeight

func (bc *Blockchain) LastBlockHeight() uint64

func (*Blockchain) LastBlockTime

func (bc *Blockchain) LastBlockTime() time.Time

func (*Blockchain) LastCommitTime added in v0.20.1

func (bc *Blockchain) LastCommitTime() time.Time

func (*Blockchain) NumValidators

func (bc *Blockchain) NumValidators() int

func (*Blockchain) PendingValidators

func (bc *Blockchain) PendingValidators() validator.IterableReader

func (*Blockchain) PreviousValidators

func (bc *Blockchain) PreviousValidators(delay int) *validator.Set

func (*Blockchain) ValidatorChecker

func (bc *Blockchain) ValidatorChecker() validator.Writer

func (*Blockchain) ValidatorWriter

func (bc *Blockchain) ValidatorWriter() validator.Writer

func (*Blockchain) Validators

func (bc *Blockchain) Validators() validator.IterableReader

func (*Blockchain) ValidatorsHistory

func (bc *Blockchain) ValidatorsHistory() (*validator.Set, []*validator.Set, uint64)

type BlockchainInfo

type BlockchainInfo interface {
	GenesisHash() []byte
	GenesisDoc() genesis.GenesisDoc
	ChainID() string
	LastBlockHeight() uint64
	LastBlockTime() time.Time
	LastCommitTime() time.Time
	LastBlockHash() []byte
	AppHashAfterLastBlock() []byte
	Validators() validator.IterableReader
	ValidatorsHistory() (currentSet *validator.Set, deltas []*validator.Set, height uint64)
	NumValidators() int
}

type PersistedState

type PersistedState struct {
	AppHashAfterLastBlock []byte
	LastBlockHeight       uint64
	GenesisDoc            genesis.GenesisDoc
	ValidatorSet          []validator.Validator
	ValidatorCache        validator.PersistedRing
}

Jump to

Keyboard shortcuts

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