{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package committer\n\n## Types\n\n```go\ntype Committer interface {\n\n\t// CommitWithPvtData block and private data into the ledger\n\tCommitWithPvtData(blockAndPvtData *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error\n\n\t// GetPvtDataAndBlockByNum retrieves block with private data with given\n\t// sequence number\n\tGetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error)\n\n\t// GetPvtDataByNum returns a slice of the private data from the ledger\n\t// for given block and based on the filter which indicates a map of\n\t// collections and namespaces of private data to retrieve\n\tGetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)\n\n\t// Get recent block sequence number\n\tLedgerHeight() (uint64, error)\n\n\t// DoesPvtDataInfoExistInLedger returns true if the ledger has pvtdata info\n\t// about a given block number.\n\tDoesPvtDataInfoExistInLedger(blockNum uint64) (bool, error)\n\n\t// Gets blocks with sequence numbers provided in the slice\n\tGetBlocks(blockSeqs []uint64) []*common.Block\n\n\t// GetConfigHistoryRetriever returns the ConfigHistoryRetriever\n\tGetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)\n\n\t// CommitPvtDataOfOldBlocks commits the private data corresponding to already committed block\n\t// If hashes for some of the private data supplied in this function does not match\n\t// the corresponding hash present in the block, the unmatched private data is not\n\t// committed and instead the mismatch inforation is returned back\n\tCommitPvtDataOfOldBlocks(blockPvtData []*ledger.BlockPvtData) ([]*ledger.PvtdataHashMismatch, error)\n\n\t// GetMissingPvtDataTracker return the MissingPvtDataTracker\n\tGetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)\n\n\t// Closes committing service\n\tClose()\n}\n```\nCommitter 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\n\n```go\ntype ConfigBlockEventer func(block *common.Block) error\n```\nConfigBlockEventer callback function proto type to define action upon arrival on new configuaration update block\n\n```go\ntype LedgerCommitter struct {\n\tPeerLedgerSupport\n\t// contains filtered or unexported fields\n}\n```\nLedgerCommitter is the implementation of  Committer interface it keeps the reference to the ledger to commit blocks and retrieve chain information\n\n```go\nfunc NewLedgerCommitter(ledger PeerLedgerSupport) *LedgerCommitter\n```\nNewLedgerCommitter is a factory function to create an instance of the committer which passes incoming blocks via validation and commits them into the ledger.\n\n```go\nfunc NewLedgerCommitterReactive(ledger PeerLedgerSupport, eventer ConfigBlockEventer) *LedgerCommitter\n```\nNewLedgerCommitterReactive is a factory function to create an instance of the committer same as way as NewLedgerCommitter, while also provides an option to specify callback to be called upon new configuration block arrival and commit event\n\n```go\nfunc (lc *LedgerCommitter) CommitWithPvtData(blockAndPvtData *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error\n```\nCommitWithPvtData commits blocks atomically with private data\n\n```go\nfunc (lc *LedgerCommitter) DoesPvtDataInfoExistInLedger(blockNum uint64) (bool, error)\n```\nDoesPvtDataInfoExistInLedger returns true if the ledger has pvtdata info about a given block number.\n\n```go\nfunc (lc *LedgerCommitter) GetBlocks(blockSeqs []uint64) []*common.Block\n```\nGetBlocks used to retrieve blocks with sequence numbers provided in the slice\n\n```go\nfunc (lc *LedgerCommitter) GetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error)\n```\nGetPvtDataAndBlockByNum retrieves private data and block for given sequence number\n\n```go\nfunc (lc *LedgerCommitter) LedgerHeight() (uint64, error)\n```\nLedgerHeight returns recently committed block sequence number\n\n```go\ntype PeerLedgerSupport interface {\n\tGetPvtDataAndBlockByNum(blockNum uint64, filter ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error)\n\n\tGetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)\n\n\tCommitWithPvtData(blockAndPvtdata *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error\n\n\tCommitPvtDataOfOldBlocks(blockPvtData []*ledger.BlockPvtData) ([]*ledger.PvtdataHashMismatch, error)\n\n\tGetBlockchainInfo() (*common.BlockchainInfo, error)\n\n\tDoesPvtDataInfoExist(blockNum uint64) (bool, error)\n\n\tGetBlockByNumber(blockNumber uint64) (*common.Block, error)\n\n\tGetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)\n\n\tGetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)\n\n\tClose()\n}\n```\nPeerLedgerSupport abstract out the API's of ledger.PeerLedger interface required to implement LedgerCommitter\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/committer","name":"committer","synopsis":"","isRedistributable":true}
