Documentation
¶
Overview ¶
Package blkstorage is a copy of github.com/hyperledger/fabric@v2.1.1 common/ledger/blkstorage. This avoids depending on the full Fabric module which has unresolvable CVEs and broken Go module paths.
Index ¶
Constants ¶
const ( IndexableAttrBlockNum = IndexableAttr("BlockNum") IndexableAttrBlockHash = IndexableAttr("BlockHash") IndexableAttrTxID = IndexableAttr("TxID") IndexableAttrBlockNumTranNum = IndexableAttr("BlockNumTranNum") )
constants for indexable attributes
Variables ¶
var ( // ErrNotFoundInIndex is used to indicate missing entry in the index ErrNotFoundInIndex = NotFoundInIndexErr("") // ErrAttrNotIndexed is used to indicate that an attribute is not indexed ErrAttrNotIndexed = errors.New("attribute not indexed") )
Functions ¶
This section is empty.
Types ¶
type BlockStore ¶
type BlockStore interface {
AddBlock(block *common.Block) error
GetBlockchainInfo() (*common.BlockchainInfo, error)
RetrieveBlocks(startNum uint64) (ResultsIterator, error)
RetrieveBlockByHash(blockHash []byte) (*common.Block, error)
RetrieveBlockByNumber(blockNum uint64) (*common.Block, error)
RetrieveTxByID(txID string) (*common.Envelope, error)
RetrieveTxByBlockNumTranNum(blockNum uint64, tranNum uint64) (*common.Envelope, error)
RetrieveBlockByTxID(txID string) (*common.Block, error)
RetrieveTxValidationCodeByTxID(txID string) (peer.TxValidationCode, error)
Shutdown()
}
BlockStore - an interface for persisting and retrieving blocks
type BlockStoreProvider ¶
type BlockStoreProvider interface {
CreateBlockStore(ledgerid string) (BlockStore, error)
OpenBlockStore(ledgerid string) (BlockStore, error)
Exists(ledgerid string) (bool, error)
List() ([]string, error)
Close()
}
BlockStoreProvider provides an handle to a BlockStore
type IndexConfig ¶
type IndexConfig struct {
AttrsToIndex []IndexableAttr
}
IndexConfig - a configuration that includes a list of attributes that should be indexed
func (*IndexConfig) Contains ¶
func (c *IndexConfig) Contains(indexableAttr IndexableAttr) bool
Contains returns true iff the supplied parameter is present in the IndexConfig.AttrsToIndex
type NotFoundInIndexErr ¶
type NotFoundInIndexErr string
NotFoundInIndexErr is used to indicate missing entry in the index. Copied from github.com/hyperledger/fabric@v2.1.1 core/ledger.
func (NotFoundInIndexErr) Error ¶
func (NotFoundInIndexErr) Error() string
type QueryResult ¶
type QueryResult interface{}
QueryResult - a general interface for supporting different types of query results.
type ResultsIterator ¶
type ResultsIterator interface {
Next() (QueryResult, error)
Close()
}
ResultsIterator - an iterator for query result set. Copied from github.com/hyperledger/fabric@v2.1.1 common/ledger.