bcm

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block added in v0.24.0

type Block struct {
	*types.Block
	// contains filtered or unexported fields
}

func NewBlock added in v0.24.0

func NewBlock(txDecoder txs.Decoder, block *types.Block) *Block

func (*Block) Transactions added in v0.24.0

func (b *Block) Transactions(iter func(*txs.Envelope) (stop bool)) (stopped bool, err error)

type BlockStore added in v0.24.0

type BlockStore struct {
	state.BlockStoreRPC
	// contains filtered or unexported fields
}

func NewBlockExplorer added in v0.24.0

func NewBlockExplorer(dbBackendType db.DBBackendType, dbDir string) *BlockStore

func NewBlockStore added in v0.24.0

func NewBlockStore(blockStore state.BlockStoreRPC) *BlockStore

func (*BlockStore) Block added in v0.24.0

func (bs *BlockStore) Block(height int64) (_ *Block, err error)

func (*BlockStore) BlockMeta added in v0.24.0

func (bs *BlockStore) BlockMeta(height int64) (_ *types.BlockMeta, err error)

func (*BlockStore) Blocks added in v0.24.0

func (bs *BlockStore) Blocks(start, end int64, iter func(*Block) (stop bool)) (stopped bool, err error)

Iterate over blocks between start (inclusive) and end (exclusive)

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 NewBlockchain added in v0.23.3

func NewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc) *Blockchain

Pointer to blockchain state initialised from genesis

func (*Blockchain) AppHashAfterLastBlock

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

func (*Blockchain) BlockHash added in v0.24.0

func (bc *Blockchain) BlockHash(height uint64) []byte

func (*Blockchain) ChainID

func (bc *Blockchain) ChainID() string

func (*Blockchain) CommitBlock

func (bc *Blockchain) CommitBlock(blockTime time.Time, blockHash, appHash []byte) error

func (*Blockchain) CommitBlockAtHeight added in v0.23.3

func (bc *Blockchain) CommitBlockAtHeight(blockTime time.Time, blockHash, appHash []byte, height uint64) error

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) GetBlockHeader added in v0.24.0

func (bc *Blockchain) GetBlockHeader(height uint64) (*types.Header, error)

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) SetBlockStore added in v0.24.0

func (bc *Blockchain) SetBlockStore(bs *BlockStore)

type BlockchainInfo

type BlockchainInfo interface {
	GenesisHash() []byte
	GenesisDoc() genesis.GenesisDoc
	ChainID() string
	LastBlockHeight() uint64
	LastBlockTime() time.Time
	LastCommitTime() time.Time
	LastBlockHash() []byte
	AppHashAfterLastBlock() []byte
	// Gets the BlockHash at a height (or nil if no BlockStore mounted or block could not be found)
	BlockHash(height uint64) []byte
	// GetBlockHash returns	hash of the specific block
	GetBlockHeader(blockNumber uint64) (*types.Header, error)
}

type PersistedState

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

Jump to

Keyboard shortcuts

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