blockchain

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOrNewBlockchain added in v0.18.0

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

func NewRoot added in v0.18.0

func NewRoot(genesisDoc *genesis.GenesisDoc) *root

func NewTip added in v0.18.0

func NewTip(chainID string, genesisTime time.Time, genesisHash []byte) *tip

Create genesis Tip

Types

type Blockchain added in v0.18.0

type Blockchain interface {
	// Read locker
	sync.Locker
	Root
	Tip
	// Returns an immutable copy of the tip
	Tip() Tip
	// Returns a copy of the current validator set
	Validators() []acm.Validator
}

Burrow's portion of the Blockchain state

type MutableBlockchain added in v0.18.0

type MutableBlockchain interface {
	Blockchain
	CommitBlock(blockTime time.Time, blockHash, appHash []byte) error
}

type PersistedState added in v0.18.0

type PersistedState struct {
	AppHashAfterLastBlock []byte
	LastBlockHeight       uint64
	GenesisDoc            genesis.GenesisDoc
}

func Decode added in v0.18.0

func Decode(encodedState []byte) (*PersistedState, error)

type Root added in v0.18.0

type Root interface {
	// GenesisHash precomputed from GenesisDoc
	GenesisHash() []byte
	GenesisDoc() genesis.GenesisDoc
}

Immutable Root of blockchain

type Tip added in v0.18.0

type Tip interface {
	// ChainID precomputed from GenesisDoc
	ChainID() string
	// All Last* references are to the block last committed
	LastBlockHeight() uint64
	LastBlockTime() time.Time
	LastBlockHash() []byte
	// Note this is the hash of the application state after the most recently committed block's transactions executed
	// and so lastBlock.Header.AppHash will be one block older than our AppHashAfterLastBlock (i.e. Tendermint closes
	// the AppHash we return from ABCI Commit into the _next_ block)
	AppHashAfterLastBlock() []byte
}

Immutable pointer to the current tip of the blockchain

Jump to

Keyboard shortcuts

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