api

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

This section is empty.

Types

type AnchorPeer

type AnchorPeer struct {
	Host string //主机是远程对等机的主机名/IP地址
	Port int    //端口是远程对等机正在侦听的端口
}

anchor peer是锚定对等的证书和终结点(主机:端口)

type ChannelNotifier

type ChannelNotifier interface {
	JoinChannel(joinMsg JoinChannelMessage, chainID common.ChainID)
}

channelnotifier由八卦组件实现,用于对等端 通知JoinChannel事件的八卦组件的层

type JoinChannelMessage

type JoinChannelMessage interface {

	//SequenceNumber返回配置块的序列号
	//JoinChannelMessage源于
	SequenceNumber() uint64

	//成员返回频道的组织
	Members() []OrgIdentityType

	//anchor peers of返回给定组织的锚定对等方
	AnchorPeersOf(org OrgIdentityType) []AnchorPeer
}

JoinChannelMessage是断言创建或突变的消息 一个频道的成员名单,是八卦消息 在同行中

type MessageCryptoService

type MessageCryptoService interface {

	//getpkiidofcert返回对等身份的pki-id
	//如果出现任何错误,方法返回nil
	//此方法不验证对等标识。
	//这个验证应该在执行流程中适当地完成。
	GetPKIidOfCert(peerIdentity PeerIdentityType) common.PKIidType

	//如果块已正确签名,并且声明的seqnum是
	//块头包含的序列号。
	//else返回错误
	VerifyBlock(chainID common.ChainID, seqNum uint64, signedBlock []byte) error

	//用该对等方的签名密钥和输出对消息进行签名
	//如果没有出现错误,则返回签名。
	Sign(msg []byte) ([]byte, error)

	//验证检查签名是否是对等验证密钥下消息的有效签名。
	//如果验证成功,则verify返回nil,表示没有发生错误。
	//如果peerIdentity为零,则验证失败。
	Verify(peerIdentity PeerIdentityType, signature, message []byte) error

	//VerifyByChannel检查签名是否为消息的有效签名
	//在对等机的验证密钥下,也在特定通道的上下文中。
	//如果验证成功,则verify返回nil,表示没有发生错误。
	//如果peerIdentity为零,则验证失败。
	VerifyByChannel(chainID common.ChainID, peerIdentity PeerIdentityType, signature, message []byte) error

	//validateIDentity验证远程对等机的标识。
	//如果标识无效、已吊销、已过期,则返回错误。
	//否则,返回零
	ValidateIdentity(peerIdentity PeerIdentityType) error

	//过期退货:
	//-身份过期时间,无
	//以防过期
	//零值时间,时间,零
	//以防过期
	//-零值,如果不能
	//已确定身份是否可以过期
	Expiration(peerIdentity PeerIdentityType) (time.Time, error)
}

MessageCryptoService是八卦组件和 对等机的加密层,并由八卦组件用于验证, 并验证远程对等机和它们发送的数据,以及验证 从订购服务接收到块。

type OrgIdentityType

type OrgIdentityType []byte

OrgIdentityType定义组织的标识

type PeerIdentityInfo

type PeerIdentityInfo struct {
	PKIId        common.PKIidType
	Identity     PeerIdentityType
	Organization OrgIdentityType
}

peerIdentityInfo聚合对等机的标识, 以及有关它的其他元数据

type PeerIdentitySet

type PeerIdentitySet []PeerIdentityInfo

PeerIdentitySet聚合PeerIdentityInfo切片

func (PeerIdentitySet) ByID

func (pis PeerIdentitySet) ByID() map[string]PeerIdentityInfo

ByOrg根据其对等方的pki ID对peerIdentity集进行排序

func (PeerIdentitySet) ByOrg

func (pis PeerIdentitySet) ByOrg() map[string]PeerIdentitySet

byorg对其对等组织设置的对等标识进行排序

type PeerIdentityType

type PeerIdentityType []byte

peerIdentityType是对等方的证书

type PeerSecureDialOpts

type PeerSecureDialOpts func() []grpc.DialOption

PeerSecureDialOpts返回用于连接级别的GRPC拨号选项 与远程对等端点通信时的安全性

type PeerSignature

type PeerSignature struct {
	Signature    []byte
	Message      []byte
	PeerIdentity PeerIdentityType
}

对等签名定义对等签名 在给定的消息上

type PeerSuspector

type PeerSuspector func(identity PeerIdentityType) bool

PeerSuspencector返回是否怀疑具有给定标识的对等机 被撤销或其CA被撤销

type RoutingFilter

type RoutingFilter func(peerIdentity PeerIdentityType) bool

routingfilter定义哪些对等方应接收特定消息, 或者哪些对等方有资格接收特定消息

type RoutingFilterFactory

type RoutingFilterFactory interface {
	//对等方返回给定chainID和collectioncriteria的路由筛选器
	Peers(common.ChainID, SubChannelSelectionCriteria) RoutingFilter
}

RoutingFilterFactory定义了一个对象,该对象给定了一个CollectionCriteria和一个通道, 它可以确定哪些对等方应该知道与 收藏标准。

type SecurityAdvisor

type SecurityAdvisor interface {
	//orgByPeerIdentity返回orgIdentityType
	//一个给定的对等身份。
	//如果出现任何错误,则返回nil。
	//此方法不验证对等标识。
	//这个验证应该在执行流程中适当地完成。
	OrgByPeerIdentity(PeerIdentityType) OrgIdentityType
}

SecurityAdvisor定义外部辅助对象 提供安全和身份相关功能

type SubChannelSelectionCriteria

type SubChannelSelectionCriteria func(signature PeerSignature) bool

子通道选择标准描述了从子通道选择对等点的方法 给了他们签名

Jump to

Keyboard shortcuts

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