Versions in this module Expand all Collapse all v0 v0.1.0 Dec 10, 2018 Changes in this version + const BlockchainChannel + var ErrBlockIsNil = errors.New("the chain has no block data") + var ErrBranchNameUsed = errors.New("blockchain:branch name has been used") + var ErrConvertToFuture = errors.New("can't revert to future height") + var ErrNotFound = errors.New("leveldb not found") + var ErrRevertBackup = errors.New("revert from backup,not find data") + func BlockStoreDB(config *cfg.Viper) (dbm.DB, dbm.DB) + func LoadBlockStore(blockStoreDB, blockArchiveDB dbm.DB, height def.INT) (*pbtypes.Block, *pbtypes.BlockMeta, *pbtypes.BlockID) + type BlockExecuterFunc func(*agtypes.BlockCache, *agtypes.PartSet, *agtypes.CommitCache) error + type BlockPool struct + func NewBlockPool(logger *zap.Logger, start def.INT, requestsCh chan<- BlockRequest, ...) *BlockPool + func (pool *BlockPool) AddBlock(peerID string, block *pbtypes.Block, blockSize int) + func (pool *BlockPool) GetStatus() (height def.INT, numPending int32, lenRequesters int) + func (pool *BlockPool) IsCaughtUp() bool + func (pool *BlockPool) OnStart() error + func (pool *BlockPool) OnStop() + func (pool *BlockPool) PeekTwoBlocks() (first *agtypes.BlockCache, second *agtypes.BlockCache) + func (pool *BlockPool) PopRequest() + func (pool *BlockPool) RedoRequest(height def.INT) + func (pool *BlockPool) RemovePeer(peerID string) + func (pool *BlockPool) SetPeerHeight(peerID string, height def.INT) + type BlockRequest struct + Height def.INT + PeerID string + type BlockStore struct + func NewBlockStore(db, archiveDB dbm.DB) *BlockStore + func (bs *BlockStore) DeleteBlock(height def.INT) (err error) + func (bs *BlockStore) Height() def.INT + func (bs *BlockStore) LoadBlock(height def.INT) *agtypes.BlockCache + func (bs *BlockStore) LoadBlockCommit(height def.INT) *agtypes.CommitCache + func (bs *BlockStore) LoadBlockMeta(height def.INT) *pbtypes.BlockMeta + func (bs *BlockStore) LoadBlockPart(height def.INT, index int) *pbtypes.Part + func (bs *BlockStore) LoadSeenCommit(height def.INT) *agtypes.CommitCache + func (bs *BlockStore) OriginHeight() def.INT + func (bs *BlockStore) SaveBlock(block *agtypes.BlockCache, blockParts *agtypes.PartSet, ...) + func (bs *BlockStore) SaveBlockToArchive(height def.INT, block *agtypes.BlockCache, blockParts *agtypes.PartSet, ...) + func (bs *BlockStore) SetOriginHeight(height def.INT) + type BlockStoreStateJSON struct + Height def.INT + OriginHeight def.INT + func LoadBlockStoreStateJSON(db dbm.DB) BlockStoreStateJSON + func (bsj BlockStoreStateJSON) Save(db dbm.DB) + func (bsj BlockStoreStateJSON) SaveByKey(key []byte, db dbm.DB) + type BlockVerifierFunc func(pbtypes.BlockID, def.INT, *agtypes.CommitCache) error + type BlockchainReactor struct + func NewBlockchainReactor(logger *zap.Logger, config *viper.Viper, lastBlockHeight def.INT, ...) *BlockchainReactor + func (bcR *BlockchainReactor) AddPeer(peer *p2p.Peer) + func (bcR *BlockchainReactor) BlockArchive() + func (bcR *BlockchainReactor) BroadcastStatusRequest() error + func (bcR *BlockchainReactor) BroadcastStatusResponse() error + func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor + func (bcR *BlockchainReactor) OnStart() error + func (bcR *BlockchainReactor) OnStop() + func (bcR *BlockchainReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte) + func (bcR *BlockchainReactor) RemovePeer(peer *p2p.Peer, reason interface{}) + func (bcR *BlockchainReactor) SetBlockExecuter(x BlockExecuterFunc) + func (bcR *BlockchainReactor) SetBlockVerifier(v BlockVerifierFunc) + func (bcR *BlockchainReactor) SetEventSwitch(evsw agtypes.EventSwitch) + type NonEmptyBlockIterator struct + func NewNonEmptyBlockIterator(store *BlockStore) *NonEmptyBlockIterator + func (i *NonEmptyBlockIterator) HasMore() bool + func (i *NonEmptyBlockIterator) Next() *agtypes.BlockCache + type StoreTool struct + func (st *StoreTool) BackupLastBlock(branchName string) error + func (st *StoreTool) DelBackup(branchName string) + func (st *StoreTool) Init(config *cfg.Viper) error + func (st *StoreTool) LastHeight() def.INT + func (st *StoreTool) LoadBlock(height def.INT) (*pbtypes.Block, *pbtypes.BlockMeta, *pbtypes.BlockID) + func (st *StoreTool) RevertFromBackup(branchName string) error + func (st *StoreTool) SaveNewLastBlock(toHeight def.INT) error