fileledger

package
v1.4.11 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0 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

func New

func New(directory string, metricsProvider metrics.Provider) blockledger.Factory

New creates a new ledger factory

Types

type FileLedger

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

FileLedger is a struct used to interact with a node's ledger

func NewFileLedger

func NewFileLedger(blockStore FileLedgerBlockStore) *FileLedger

NewFileLedger creates a new FileLedger for interaction with the ledger

func (*FileLedger) Append

func (fl *FileLedger) Append(block *cb.Block) error

Append a new block to the ledger

func (*FileLedger) Height

func (fl *FileLedger) Height() uint64

Height returns the number of blocks on the ledger

func (*FileLedger) Iterator

func (fl *FileLedger) Iterator(startPosition *ab.SeekPosition) (blockledger.Iterator, uint64)

Iterator returns an Iterator, as specified by an ab.SeekInfo message, and its starting block number

type FileLedgerBlockStore

type FileLedgerBlockStore interface {
	AddBlock(block *cb.Block) error
	GetBlockchainInfo() (*cb.BlockchainInfo, error)
	RetrieveBlocks(startBlockNumber uint64) (ledger.ResultsIterator, error)
}

FileLedgerBlockStore defines the interface to interact with deliver when using a file ledger

Jump to

Keyboard shortcuts

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