1 Star 0 Fork 0

peter / fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
api.go 2.77 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package discovery
import (
discprotos "github.com/hyperledger/fabric-protos-go/discovery"
"github.com/hyperledger/fabric/gossip/api"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/protoutil"
)
// AccessControlSupport checks if clients are eligible of being serviced
type AccessControlSupport interface {
// Eligible returns whether the given peer is eligible for receiving
// service from the discovery service for a given channel
EligibleForService(channel string, data protoutil.SignedData) error
}
// ConfigSequenceSupport returns the config sequence of the given channel
type ConfigSequenceSupport interface {
// ConfigSequence returns the configuration sequence of the a given channel
ConfigSequence(channel string) uint64
}
// GossipSupport aggregates abilities that the gossip module
// provides to the discovery service, such as knowing information about peers
type GossipSupport interface {
// ChannelExists returns whether a given channel exists or not
ChannelExists(channel string) bool
// PeersOfChannel returns the NetworkMembers considered alive
// and also subscribed to the channel given
PeersOfChannel(common.ChannelID) discovery.Members
// Peers returns the NetworkMembers considered alive
Peers() discovery.Members
// IdentityInfo returns identity information about peers
IdentityInfo() api.PeerIdentitySet
}
// EndorsementSupport provides knowledge of endorsement policy selection
// for chaincodes
type EndorsementSupport interface {
// PeersForEndorsement returns an EndorsementDescriptor for a given set of peers, channel, and chaincode
PeersForEndorsement(channel common.ChannelID, interest *discprotos.ChaincodeInterest) (*discprotos.EndorsementDescriptor, error)
// PeersAuthorizedByCriteria returns the peers of the channel that are authorized by the given chaincode interest
// That is - taking in account if the chaincode(s) in the interest are installed on the peers, and also
// taking in account whether the peers are part of the collections of the chaincodes.
// If a nil interest, or an empty interest is passed - no filtering is done.
PeersAuthorizedByCriteria(chainID common.ChannelID, interest *discprotos.ChaincodeInterest) (discovery.Members, error)
}
// ConfigSupport provides access to channel configuration
type ConfigSupport interface {
// Config returns the channel's configuration
Config(channel string) (*discprotos.ConfigResult, error)
}
// Support defines an interface that allows the discovery service
// to obtain information that other peer components have
type Support interface {
AccessControlSupport
GossipSupport
EndorsementSupport
ConfigSupport
ConfigSequenceSupport
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/peter_code_git/fabric.git
git@gitee.com:peter_code_git/fabric.git
peter_code_git
fabric
fabric
v2.0.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891