fabric: github.com/hyperledger/fabric/common/ledger/blockledger/fileledger Index | Files | Directories

package fileledger

import "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger"


Package Files

factory.go impl.go

func New Uses

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

New creates a new ledger factory

type FileLedger Uses

type FileLedger struct {
    // contains filtered or unexported fields

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

func NewFileLedger Uses

func NewFileLedger(blockStore FileLedgerBlockStore) *FileLedger

NewFileLedger creates a new FileLedger for interaction with the ledger

func (*FileLedger) Append Uses

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

Append a new block to the ledger

func (*FileLedger) Height Uses

func (fl *FileLedger) Height() uint64

Height returns the number of blocks on the ledger

func (*FileLedger) Iterator Uses

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 Uses

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


mockCode generated by counterfeiter.

Package fileledger imports 11 packages (graph) and is imported by 4 packages. Updated 2020-11-28. Refresh now. Tools for package owners.