cc

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Logger是此包的日志记录实例。
	//它被导出是因为测试会覆盖其后端
	Logger = flogging.MustGetLogger("discovery.lifecycle")
)

Functions

func DeployedChaincodes

func DeployedChaincodes(q Query, filter ChaincodePredicate, loadCollections bool, chaincodes ...string) (chaincode.MetadataSet, error)

deployed chaincodes检索给定已部署链代码的元数据

Types

type ChaincodePredicate

type ChaincodePredicate func(cc chaincode.Metadata) bool

chaincodePredicate根据其元数据接受或拒绝chaincode

var (
	//AcceptAll返回接受所有元数据的谓词
	AcceptAll ChaincodePredicate = func(cc chaincode.Metadata) bool {
		return true
	}
)

type Enumerate

type Enumerate func() ([]chaincode.InstalledChaincode, error)

func (Enumerate) Enumerate

func (listCCs Enumerate) Enumerate() ([]chaincode.InstalledChaincode, error)

枚举枚举链代码

type Enumerator

type Enumerator interface {
	//
	Enumerate() ([]chaincode.InstalledChaincode, error)
}

枚举器枚举链代码

type HandleMetadataUpdate

type HandleMetadataUpdate func(channel string, chaincodes chaincode.MetadataSet)

handleMetadataUpdate在链代码生命周期更改时触发

func (HandleMetadataUpdate) LifeCycleChangeListener

func (mdUpdate HandleMetadataUpdate) LifeCycleChangeListener(channel string, chaincodes chaincode.MetadataSet)

LifecycleChangeListener在元数据发生更改时运行

type LifeCycleChangeListener

type LifeCycleChangeListener interface {
	LifeCycleChangeListener(channel string, chaincodes chaincode.MetadataSet)
}

LifecycleChangeListener在元数据发生更改时运行 特定通道上下文中的链代码

type Lifecycle

type Lifecycle struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Lifecycle管理有关链码生命周期的信息

func NewLifeCycle

func NewLifeCycle(installedChaincodes Enumerator) (*Lifecycle, error)

NewLifecycle创建新的生命周期实例

func (*Lifecycle) AddListener

func (lc *Lifecycle) AddListener(listener LifeCycleChangeListener)

func (*Lifecycle) Metadata

func (lc *Lifecycle) Metadata(channel string, cc string, collections bool) *chaincode.Metadata

元数据返回给定通道上链码的元数据, 如果找不到或检索时出错,则为零。

func (*Lifecycle) NewChannelSubscription

func (lc *Lifecycle) NewChannelSubscription(channel string, queryCreator QueryCreator) (*Subscription, error)

newchannelsubscription订阅通道

type Query

type Query interface {
	//GetState获取给定命名空间和键的值。对于chaincode,命名空间对应于chaincodeid
	GetState(namespace string, key string) ([]byte, error)

	//完成释放由QueryExecutor占用的资源
	Done()
}

查询查询状态

type QueryCreator

type QueryCreator interface {
	//
	NewQuery() (Query, error)
}

type QueryCreatorFunc

type QueryCreatorFunc func() (Query, error)

querycreatorfunc创建新查询

func (QueryCreatorFunc) NewQuery

func (qc QueryCreatorFunc) NewQuery() (Query, error)

new query创建新查询,或失败时出错

type Subscription

type Subscription struct {
	sync.Mutex
	// contains filtered or unexported fields
}

订阅通道信息流 关于进入生命周期的特定渠道

func (*Subscription) ChaincodeDeployDone

func (sub *Subscription) ChaincodeDeployDone(succeeded bool)

当chaincode deploy事务或chaincode安装时调用chaincodedeploydone

func (*Subscription) HandleChaincodeDeploy

func (sub *Subscription) HandleChaincodeDeploy(chaincodeDefinition *cceventmgmt.ChaincodeDefinition, dbArtifactsTar []byte) error

当通过部署事务部署链代码并且chaicndoe已经 安装在对等机上。当对等端上安装了已部署的链代码时,也会调用此函数。

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