committer

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Committer

type Committer interface {

	//将私有数据块和私有数据提交到分类帐中
	CommitWithPvtData(blockAndPvtData *ledger.BlockAndPvtData) error

	//GetPvtDataAndBlockByNum使用给定的私有数据检索块
	//序列号
	GetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error)

	//getpvdtatabynum从分类帐返回一部分私有数据
	//对于给定的块并基于指示
	//要检索的私有数据的集合和命名空间
	GetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)

	//获取最近的块序列号
	LedgerHeight() (uint64, error)

	//获取切片中提供序列号的块
	GetBlocks(blockSeqs []uint64) []*common.Block

	//getconfigHistoryRetriever返回configHistoryRetriever
	GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)

	//commitpvtdataofoldblocks提交与已提交的块对应的私有数据
	//如果此函数中提供的某些私有数据的哈希不匹配
	//块中存在相应的哈希,不匹配的私有数据不是
	//提交并返回不匹配信息
	CommitPvtDataOfOldBlocks(blockPvtData []*ledger.BlockPvtData) ([]*ledger.PvtdataHashMismatch, error)

	//GetMissingPvtDataTracker返回MissingPvtDataTracker
	GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)

	//关闭提交服务
	Close()
}

committer是由committer支持的接口 唯一的提交者是noopsSingleChain提交者。 界面有意与鞋底稀疏 目标是“暂时把一切交给委员”。 当我们巩固引导过程和我们添加 更多支持(如八卦)此接口将 改变

type ConfigBlockEventer

type ConfigBlockEventer func(block *common.Block) error

要定义操作的configBlockEventer回调函数原型类型 到达新的配置更新块时

type LedgerCommitter

type LedgerCommitter struct {
	PeerLedgerSupport
	// contains filtered or unexported fields
}

LedgerCommitter是Committer接口的实现 它保持对分类帐的引用,以提交块并检索 链信息

func NewLedgerCommitter

func NewLedgerCommitter(ledger PeerLedgerSupport) *LedgerCommitter

newledgercommitter是一个工厂函数,用于创建committer的实例 它通过验证传递传入块并将其提交到分类帐中。

func NewLedgerCommitterReactive

func NewLedgerCommitterReactive(ledger PeerLedgerSupport, eventer ConfigBlockEventer) *LedgerCommitter

newledgercommitterreactive是一个工厂函数,用于创建提交者的实例 与newledgercommitter的方法相同,同时还提供了一个指定回调的选项 在新配置块到达并提交事件时调用

func (*LedgerCommitter) CommitWithPvtData

func (lc *LedgerCommitter) CommitWithPvtData(blockAndPvtData *ledger.BlockAndPvtData) error

COMMITTHPVTData使用私有数据自动提交块

func (*LedgerCommitter) GetBlocks

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

用于检索切片中提供序列号的块的GetBlocks

func (*LedgerCommitter) GetPvtDataAndBlockByNum

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

getpvtdata和blockbynum检索给定序列号的私有数据和块

func (*LedgerCommitter) LedgerHeight

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

LedgerHeight返回最近提交的块序列号

type PeerLedgerSupport

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

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

	CommitWithPvtData(blockAndPvtdata *ledger.BlockAndPvtData) error

	CommitPvtDataOfOldBlocks(blockPvtData []*ledger.BlockPvtData) ([]*ledger.PvtdataHashMismatch, error)

	GetBlockchainInfo() (*common.BlockchainInfo, error)

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

	GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error)

	GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error)

	Close()
}

PeerledgerSupport抽象出ledger.peerledger接口的API 需要执行LedgerCommitter

Directories

Path Synopsis
txvalidator
mocks
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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