Documentation ¶
Index ¶
Constants ¶
View Source
const ( IndexableAttrBlockNum = IndexableAttr("BlockNum") IndexableAttrBlockHash = IndexableAttr("BlockHash") IndexableAttrTxID = IndexableAttr("TxID") IndexableAttrBlockNumTranNum = IndexableAttr("BlockNumTranNum") IndexableAttrBlockTxID = IndexableAttr("BlockTxID") IndexableAttrTxValidationCode = IndexableAttr("TxValidationCode") )
可索引属性的常量
Variables ¶
View Source
var ( //errnotfoundinindex用于指示索引中缺少条目。 ErrNotFoundInIndex = l.NotFoundInIndexErr("") //ErratrNotIndexed用于指示未对属性进行索引 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) (ledger.ResultsIterator, error) RetrieveBlockByHash(blockHash []byte) (*common.Block, error) RetrieveBlockByNumber(blockNum uint64) (*common.Block, error) //math.maxuint64的blocknum将返回最后一个块 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-用于持久化和检索块的接口 此接口的实现应采用参数 'indexconfig'类型,用于配置应为哪些项编制索引的块存储
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提供Blockstore的句柄
type IndexConfig ¶
type IndexConfig struct {
AttrsToIndex []IndexableAttr
}
indexconfig-包含应索引的属性列表的配置
Click to show internal directories.
Click to hide internal directories.