fabric: github.com/hyperledger/fabric/core/committer Index | Files | Directories

package committer

import "github.com/hyperledger/fabric/core/committer"


Package Files

committer.go committer_impl.go

type Committer Uses

type Committer interface {

    // CommitLegacy block and private data into the ledger
    CommitLegacy(blockAndPvtData *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error

    // GetPvtDataAndBlockByNum retrieves block with private data with given
    // sequence number
    GetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error)

    // GetPvtDataByNum returns a slice of the private data from the ledger
    // for given block and based on the filter which indicates a map of
    // collections and namespaces of private data to retrieve
    GetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)

    // Get recent block sequence number
    LedgerHeight() (uint64, error)

    // DoesPvtDataInfoExistInLedger returns true if the ledger has pvtdata info
    // about a given block number.
    DoesPvtDataInfoExistInLedger(blockNum uint64) (bool, error)

    // Gets blocks with sequence numbers provided in the slice
    GetBlocks(blockSeqs []uint64) []*common.Block

    // GetConfigHistoryRetriever returns the ConfigHistoryRetriever
    GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)

    // CommitPvtDataOfOldBlocks commits the private data corresponding to already committed block
    // If hashes for some of the private data supplied in this function does not match
    // the corresponding hash present in the block, the unmatched private data is not
    // committed and instead the mismatch inforation is returned back
    CommitPvtDataOfOldBlocks(reconciledPvtdata []*ledger.ReconciledPvtdata) ([]*ledger.PvtdataHashMismatch, error)

    // GetMissingPvtDataTracker return the MissingPvtDataTracker
    GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)

    // Closes committing service

Committer is the interface supported by committers The only committer is noopssinglechain committer. The interface is intentionally sparse with the sole aim of "leave-everything-to-the-committer-for-now". As we solidify the bootstrap process and as we add more support (such as Gossip) this interface will change

type LedgerCommitter Uses

type LedgerCommitter struct {

LedgerCommitter is the implementation of Committer interface it keeps the reference to the ledger to commit blocks and retrieve chain information

func NewLedgerCommitter Uses

func NewLedgerCommitter(ledger PeerLedgerSupport) *LedgerCommitter

NewLedgerCommitter is a factory function to create an instance of the committer which passes incoming blocks via validation and commits them into the ledger.

func (*LedgerCommitter) CommitLegacy Uses

func (lc *LedgerCommitter) CommitLegacy(blockAndPvtData *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error

CommitLegacy commits blocks atomically with private data

func (*LedgerCommitter) DoesPvtDataInfoExistInLedger Uses

func (lc *LedgerCommitter) DoesPvtDataInfoExistInLedger(blockNum uint64) (bool, error)

DoesPvtDataInfoExistInLedger returns true if the ledger has pvtdata info about a given block number.

func (*LedgerCommitter) GetBlocks Uses

func (lc *LedgerCommitter) GetBlocks(blockSeqs []uint64) []*common.Block

GetBlocks used to retrieve blocks with sequence numbers provided in the slice

func (*LedgerCommitter) GetPvtDataAndBlockByNum Uses

func (lc *LedgerCommitter) GetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error)

GetPvtDataAndBlockByNum retrieves private data and block for given sequence number

func (*LedgerCommitter) LedgerHeight Uses

func (lc *LedgerCommitter) LedgerHeight() (uint64, error)

LedgerHeight returns recently committed block sequence number

type PeerLedgerSupport Uses

type PeerLedgerSupport interface {
    GetPvtDataAndBlockByNum(blockNum uint64, filter ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error)

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

    CommitLegacy(blockAndPvtdata *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error

    CommitPvtDataOfOldBlocks(reconciledPvtdata []*ledger.ReconciledPvtdata) ([]*ledger.PvtdataHashMismatch, error)

    GetBlockchainInfo() (*common.BlockchainInfo, error)

    DoesPvtDataInfoExist(blockNum uint64) (bool, error)

    GetBlockByNumber(blockNumber uint64) (*common.Block, error)

    GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)

    GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)


PeerLedgerSupport abstract out the API's of ledger.PeerLedger interface required to implement LedgerCommitter



Package committer imports 3 packages (graph) and is imported by 39 packages. Updated 2019-11-25. Refresh now. Tools for package owners.