Documentation ¶
Index ¶
- Variables
- type ChannelResponse
- type Client
- type Dialer
- type Endorsers
- type ExclusionFilter
- type Filter
- type InvocationChain
- type LocalResponse
- type MemoizeSigner
- type Peer
- type Priority
- type PrioritySelector
- type Request
- func (req *Request) AddConfigQuery() *Request
- func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)
- func (req *Request) AddLocalPeersQuery() *Request
- func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request
- func (req *Request) OfChannel(ch string) *Request
- type Response
- type Signer
Constants ¶
This section is empty.
Variables ¶
var ( //PrioritiesByHeight selects peers by descending height PrioritiesByHeight = &byHeight{} //NoExclusion接受所有对等方,不拒绝任何对等方 NoExclusion = selectionFunc(noExclusion) //NoPriorities is indifferent to how it selects peers NoPriorities = &noPriorities{} )
var ( //errnotfound定义了一个错误,这意味着找不到元素 ErrNotFound = errors.New("not found") )
var NoFilter = NewFilter(NoPriorities, NoExclusion)
nofilter返回noop筛选器
Functions ¶
This section is empty.
Types ¶
type ChannelResponse ¶
type ChannelResponse interface { //config返回对config查询的响应,或者在出现错误时返回错误 Config() (*discovery.ConfigResult, error) //对等方返回对等方成员身份查询的响应,或者在出现错误时返回错误 Peers(invocationChain ...*discovery.ChaincodeCall) ([]*Peer, error) //背书人返回对给定的背书人查询的响应 //给定通道上下文中的链代码,或者出错时出错。 //该方法返回一组随机的背书人,以便所有背书人的签名 //合起来,满足背书政策。 //选择基于给定的选择提示: //筛选:筛选和排序背书人 //给定的invocationChain指定链码调用(以及集合) //客户在构建请求期间通过 Endorsers(invocationChain InvocationChain, f Filter) (Endorsers, error) }
通道响应聚合给定通道的响应
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
客户端与发现服务器交互
type Endorsers ¶
type Endorsers []*Peer
Endorsers defines a set of peers that are sufficient 满足一些链码的认可政策
func (Endorsers) Filter ¶
func (endorsers Endorsers) Filter(f ExclusionFilter) Endorsers
Filter filters the endorsers according to the given ExclusionFilter
func (Endorsers) Sort ¶
func (endorsers Endorsers) Sort(ps PrioritySelector) Endorsers
根据给定的PrioritySelector对背书人排序
type ExclusionFilter ¶
如果给定的对等端 is not to be considered when selecting peers
func ExcludeByHost ¶
func ExcludeByHost(reject func(host string) bool) ExclusionFilter
ExcludeByHost creates a ExclusionFilter out of the given exclusion predicate
func ExcludeHosts ¶
func ExcludeHosts(endpoints ...string) ExclusionFilter
excludehosts返回排除给定端点的exclusionfilter
type Filter ¶
过滤和排序给定的背书人
func NewFilter ¶
func NewFilter(ps PrioritySelector, ef ExclusionFilter) Filter
newfilter返回使用给定排除筛选器和优先级选择器的认可器筛选器 对背书人进行筛选和排序
type InvocationChain ¶
type InvocationChain []*discovery.ChaincodeCall
调用链聚合链编解码器调用
func (InvocationChain) ValidateInvocationChain ¶
func (ic InvocationChain) ValidateInvocationChain() error
validateInvocationChain验证InvocationChain的结构
type LocalResponse ¶
LocalResponse聚合无通道作用域的响应
type MemoizeSigner ¶
memoizesigner使用相同的签名对邮件进行签名 如果邮件是最近签名的
func NewMemoizeSigner ¶
func NewMemoizeSigner(signFunc Signer, maxEntries uint) *MemoizeSigner
NewMemoizeSigner创建一个新的签署MemoizeSigner 具有给定符号功能的消息
type Peer ¶
type Peer struct { MSPID string AliveMessage *gossip.SignedGossipMessage StateInfoMessage *gossip.SignedGossipMessage Identity []byte }
对等机聚合身份、成员身份和通道范围的信息 of a certain peer.
type Priority ¶
type Priority int
优先级定义选择对等机的可能性 超过另一个同伴。 正优先级表示选择了左对等 负优先级意味着选择正确的对等体。 零优先级意味着它们的优先级相同
type PrioritySelector ¶
PrioritySelector通过 给予同伴相对优先的选择权
type Request ¶
请求在其内部聚合多个查询
func (*Request) AddConfigQuery ¶
addconfigquery向请求添加config查询
func (*Request) AddEndorsersQuery ¶
func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)
AddEndorsersQuery adds to the request a query for given chaincodes 兴趣是客户想要查询的链码兴趣。 给定通道的所有兴趣都应在聚合切片中提供
func (*Request) AddLocalPeersQuery ¶
AddLocalPeersQuery adds to the request a local peer query
func (*Request) AddPeersQuery ¶
func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request
addpeersquery向请求添加对等查询
type Response ¶
type Response interface { //ForChannel返回给定通道上下文中的ChannelResponse ForChannel(string) ChannelResponse //forlocal返回无通道上下文中的localresponse ForLocal() LocalResponse }
响应聚合了来自发现服务的多个响应