blkstorage

package
v0.0.0-...-8b8b57d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

README

blkstorage

This is a copy of github.com/hyperledger/fabric@v2.1.1 block storage packages (common/ledger/blkstorage and common/ledger/blkstorage/fsblkstorage). This avoids depending on the full Fabric module which has unresolvable CVEs and broken Go module paths.

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

View Source
const (
	IndexableAttrBlockNum        = IndexableAttr("BlockNum")
	IndexableAttrBlockHash       = IndexableAttr("BlockHash")
	IndexableAttrTxID            = IndexableAttr("TxID")
	IndexableAttrBlockNumTranNum = IndexableAttr("BlockNumTranNum")
)

constants for indexable attributes

Variables

View Source
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 IndexableAttr

type IndexableAttr string

IndexableAttr represents an indexable attribute

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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