blockledger

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNextBlock

func CreateNextBlock(rl Reader, messages []*cb.Envelope) *cb.Block

适应非确定性编组

func GetBlock

func GetBlock(rl Reader, index uint64) *cb.Block

Types

type Factory

type Factory interface {
	//
	//
	GetOrCreate(chainID string) (ReadWriter, error)

	//chainIds返回工厂知道的链ID
	ChainIDs() []string

	//
	Close()
}

type Iterator

type Iterator interface {
	//
	//下一个块不再可检索
	Next() (*cb.Block, cb.Status)
	//
	Close()
}

迭代器对于链读取器在创建块时流式处理块很有用。

type NotFoundErrorIterator

type NotFoundErrorIterator struct{}

NotFoundErrorIterator只返回cb.status的错误“未找到”,

func (*NotFoundErrorIterator) Close

func (nfei *NotFoundErrorIterator) Close()

func (*NotFoundErrorIterator) Next

func (nfei *NotFoundErrorIterator) Next() (*cb.Block, cb.Status)

func (*NotFoundErrorIterator) ReadyChan

func (nfei *NotFoundErrorIterator) ReadyChan() <-chan struct{}

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

type Reader

type Reader interface {
	//
	//
	Iterator(startType *ab.SeekPosition) (Iterator, uint64)
	//height返回分类帐上的块数
	Height() uint64
}

type Writer

type Writer interface {
	//将新块追加到分类帐
	Append(block *cb.Block) error
}

Directories

Path Synopsis
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 Code generated by mockery v1.0.0.
此源码被清华学神尹成大魔王专业翻译分析并修改 尹成QQ77025077 尹成微信18510341407 尹成所在QQ群721929980 尹成邮箱 yinc13@mails.tsinghua.edu.cn 尹成毕业于清华大学,微软区块链领域全球最有价值专家 https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 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