ledgerstorage

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider encapusaltes two providers 1) block store provider and 2) and pvt data store provider

func NewProvider

func NewProvider() *Provider

NewProvider returns the handle to the provider

func (*Provider) Close

func (p *Provider) Close()

Close closes the provider

func (*Provider) Open

func (p *Provider) Open(ledgerid string) (*Store, error)

Open opens the store

type Store

type Store struct {
	blkstorage.BlockStore
	// contains filtered or unexported fields
}

Store encapsulates two stores 1) block store and pvt data store

func (*Store) CommitWithPvtData

func (s *Store) CommitWithPvtData(blockAndPvtdata *ledger.BlockAndPvtData) error

CommitWithPvtData commits the block and the corresponding pvt data in an atomic operation

func (*Store) GetPvtDataAndBlockByNum

func (s *Store) GetPvtDataAndBlockByNum(blockNum uint64, filter ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error)

GetPvtDataAndBlockByNum returns the block and the corresponding pvt data. The pvt data is filtered by the list of 'collections' supplied

func (*Store) GetPvtDataByNum

func (s *Store) GetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)

GetPvtDataByNum returns only the pvt data corresponding to the given block number The pvt data is filtered by the list of 'ns/collections' supplied in the filter A nil filter does not filter any results

func (*Store) Init added in v1.2.0

func (s *Store) Init(btlPolicy pvtdatapolicy.BTLPolicy)

Init initializes store with essential configurations

Source Files

  • store.go

Jump to

Keyboard shortcuts

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