fsblkstorage

package
v0.0.0-...-bad8cef Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider() blkstorage.BlockStoreProvider

NewProvider constructs a filesystem based block store provider

Types

type BlockStoreImpl

type BlockStoreImpl struct {
	// contains filtered or unexported fields
}

func (*BlockStoreImpl) AddBlock

func (b *BlockStoreImpl) AddBlock(block *common.Block) error

func (*BlockStoreImpl) GetBlockchainInfo

func (b *BlockStoreImpl) GetBlockchainInfo() (*common.BlockchainInfo, error)

func (*BlockStoreImpl) RetrieveBlockByHash

func (b *BlockStoreImpl) RetrieveBlockByHash(blockHash []byte) (*common.Block, error)

func (*BlockStoreImpl) RetrieveBlockByNumber

func (b *BlockStoreImpl) RetrieveBlockByNumber(blockNum uint64) (*common.Block, error)

func (*BlockStoreImpl) RetrieveBlockByTxID

func (b *BlockStoreImpl) RetrieveBlockByTxID(txID string) (*common.Block, error)

func (*BlockStoreImpl) RetrieveBlocks

func (b *BlockStoreImpl) RetrieveBlocks(startNum uint64) (ledger.ResultsIterator, error)

func (*BlockStoreImpl) RetrieveTxByBlockNumTranNum

func (b *BlockStoreImpl) RetrieveTxByBlockNumTranNum(blockNum uint64, tranNum uint64) (*common.Envelope, error)

func (*BlockStoreImpl) RetrieveTxByID

func (b *BlockStoreImpl) RetrieveTxByID(txID string) (*common.Envelope, error)

func (*BlockStoreImpl) RetrieveTxValidationCodeByTxID

func (b *BlockStoreImpl) RetrieveTxValidationCodeByTxID(txID string) (peer.TxValidationCode, error)

func (*BlockStoreImpl) Shutdown

func (b *BlockStoreImpl) Shutdown()

type FsBlockstoreProvider

type FsBlockstoreProvider struct {
	// contains filtered or unexported fields
}

FsBlockstoreProvider provides handle to block storage - this is not thread-safe

func (*FsBlockstoreProvider) Close

func (p *FsBlockstoreProvider) Close()

Close closes the FsBlockstoreProvider

func (*FsBlockstoreProvider) CreateBlockStore

func (p *FsBlockstoreProvider) CreateBlockStore(ledgerid string) (blkstorage.BlockStore, error)

CreateBlockStore simply calls OpenBlockStore

func (*FsBlockstoreProvider) Exists

func (p *FsBlockstoreProvider) Exists(ledgerid string) (bool, error)

Exists tells whether the BlockStore with given id exists

func (*FsBlockstoreProvider) List

func (p *FsBlockstoreProvider) List() ([]string, error)

List lists the ids of the existing ledgers

func (*FsBlockstoreProvider) OpenBlockStore

func (p *FsBlockstoreProvider) OpenBlockStore(ledgerid string) (blkstorage.BlockStore, error)

OpenBlockStore opens a block store for given ledgerid. If a blockstore is not existing, this method creates one This method should be invoked only once for a particular ledgerid

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

func (Iterator) Close

func (i Iterator) Close()

func (Iterator) Next

func (i Iterator) Next() (ledger.QueryResult, error)

Jump to

Keyboard shortcuts

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