blkstorage

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

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-包含应索引的属性列表的配置

type IndexableAttr

type IndexableAttr string

indexableattr表示可索引属性

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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