Versions in this module Expand all Collapse all v3 v3.0.1 Dec 28, 2023 v3.0.0 Dec 23, 2022 Changes in this version + var DbType_Mysql = "mysql" + var DefaultOptions = &Options + var ErrBlockWrite = errors.New("write block wfile size invalidate") + var ErrClosed = errors.New("log closed") + var ErrCorrupt = errors.New("log corrupt") + var ErrInvalidateIndex = errors.New("invalidate rfile index") + var ErrNotFound = errors.New("not found") + var ErrOutOfOrder = errors.New("out of order") + func FileIndexToString(fiIndex *storePb.StoreInfo) string + type Batch struct + func (b *Batch) Write(index uint64, data []byte) + type BlockFile struct + func ImportOpen(opts *Options, logger protocol.Logger, meta meta.MetaData, height uint64) (*BlockFile, error) + func Open(path string, opts *Options, logger protocol.Logger, meta meta.MetaData) (*BlockFile, error) + func (l *BlockFile) ClearCache() error + func (l *BlockFile) Close() error + func (l *BlockFile) LastIndex() (index uint64, err error) + func (l *BlockFile) ReadFileSection(fiIndex *storePb.StoreInfo) ([]byte, error) + func (l *BlockFile) ReadLastSegSection(index uint64) (data []byte, fileName string, offset uint64, byteLen uint64, err error) + func (l *BlockFile) Sync() error + func (l *BlockFile) TruncateFront(index uint64) error + func (l *BlockFile) Write(index uint64, data []byte) (fileName string, offset, blkLen uint64, err error) + func (l *BlockFile) WriteBatch(b *Batch) (*storePb.StoreInfo, error) + type BlockFileDB struct + func NewBlockFileDB(chainId string, dbHandle protocol.DBHandle, logger protocol.Logger, ...) *BlockFileDB + func (b *BlockFileDB) BlockExists(blockHash []byte) (bool, error) + func (b *BlockFileDB) Close() + func (b *BlockFileDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error + func (b *BlockFileDB) CommitCache(blockInfo *serialization.BlockWithSerializedInfo) error + func (b *BlockFileDB) CommitDB(blockInfo *serialization.BlockWithSerializedInfo) error + func (b *BlockFileDB) ConfigBlockImport(block *commonPb.Block) error + func (b *BlockFileDB) GetArchivedPivot() (uint64, error) + func (b *BlockFileDB) GetBlock(height uint64) (*commonPb.Block, error) + func (b *BlockFileDB) GetBlockByHash(blockHash []byte) (*commonPb.Block, error) + func (b *BlockFileDB) GetBlockByTx(txId string) (*commonPb.Block, error) + func (b *BlockFileDB) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error) + func (b *BlockFileDB) GetBlockIndex(height uint64) (*storePb.StoreInfo, error) + func (b *BlockFileDB) GetBlockMeta(height uint64) (*storePb.SerializedBlock, error) + func (b *BlockFileDB) GetBlockMetaIndex(height uint64) (*storePb.StoreInfo, error) + func (b *BlockFileDB) GetFilteredBlock(height uint64) (*storePb.SerializedBlock, error) + func (b *BlockFileDB) GetHeightByHash(blockHash []byte) (uint64, error) + func (b *BlockFileDB) GetLastBlock() (*commonPb.Block, error) + func (b *BlockFileDB) GetLastConfigBlock() (*commonPb.Block, error) + func (b *BlockFileDB) GetLastConfigBlockHeight() (uint64, error) + func (b *BlockFileDB) GetLastSavepoint() (uint64, error) + func (b *BlockFileDB) GetTx(txId string) (*commonPb.Transaction, error) + func (b *BlockFileDB) GetTxConfirmedTime(txId string) (int64, error) + func (b *BlockFileDB) GetTxHeight(txId string) (uint64, error) + func (b *BlockFileDB) GetTxIndex(txId string) (*storePb.StoreInfo, error) + func (b *BlockFileDB) GetTxInfoOnly(txId string) (*storePb.TransactionStoreInfo, error) + func (b *BlockFileDB) GetTxWithBlockInfo(txId string) (*storePb.TransactionStoreInfo, error) + func (b *BlockFileDB) GetTxidSet() ([]protocol.Iterator, error) + func (b *BlockFileDB) ImportSetSavePoint(height uint64) error + func (b *BlockFileDB) ImportTxID(key, value []byte) error + func (b *BlockFileDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error + func (b *BlockFileDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error + func (b *BlockFileDB) ShrinkBlocks(startHeight uint64, endHeight uint64) (map[uint64][]string, error) + func (b *BlockFileDB) TxArchived(txId string) (bool, error) + func (b *BlockFileDB) TxExists(txId string) (bool, error) + type CRC uint32 + func NewCRC(b []byte) CRC + func (c CRC) Update(b []byte) CRC + func (c CRC) Value() uint32 + type Options struct + NoCopy bool + NoSync bool + SegmentCacheSize int + SegmentSize int + UseMmap bool