Documentation ¶
Index ¶
- type BlockKvDB
- func (b *BlockKvDB) BlockExists(blockHash []byte) (bool, error)
- func (b *BlockKvDB) Close()
- func (b *BlockKvDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error
- func (b *BlockKvDB) GetArchivedPivot() (uint64, error)
- func (b *BlockKvDB) GetBlock(height uint64) (*commonPb.Block, error)
- func (b *BlockKvDB) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
- func (b *BlockKvDB) GetBlockByTx(txId string) (*commonPb.Block, error)
- func (b *BlockKvDB) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
- func (b *BlockKvDB) GetFilteredBlock(height uint64) (*storePb.SerializedBlock, error)
- func (b *BlockKvDB) GetHeightByHash(blockHash []byte) (uint64, error)
- func (b *BlockKvDB) GetLastBlock() (*commonPb.Block, error)
- func (b *BlockKvDB) GetLastConfigBlock() (*commonPb.Block, error)
- func (b *BlockKvDB) GetLastSavepoint() (uint64, error)
- func (b *BlockKvDB) GetTx(txId string) (*commonPb.Transaction, error)
- func (b *BlockKvDB) GetTxConfirmedTime(txId string) (int64, error)
- func (b *BlockKvDB) GetTxHeight(txId string) (uint64, error)
- func (b *BlockKvDB) GetTxWithBlockInfo(txId string) (*commonPb.TransactionInfo, error)
- func (b *BlockKvDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
- func (b *BlockKvDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error
- func (b *BlockKvDB) ShrinkBlocks(startHeight uint64, endHeight uint64) (map[uint64][]string, error)
- func (b *BlockKvDB) TxArchived(txId string) (bool, error)
- func (b *BlockKvDB) TxExists(txId string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockKvDB ¶
BlockKvDB provider a implementation of `blockdb.BlockDB` This implementation provides a key-value based data model
func NewBlockKvDB ¶
func (*BlockKvDB) BlockExists ¶
BlockExists returns true if the block hash exist, or returns false if none exists.
func (*BlockKvDB) CommitBlock ¶
func (b *BlockKvDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error
CommitBlock commits the block and the corresponding rwsets in an atomic operation
func (*BlockKvDB) GetArchivedPivot ¶
GetArchivedPivot return archived pivot
func (*BlockKvDB) GetBlock ¶
GetBlock returns a block given it's block height, or returns nil if none exists.
func (*BlockKvDB) GetBlockByHash ¶
GetBlockByHash returns a block given it's hash, or returns nil if none exists.
func (*BlockKvDB) GetBlockByTx ¶
GetBlockByTx returns a block which contains a tx.
func (*BlockKvDB) GetBlockHeaderByHeight ¶
func (b *BlockKvDB) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
GetBlockHeaderByHeight returns a block header by given it's height, or returns nil if none exists.
func (*BlockKvDB) GetFilteredBlock ¶
func (b *BlockKvDB) GetFilteredBlock(height uint64) (*storePb.SerializedBlock, error)
GetFilteredBlock returns a filtered block given it's block height, or return nil if none exists.
func (*BlockKvDB) GetHeightByHash ¶
GetHeightByHash returns a block height given it's hash, or returns nil if none exists.
func (*BlockKvDB) GetLastBlock ¶
GetLastBlock returns the last block.
func (*BlockKvDB) GetLastConfigBlock ¶
GetLastConfigBlock returns the last config block.
func (*BlockKvDB) GetLastSavepoint ¶
GetLastSavepoint reurns the last block height
func (*BlockKvDB) GetTx ¶
func (b *BlockKvDB) GetTx(txId string) (*commonPb.Transaction, error)
GetTx retrieves a transaction by txid, or returns nil if none exists.
func (*BlockKvDB) GetTxConfirmedTime ¶
GetTxConfirmedTime returns the confirmed time of a given tx
func (*BlockKvDB) GetTxHeight ¶
GetTxHeight retrieves a transaction height by txid, or returns nil if none exists.
func (*BlockKvDB) GetTxWithBlockInfo ¶
func (b *BlockKvDB) GetTxWithBlockInfo(txId string) (*commonPb.TransactionInfo, error)
func (*BlockKvDB) InitGenesis ¶
func (b *BlockKvDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
func (*BlockKvDB) RestoreBlocks ¶
func (b *BlockKvDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error
RestoreBlocks restore block data from outside to kvdb: txid--SerializedTx
func (*BlockKvDB) ShrinkBlocks ¶
ShrinkBlocks remove ranged txid--SerializedTx from kvdb
func (*BlockKvDB) TxArchived ¶
TxArchived returns true if the tx archived, or returns false.