gossip

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GossipMessage_Tag_name = map[int32]string{
	0: "UNDEFINED",
	1: "EMPTY",
	2: "ORG_ONLY",
	3: "CHAN_ONLY",
	4: "CHAN_AND_ORG",
	5: "CHAN_OR_ORG",
}
View Source
var GossipMessage_Tag_value = map[string]int32{
	"UNDEFINED":    0,
	"EMPTY":        1,
	"ORG_ONLY":     2,
	"CHAN_ONLY":    3,
	"CHAN_AND_ORG": 4,
	"CHAN_OR_ORG":  5,
}
View Source
var PullMsgType_name = map[int32]string{
	0: "UNDEFINED",
	1: "BLOCK_MSG",
	2: "IDENTITY_MSG",
}
View Source
var PullMsgType_value = map[string]int32{
	"UNDEFINED":    0,
	"BLOCK_MSG":    1,
	"IDENTITY_MSG": 2,
}

Functions

func NewGossipMessageComparator

func NewGossipMessageComparator(dataBlockStorageSize int) common.MessageReplacingPolicy

newgossipMessageComparator创建一个messageReplacingPolicy,给定要保留的最大块数。

func RegisterGossipServer

func RegisterGossipServer(s *grpc.Server, srv GossipServer)

Types

type Acknowledgement

type Acknowledgement struct {
	Error                string   `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Acknowledgement) Descriptor

func (*Acknowledgement) Descriptor() ([]byte, []int)

func (*Acknowledgement) GetError

func (m *Acknowledgement) GetError() string

func (*Acknowledgement) ProtoMessage

func (*Acknowledgement) ProtoMessage()

func (*Acknowledgement) Reset

func (m *Acknowledgement) Reset()

func (*Acknowledgement) String

func (m *Acknowledgement) String() string

func (*Acknowledgement) XXX_DiscardUnknown

func (m *Acknowledgement) XXX_DiscardUnknown()

func (*Acknowledgement) XXX_Marshal

func (m *Acknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Acknowledgement) XXX_Merge

func (dst *Acknowledgement) XXX_Merge(src proto.Message)

func (*Acknowledgement) XXX_Size

func (m *Acknowledgement) XXX_Size() int

func (*Acknowledgement) XXX_Unmarshal

func (m *Acknowledgement) XXX_Unmarshal(b []byte) error

type AliveMessage

type AliveMessage struct {
	Membership           *Member   `protobuf:"bytes,1,opt,name=membership,proto3" json:"membership,omitempty"`
	Timestamp            *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Identity             []byte    `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

发送AliveMessage以通知远程对等机 同伴的存在和活动

func (*AliveMessage) Descriptor

func (*AliveMessage) Descriptor() ([]byte, []int)

func (*AliveMessage) GetIdentity

func (m *AliveMessage) GetIdentity() []byte

func (*AliveMessage) GetMembership

func (m *AliveMessage) GetMembership() *Member

func (*AliveMessage) GetTimestamp

func (m *AliveMessage) GetTimestamp() *PeerTime

func (*AliveMessage) ProtoMessage

func (*AliveMessage) ProtoMessage()

func (*AliveMessage) Reset

func (m *AliveMessage) Reset()

func (*AliveMessage) String

func (m *AliveMessage) String() string

func (*AliveMessage) XXX_DiscardUnknown

func (m *AliveMessage) XXX_DiscardUnknown()

func (*AliveMessage) XXX_Marshal

func (m *AliveMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AliveMessage) XXX_Merge

func (dst *AliveMessage) XXX_Merge(src proto.Message)

func (*AliveMessage) XXX_Size

func (m *AliveMessage) XXX_Size() int

func (*AliveMessage) XXX_Unmarshal

func (m *AliveMessage) XXX_Unmarshal(b []byte) error

type AuthInfo

type AuthInfo struct {
	SignedData []byte
	Signature  []byte
}

AuthInfo表示身份验证 远程对等端提供的数据 连接时

type Chaincode

type Chaincode struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Metadata             []byte   `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

chaincode表示已安装的chaincode 在同行上

func (*Chaincode) Descriptor

func (*Chaincode) Descriptor() ([]byte, []int)

func (*Chaincode) GetMetadata

func (m *Chaincode) GetMetadata() []byte

func (*Chaincode) GetName

func (m *Chaincode) GetName() string

func (*Chaincode) GetVersion

func (m *Chaincode) GetVersion() string

func (*Chaincode) ProtoMessage

func (*Chaincode) ProtoMessage()

func (*Chaincode) Reset

func (m *Chaincode) Reset()

func (*Chaincode) String

func (m *Chaincode) String() string

func (*Chaincode) XXX_DiscardUnknown

func (m *Chaincode) XXX_DiscardUnknown()

func (*Chaincode) XXX_Marshal

func (m *Chaincode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Chaincode) XXX_Merge

func (dst *Chaincode) XXX_Merge(src proto.Message)

func (*Chaincode) XXX_Size

func (m *Chaincode) XXX_Size() int

func (*Chaincode) XXX_Unmarshal

func (m *Chaincode) XXX_Unmarshal(b []byte) error

type ConnEstablish

type ConnEstablish struct {
	PkiId                []byte   `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"`
	Identity             []byte   `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	TlsCertHash          []byte   `protobuf:"bytes,3,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Connestablish是用于八卦握手的信息 每当一个对等机连接到另一个对等机时,它就会握手 通过发送这个消息来证明它的身份

func (*ConnEstablish) Descriptor

func (*ConnEstablish) Descriptor() ([]byte, []int)

func (*ConnEstablish) GetIdentity

func (m *ConnEstablish) GetIdentity() []byte

func (*ConnEstablish) GetPkiId

func (m *ConnEstablish) GetPkiId() []byte

func (*ConnEstablish) GetTlsCertHash

func (m *ConnEstablish) GetTlsCertHash() []byte

func (*ConnEstablish) ProtoMessage

func (*ConnEstablish) ProtoMessage()

func (*ConnEstablish) Reset

func (m *ConnEstablish) Reset()

func (*ConnEstablish) String

func (m *ConnEstablish) String() string

func (*ConnEstablish) XXX_DiscardUnknown

func (m *ConnEstablish) XXX_DiscardUnknown()

func (*ConnEstablish) XXX_Marshal

func (m *ConnEstablish) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConnEstablish) XXX_Merge

func (dst *ConnEstablish) XXX_Merge(src proto.Message)

func (*ConnEstablish) XXX_Size

func (m *ConnEstablish) XXX_Size() int

func (*ConnEstablish) XXX_Unmarshal

func (m *ConnEstablish) XXX_Unmarshal(b []byte) error

type ConnectionInfo

type ConnectionInfo struct {
	ID       common.PKIidType
	Auth     *AuthInfo
	Identity api.PeerIdentityType
	Endpoint string
}

ConnectionInfo表示有关 发送特定接收消息的远程对等机

func (*ConnectionInfo) String

func (c *ConnectionInfo) String() string

string返回此connectioninfo的字符串表示形式

type DataDigest

type DataDigest struct {
	Nonce                uint64      `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Digests              [][]byte    `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"`
	MsgType              PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

DataDigest是从接收器对等端发送的消息 到初始化程序对等端,并包含其具有的数据项

func (*DataDigest) Descriptor

func (*DataDigest) Descriptor() ([]byte, []int)

func (*DataDigest) FormattedDigests

func (dd *DataDigest) FormattedDigests() []string

func (*DataDigest) GetDigests

func (m *DataDigest) GetDigests() [][]byte

func (*DataDigest) GetMsgType

func (m *DataDigest) GetMsgType() PullMsgType

func (*DataDigest) GetNonce

func (m *DataDigest) GetNonce() uint64

func (*DataDigest) ProtoMessage

func (*DataDigest) ProtoMessage()

func (*DataDigest) Reset

func (m *DataDigest) Reset()

func (*DataDigest) String

func (m *DataDigest) String() string

func (*DataDigest) XXX_DiscardUnknown

func (m *DataDigest) XXX_DiscardUnknown()

func (*DataDigest) XXX_Marshal

func (m *DataDigest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataDigest) XXX_Merge

func (dst *DataDigest) XXX_Merge(src proto.Message)

func (*DataDigest) XXX_Size

func (m *DataDigest) XXX_Size() int

func (*DataDigest) XXX_Unmarshal

func (m *DataDigest) XXX_Unmarshal(b []byte) error

type DataMessage

type DataMessage struct {
	Payload              *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

datamessage是包含块的消息

func (*DataMessage) Descriptor

func (*DataMessage) Descriptor() ([]byte, []int)

func (*DataMessage) GetPayload

func (m *DataMessage) GetPayload() *Payload

func (*DataMessage) ProtoMessage

func (*DataMessage) ProtoMessage()

func (*DataMessage) Reset

func (m *DataMessage) Reset()

func (*DataMessage) String

func (m *DataMessage) String() string

func (*DataMessage) XXX_DiscardUnknown

func (m *DataMessage) XXX_DiscardUnknown()

func (*DataMessage) XXX_Marshal

func (m *DataMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataMessage) XXX_Merge

func (dst *DataMessage) XXX_Merge(src proto.Message)

func (*DataMessage) XXX_Size

func (m *DataMessage) XXX_Size() int

func (*DataMessage) XXX_Unmarshal

func (m *DataMessage) XXX_Unmarshal(b []byte) error

type DataRequest

type DataRequest struct {
	Nonce                uint64      `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Digests              [][]byte    `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"`
	MsgType              PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

DataRequest是用于对等请求的消息 来自远程对等机的某些数据块

func (*DataRequest) Descriptor

func (*DataRequest) Descriptor() ([]byte, []int)

func (*DataRequest) FormattedDigests

func (dd *DataRequest) FormattedDigests() []string

func (*DataRequest) GetDigests

func (m *DataRequest) GetDigests() [][]byte

func (*DataRequest) GetMsgType

func (m *DataRequest) GetMsgType() PullMsgType

func (*DataRequest) GetNonce

func (m *DataRequest) GetNonce() uint64

func (*DataRequest) ProtoMessage

func (*DataRequest) ProtoMessage()

func (*DataRequest) Reset

func (m *DataRequest) Reset()

func (*DataRequest) String

func (m *DataRequest) String() string

func (*DataRequest) XXX_DiscardUnknown

func (m *DataRequest) XXX_DiscardUnknown()

func (*DataRequest) XXX_Marshal

func (m *DataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataRequest) XXX_Merge

func (dst *DataRequest) XXX_Merge(src proto.Message)

func (*DataRequest) XXX_Size

func (m *DataRequest) XXX_Size() int

func (*DataRequest) XXX_Unmarshal

func (m *DataRequest) XXX_Unmarshal(b []byte) error

type DataUpdate

type DataUpdate struct {
	Nonce                uint64      `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Data                 []*Envelope `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
	MsgType              PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

数据更新是pull阶段的最终消息 从接收器发送到发起程序

func (*DataUpdate) Descriptor

func (*DataUpdate) Descriptor() ([]byte, []int)

func (*DataUpdate) GetData

func (m *DataUpdate) GetData() []*Envelope

func (*DataUpdate) GetMsgType

func (m *DataUpdate) GetMsgType() PullMsgType

func (*DataUpdate) GetNonce

func (m *DataUpdate) GetNonce() uint64

func (*DataUpdate) ProtoMessage

func (*DataUpdate) ProtoMessage()

func (*DataUpdate) Reset

func (m *DataUpdate) Reset()

func (*DataUpdate) String

func (m *DataUpdate) String() string

func (*DataUpdate) XXX_DiscardUnknown

func (m *DataUpdate) XXX_DiscardUnknown()

func (*DataUpdate) XXX_Marshal

func (m *DataUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataUpdate) XXX_Merge

func (dst *DataUpdate) XXX_Merge(src proto.Message)

func (*DataUpdate) XXX_Size

func (m *DataUpdate) XXX_Size() int

func (*DataUpdate) XXX_Unmarshal

func (m *DataUpdate) XXX_Unmarshal(b []byte) error

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

空用于ping和测试

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (dst *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type Envelope

type Envelope struct {
	Payload              []byte          `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	Signature            []byte          `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	SecretEnvelope       *SecretEnvelope `protobuf:"bytes,3,opt,name=secret_envelope,json=secretEnvelope,proto3" json:"secret_envelope,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

信封包含已封送的 八卦消息和上面的签名。 它也可能包含一个秘密的私藏物。 这是一个秘密

func (*Envelope) Descriptor

func (*Envelope) Descriptor() ([]byte, []int)

func (*Envelope) GetPayload

func (m *Envelope) GetPayload() []byte

func (*Envelope) GetSecretEnvelope

func (m *Envelope) GetSecretEnvelope() *SecretEnvelope

func (*Envelope) GetSignature

func (m *Envelope) GetSignature() []byte

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) SignSecret

func (e *Envelope) SignSecret(signer Signer, secret *Secret) error

SignSecret对秘密有效载荷进行签名并创建 一个秘密的信封。

func (*Envelope) String

func (m *Envelope) String() string

func (*Envelope) ToGossipMessage

func (e *Envelope) ToGossipMessage() (*SignedGossipMessage, error)

TogossipMessage取消封送给定信封并创建 从中签名的ossipMessage。 如果取消封送失败,则返回错误。

func (*Envelope) XXX_DiscardUnknown

func (m *Envelope) XXX_DiscardUnknown()

func (*Envelope) XXX_Marshal

func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Envelope) XXX_Merge

func (dst *Envelope) XXX_Merge(src proto.Message)

func (*Envelope) XXX_Size

func (m *Envelope) XXX_Size() int

func (*Envelope) XXX_Unmarshal

func (m *Envelope) XXX_Unmarshal(b []byte) error

type GossipClient

type GossipClient interface {
	//gossipstream是用于发送和接收消息的GRPC流
	GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error)
	//ping用于探测远程对等机的生存能力
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

gossip client是八卦服务的客户端API。

有关CTX使用和关闭/结束流式RPC的语义,请参阅https://godoc.org/google.golang.org/grpc clientconn.newstream。

func NewGossipClient

func NewGossipClient(cc *grpc.ClientConn) GossipClient

type GossipHello

type GossipHello struct {
	Nonce                uint64      `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Metadata             []byte      `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	MsgType              PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

gossiphello是用于对等端启动的消息 和另一个同伴调停

func (*GossipHello) Descriptor

func (*GossipHello) Descriptor() ([]byte, []int)

func (*GossipHello) GetMetadata

func (m *GossipHello) GetMetadata() []byte

func (*GossipHello) GetMsgType

func (m *GossipHello) GetMsgType() PullMsgType

func (*GossipHello) GetNonce

func (m *GossipHello) GetNonce() uint64

func (*GossipHello) ProtoMessage

func (*GossipHello) ProtoMessage()

func (*GossipHello) Reset

func (m *GossipHello) Reset()

func (*GossipHello) String

func (m *GossipHello) String() string

func (*GossipHello) XXX_DiscardUnknown

func (m *GossipHello) XXX_DiscardUnknown()

func (*GossipHello) XXX_Marshal

func (m *GossipHello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GossipHello) XXX_Merge

func (dst *GossipHello) XXX_Merge(src proto.Message)

func (*GossipHello) XXX_Size

func (m *GossipHello) XXX_Size() int

func (*GossipHello) XXX_Unmarshal

func (m *GossipHello) XXX_Unmarshal(b []byte) error

type GossipMessage

type GossipMessage struct {
	//主要用于测试,但将来可能会用到
	//通过包装确保邮件传递
	Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	//消息的通道。
	//一些八卦消息可能会将此设置为零,因为
	//它们是跨渠道的,但有些可能不是
	Channel []byte `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"`
	//确定允许的对等点
	//转发消息
	Tag GossipMessage_Tag `protobuf:"varint,3,opt,name=tag,proto3,enum=gossip.GossipMessage_Tag" json:"tag,omitempty"`
	//有效分配给内容的类型:
	//*流言蜚语
	//*流言蜚语
	//*流言蜚语
	//*八卦消息
	//*流言蜚语\你好
	//*八卦消息
	//*八卦消息
	//*八卦消息\u数据更新
	//*八卦信息\u空
	//*流言蜚语
	//*八卦消息
	//*流言蜚语
	//*八卦消息
	//*八卦消息\u staterequest
	//*八卦消息
	//*八卦消息
	//*八卦消息
	//*流言蜚语
	//*流言蜚语
	//*闲言碎语
	//*绯闻私密数据
	Content              isGossipMessage_Content `protobuf_oneof:"content"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

gossip message定义在八卦网络中发送的消息

func (*GossipMessage) Descriptor

func (*GossipMessage) Descriptor() ([]byte, []int)

func (*GossipMessage) GetAck

func (m *GossipMessage) GetAck() *Acknowledgement

func (*GossipMessage) GetAliveMsg

func (m *GossipMessage) GetAliveMsg() *AliveMessage

func (*GossipMessage) GetChannel

func (m *GossipMessage) GetChannel() []byte

func (*GossipMessage) GetConn

func (m *GossipMessage) GetConn() *ConnEstablish

func (*GossipMessage) GetContent

func (m *GossipMessage) GetContent() isGossipMessage_Content

func (*GossipMessage) GetDataDig

func (m *GossipMessage) GetDataDig() *DataDigest

func (*GossipMessage) GetDataMsg

func (m *GossipMessage) GetDataMsg() *DataMessage

func (*GossipMessage) GetDataReq

func (m *GossipMessage) GetDataReq() *DataRequest

func (*GossipMessage) GetDataUpdate

func (m *GossipMessage) GetDataUpdate() *DataUpdate

func (*GossipMessage) GetEmpty

func (m *GossipMessage) GetEmpty() *Empty

func (*GossipMessage) GetHello

func (m *GossipMessage) GetHello() *GossipHello

func (*GossipMessage) GetLeadershipMsg

func (m *GossipMessage) GetLeadershipMsg() *LeadershipMessage

func (*GossipMessage) GetMemReq

func (m *GossipMessage) GetMemReq() *MembershipRequest

func (*GossipMessage) GetMemRes

func (m *GossipMessage) GetMemRes() *MembershipResponse

func (*GossipMessage) GetNonce

func (m *GossipMessage) GetNonce() uint64

func (*GossipMessage) GetPeerIdentity

func (m *GossipMessage) GetPeerIdentity() *PeerIdentity

func (*GossipMessage) GetPrivateData

func (m *GossipMessage) GetPrivateData() *PrivateDataMessage

func (*GossipMessage) GetPrivateReq

func (m *GossipMessage) GetPrivateReq() *RemotePvtDataRequest

func (*GossipMessage) GetPrivateRes

func (m *GossipMessage) GetPrivateRes() *RemotePvtDataResponse

func (*GossipMessage) GetPullMsgType

func (m *GossipMessage) GetPullMsgType() PullMsgType

getpullmsgtype返回此八卦消息所属的拉机制的阶段 例如:你好、文摘等。 如果这不是拉消息,则返回pullmsgtype_undefined。

func (*GossipMessage) GetStateInfo

func (m *GossipMessage) GetStateInfo() *StateInfo

func (*GossipMessage) GetStateInfoPullReq

func (m *GossipMessage) GetStateInfoPullReq() *StateInfoPullRequest

func (*GossipMessage) GetStateRequest

func (m *GossipMessage) GetStateRequest() *RemoteStateRequest

func (*GossipMessage) GetStateResponse

func (m *GossipMessage) GetStateResponse() *RemoteStateResponse

func (*GossipMessage) GetStateSnapshot

func (m *GossipMessage) GetStateSnapshot() *StateInfoSnapshot

func (*GossipMessage) GetTag

func (m *GossipMessage) GetTag() GossipMessage_Tag

func (*GossipMessage) IsAck

func (m *GossipMessage) IsAck() bool

isack返回此八卦消息是否为确认消息

func (*GossipMessage) IsAliveMsg

func (m *GossipMessage) IsAliveMsg() bool

isalivemsg返回此gossipmessage是否为alivemessage

func (*GossipMessage) IsChannelRestricted

func (m *GossipMessage) IsChannelRestricted() bool

IsChannelRestricted返回是否应路由此gossipMessage 只在它的频道里

func (*GossipMessage) IsDataMsg

func (m *GossipMessage) IsDataMsg() bool

isdatamsg返回此gossipmessage是否为数据消息

func (*GossipMessage) IsDataReq

func (m *GossipMessage) IsDataReq() bool

isdatareq返回此gossipMessage是否为数据请求消息

func (*GossipMessage) IsDataUpdate

func (m *GossipMessage) IsDataUpdate() bool

ISdataUpdate返回此gossipMessage是否为数据更新消息

func (*GossipMessage) IsDigestMsg

func (m *GossipMessage) IsDigestMsg() bool

isdigestmsg返回此gossipMessage是否为摘要消息

func (*GossipMessage) IsHelloMsg

func (m *GossipMessage) IsHelloMsg() bool

ishellomsg返回此八卦消息是否为hello消息

func (*GossipMessage) IsIdentityMsg

func (m *GossipMessage) IsIdentityMsg() bool

IsIdentityMsg返回此gossipMessage是否为标识消息

func (*GossipMessage) IsLeadershipMsg

func (m *GossipMessage) IsLeadershipMsg() bool

isleadershipmsg返回此八卦消息是否为领导层(领导人选举)消息

func (*GossipMessage) IsOrgRestricted

func (m *GossipMessage) IsOrgRestricted() bool

IsorgRestricted返回是否只应路由此gossipMessage 组织内部

func (*GossipMessage) IsPrivateDataMsg

func (m *GossipMessage) IsPrivateDataMsg() bool

isprivatedatamsg返回此消息是否与私有数据相关

func (*GossipMessage) IsPullMsg

func (m *GossipMessage) IsPullMsg() bool

ispullmsg返回此gossipMessage是否属于 至牵引机构

func (*GossipMessage) IsRemoteStateMessage

func (m *GossipMessage) IsRemoteStateMessage() bool

IsRemotestateMessage返回此gossipMessage是否与状态同步相关

func (*GossipMessage) IsStateInfoMsg

func (m *GossipMessage) IsStateInfoMsg() bool

ISstateinfomsg返回此gossipmessage是否为stateinfo消息

func (*GossipMessage) IsStateInfoPullRequestMsg

func (m *GossipMessage) IsStateInfoPullRequestMsg() bool

ISstateinfoPullRequestMsg返回此gossipMessage是否为stateinfoPullRequest

func (*GossipMessage) IsStateInfoSnapshot

func (m *GossipMessage) IsStateInfoSnapshot() bool

ISstateinfosSnapshot返回此gossipMessage是否为StateInfo快照

func (*GossipMessage) IsTagLegal

func (m *GossipMessage) IsTagLegal() error

istagegal检查gossipmessage标记和内部类型 如果标记与类型不匹配,则返回错误。

func (*GossipMessage) NoopSign

func (m *GossipMessage) NoopSign() (*SignedGossipMessage, error)

NoopSign创建一个签名为nil的SignedGossipMessage

func (*GossipMessage) ProtoMessage

func (*GossipMessage) ProtoMessage()

func (*GossipMessage) Reset

func (m *GossipMessage) Reset()

func (*GossipMessage) String

func (m *GossipMessage) String() string

func (*GossipMessage) XXX_DiscardUnknown

func (m *GossipMessage) XXX_DiscardUnknown()

func (*GossipMessage) XXX_Marshal

func (m *GossipMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GossipMessage) XXX_Merge

func (dst *GossipMessage) XXX_Merge(src proto.Message)

func (*GossipMessage) XXX_OneofFuncs

func (*GossipMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

xxxoneoffuncs用于Proto包的内部使用。

func (*GossipMessage) XXX_Size

func (m *GossipMessage) XXX_Size() int

func (*GossipMessage) XXX_Unmarshal

func (m *GossipMessage) XXX_Unmarshal(b []byte) error

type GossipMessage_Ack

type GossipMessage_Ack struct {
	Ack *Acknowledgement `protobuf:"bytes,22,opt,name=ack,proto3,oneof"`
}

type GossipMessage_AliveMsg

type GossipMessage_AliveMsg struct {
	AliveMsg *AliveMessage `protobuf:"bytes,5,opt,name=alive_msg,json=aliveMsg,proto3,oneof"`
}

type GossipMessage_Conn

type GossipMessage_Conn struct {
	Conn *ConnEstablish `protobuf:"bytes,14,opt,name=conn,proto3,oneof"`
}

type GossipMessage_DataDig

type GossipMessage_DataDig struct {
	DataDig *DataDigest `protobuf:"bytes,10,opt,name=data_dig,json=dataDig,proto3,oneof"`
}

type GossipMessage_DataMsg

type GossipMessage_DataMsg struct {
	DataMsg *DataMessage `protobuf:"bytes,8,opt,name=data_msg,json=dataMsg,proto3,oneof"`
}

type GossipMessage_DataReq

type GossipMessage_DataReq struct {
	DataReq *DataRequest `protobuf:"bytes,11,opt,name=data_req,json=dataReq,proto3,oneof"`
}

type GossipMessage_DataUpdate

type GossipMessage_DataUpdate struct {
	DataUpdate *DataUpdate `protobuf:"bytes,12,opt,name=data_update,json=dataUpdate,proto3,oneof"`
}

type GossipMessage_Empty

type GossipMessage_Empty struct {
	Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"`
}

type GossipMessage_Hello

type GossipMessage_Hello struct {
	Hello *GossipHello `protobuf:"bytes,9,opt,name=hello,proto3,oneof"`
}

type GossipMessage_LeadershipMsg

type GossipMessage_LeadershipMsg struct {
	LeadershipMsg *LeadershipMessage `protobuf:"bytes,20,opt,name=leadership_msg,json=leadershipMsg,proto3,oneof"`
}

type GossipMessage_MemReq

type GossipMessage_MemReq struct {
	MemReq *MembershipRequest `protobuf:"bytes,6,opt,name=mem_req,json=memReq,proto3,oneof"`
}

type GossipMessage_MemRes

type GossipMessage_MemRes struct {
	MemRes *MembershipResponse `protobuf:"bytes,7,opt,name=mem_res,json=memRes,proto3,oneof"`
}

type GossipMessage_PeerIdentity

type GossipMessage_PeerIdentity struct {
	PeerIdentity *PeerIdentity `protobuf:"bytes,21,opt,name=peer_identity,json=peerIdentity,proto3,oneof"`
}

type GossipMessage_PrivateData

type GossipMessage_PrivateData struct {
	PrivateData *PrivateDataMessage `protobuf:"bytes,25,opt,name=private_data,json=privateData,proto3,oneof"`
}

type GossipMessage_PrivateReq

type GossipMessage_PrivateReq struct {
	PrivateReq *RemotePvtDataRequest `protobuf:"bytes,23,opt,name=privateReq,proto3,oneof"`
}

type GossipMessage_PrivateRes

type GossipMessage_PrivateRes struct {
	PrivateRes *RemotePvtDataResponse `protobuf:"bytes,24,opt,name=privateRes,proto3,oneof"`
}

type GossipMessage_StateInfo

type GossipMessage_StateInfo struct {
	StateInfo *StateInfo `protobuf:"bytes,15,opt,name=state_info,json=stateInfo,proto3,oneof"`
}

type GossipMessage_StateInfoPullReq

type GossipMessage_StateInfoPullReq struct {
	StateInfoPullReq *StateInfoPullRequest `protobuf:"bytes,17,opt,name=state_info_pull_req,json=stateInfoPullReq,proto3,oneof"`
}

type GossipMessage_StateRequest

type GossipMessage_StateRequest struct {
	StateRequest *RemoteStateRequest `protobuf:"bytes,18,opt,name=state_request,json=stateRequest,proto3,oneof"`
}

type GossipMessage_StateResponse

type GossipMessage_StateResponse struct {
	StateResponse *RemoteStateResponse `protobuf:"bytes,19,opt,name=state_response,json=stateResponse,proto3,oneof"`
}

type GossipMessage_StateSnapshot

type GossipMessage_StateSnapshot struct {
	StateSnapshot *StateInfoSnapshot `protobuf:"bytes,16,opt,name=state_snapshot,json=stateSnapshot,proto3,oneof"`
}

type GossipMessage_Tag

type GossipMessage_Tag int32
const (
	GossipMessage_UNDEFINED    GossipMessage_Tag = 0
	GossipMessage_EMPTY        GossipMessage_Tag = 1
	GossipMessage_ORG_ONLY     GossipMessage_Tag = 2
	GossipMessage_CHAN_ONLY    GossipMessage_Tag = 3
	GossipMessage_CHAN_AND_ORG GossipMessage_Tag = 4
	GossipMessage_CHAN_OR_ORG  GossipMessage_Tag = 5
)

func (GossipMessage_Tag) EnumDescriptor

func (GossipMessage_Tag) EnumDescriptor() ([]byte, []int)

func (GossipMessage_Tag) String

func (x GossipMessage_Tag) String() string

type GossipServer

type GossipServer interface {
	//gossipstream是用于发送和接收消息的GRPC流
	GossipStream(Gossip_GossipStreamServer) error
	//ping用于探测远程对等机的生存能力
	Ping(context.Context, *Empty) (*Empty, error)
}

gossip server是用于八卦服务的服务器API。

type Gossip_GossipStreamClient

type Gossip_GossipStreamClient interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type Gossip_GossipStreamServer

type Gossip_GossipStreamServer interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ServerStream
}

type IdentifierExtractor

type IdentifierExtractor func(*SignedGossipMessage) string

IdentifierExtractor从SignedGossipMessage提取标识符

type LeadershipMessage

type LeadershipMessage struct {
	PkiId                []byte    `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"`
	Timestamp            *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	IsDeclaration        bool      `protobuf:"varint,3,opt,name=is_declaration,json=isDeclaration,proto3" json:"is_declaration,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

领导信息在领导选举期间发送,以通知 对同伴宣称自己是领导者的意图的遥远的同伴

func (*LeadershipMessage) Descriptor

func (*LeadershipMessage) Descriptor() ([]byte, []int)

func (*LeadershipMessage) GetIsDeclaration

func (m *LeadershipMessage) GetIsDeclaration() bool

func (*LeadershipMessage) GetPkiId

func (m *LeadershipMessage) GetPkiId() []byte

func (*LeadershipMessage) GetTimestamp

func (m *LeadershipMessage) GetTimestamp() *PeerTime

func (*LeadershipMessage) ProtoMessage

func (*LeadershipMessage) ProtoMessage()

func (*LeadershipMessage) Reset

func (m *LeadershipMessage) Reset()

func (*LeadershipMessage) String

func (m *LeadershipMessage) String() string

func (*LeadershipMessage) XXX_DiscardUnknown

func (m *LeadershipMessage) XXX_DiscardUnknown()

func (*LeadershipMessage) XXX_Marshal

func (m *LeadershipMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LeadershipMessage) XXX_Merge

func (dst *LeadershipMessage) XXX_Merge(src proto.Message)

func (*LeadershipMessage) XXX_Size

func (m *LeadershipMessage) XXX_Size() int

func (*LeadershipMessage) XXX_Unmarshal

func (m *LeadershipMessage) XXX_Unmarshal(b []byte) error

type Member

type Member struct {
	Endpoint             string   `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Metadata             []byte   `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	PkiId                []byte   `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

会员持有会员相关信息 关于同伴

func (*Member) Descriptor

func (*Member) Descriptor() ([]byte, []int)

func (*Member) GetEndpoint

func (m *Member) GetEndpoint() string

func (*Member) GetMetadata

func (m *Member) GetMetadata() []byte

func (*Member) GetPkiId

func (m *Member) GetPkiId() []byte

func (*Member) ProtoMessage

func (*Member) ProtoMessage()

func (*Member) Reset

func (m *Member) Reset()

func (*Member) String

func (m *Member) String() string

func (*Member) XXX_DiscardUnknown

func (m *Member) XXX_DiscardUnknown()

func (*Member) XXX_Marshal

func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Member) XXX_Merge

func (dst *Member) XXX_Merge(src proto.Message)

func (*Member) XXX_Size

func (m *Member) XXX_Size() int

func (*Member) XXX_Unmarshal

func (m *Member) XXX_Unmarshal(b []byte) error

type MembershipRequest

type MembershipRequest struct {
	SelfInformation      *Envelope `protobuf:"bytes,1,opt,name=self_information,json=selfInformation,proto3" json:"self_information,omitempty"`
	Known                [][]byte  `protobuf:"bytes,2,rep,name=known,proto3" json:"known,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

MembershipRequest用于询问成员信息 从远程对等机

func (*MembershipRequest) Descriptor

func (*MembershipRequest) Descriptor() ([]byte, []int)

func (*MembershipRequest) GetKnown

func (m *MembershipRequest) GetKnown() [][]byte

func (*MembershipRequest) GetSelfInformation

func (m *MembershipRequest) GetSelfInformation() *Envelope

func (*MembershipRequest) ProtoMessage

func (*MembershipRequest) ProtoMessage()

func (*MembershipRequest) Reset

func (m *MembershipRequest) Reset()

func (*MembershipRequest) String

func (m *MembershipRequest) String() string

func (*MembershipRequest) XXX_DiscardUnknown

func (m *MembershipRequest) XXX_DiscardUnknown()

func (*MembershipRequest) XXX_Marshal

func (m *MembershipRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MembershipRequest) XXX_Merge

func (dst *MembershipRequest) XXX_Merge(src proto.Message)

func (*MembershipRequest) XXX_Size

func (m *MembershipRequest) XXX_Size() int

func (*MembershipRequest) XXX_Unmarshal

func (m *MembershipRequest) XXX_Unmarshal(b []byte) error

type MembershipResponse

type MembershipResponse struct {
	Alive                []*Envelope `protobuf:"bytes,1,rep,name=alive,proto3" json:"alive,omitempty"`
	Dead                 []*Envelope `protobuf:"bytes,2,rep,name=dead,proto3" json:"dead,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

membershipResponse用于答复membershipRequests

func (*MembershipResponse) Descriptor

func (*MembershipResponse) Descriptor() ([]byte, []int)

func (*MembershipResponse) GetAlive

func (m *MembershipResponse) GetAlive() []*Envelope

func (*MembershipResponse) GetDead

func (m *MembershipResponse) GetDead() []*Envelope

func (*MembershipResponse) ProtoMessage

func (*MembershipResponse) ProtoMessage()

func (*MembershipResponse) Reset

func (m *MembershipResponse) Reset()

func (*MembershipResponse) String

func (m *MembershipResponse) String() string

func (*MembershipResponse) XXX_DiscardUnknown

func (m *MembershipResponse) XXX_DiscardUnknown()

func (*MembershipResponse) XXX_Marshal

func (m *MembershipResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MembershipResponse) XXX_Merge

func (dst *MembershipResponse) XXX_Merge(src proto.Message)

func (*MembershipResponse) XXX_Size

func (m *MembershipResponse) XXX_Size() int

func (*MembershipResponse) XXX_Unmarshal

func (m *MembershipResponse) XXX_Unmarshal(b []byte) error

type MsgConsumer

type MsgConsumer func(message *SignedGossipMessage)

msgConsumer调用给定SignedGossipMessage的代码

type Payload

type Payload struct {
	SeqNum               uint64   `protobuf:"varint,1,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	PrivateData          [][]byte `protobuf:"bytes,3,rep,name=private_data,json=privateData,proto3" json:"private_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

有效负载包含一个块

func (*Payload) Descriptor

func (*Payload) Descriptor() ([]byte, []int)

func (*Payload) GetData

func (m *Payload) GetData() []byte

func (*Payload) GetPrivateData

func (m *Payload) GetPrivateData() [][]byte

func (*Payload) GetSeqNum

func (m *Payload) GetSeqNum() uint64

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) String

func (m *Payload) String() string

func (*Payload) XXX_DiscardUnknown

func (m *Payload) XXX_DiscardUnknown()

func (*Payload) XXX_Marshal

func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Payload) XXX_Merge

func (dst *Payload) XXX_Merge(src proto.Message)

func (*Payload) XXX_Size

func (m *Payload) XXX_Size() int

func (*Payload) XXX_Unmarshal

func (m *Payload) XXX_Unmarshal(b []byte) error

type PeerIdentity

type PeerIdentity struct {
	PkiId                []byte   `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"`
	Cert                 []byte   `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"`
	Metadata             []byte   `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

对等身份定义对等身份 用来让其他同龄人了解身份 某个同伴的

func (*PeerIdentity) Descriptor

func (*PeerIdentity) Descriptor() ([]byte, []int)

func (*PeerIdentity) GetCert

func (m *PeerIdentity) GetCert() []byte

func (*PeerIdentity) GetMetadata

func (m *PeerIdentity) GetMetadata() []byte

func (*PeerIdentity) GetPkiId

func (m *PeerIdentity) GetPkiId() []byte

func (*PeerIdentity) ProtoMessage

func (*PeerIdentity) ProtoMessage()

func (*PeerIdentity) Reset

func (m *PeerIdentity) Reset()

func (*PeerIdentity) String

func (m *PeerIdentity) String() string

func (*PeerIdentity) XXX_DiscardUnknown

func (m *PeerIdentity) XXX_DiscardUnknown()

func (*PeerIdentity) XXX_Marshal

func (m *PeerIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerIdentity) XXX_Merge

func (dst *PeerIdentity) XXX_Merge(src proto.Message)

func (*PeerIdentity) XXX_Size

func (m *PeerIdentity) XXX_Size() int

func (*PeerIdentity) XXX_Unmarshal

func (m *PeerIdentity) XXX_Unmarshal(b []byte) error

type PeerTime

type PeerTime struct {
	IncNum               uint64   `protobuf:"varint,1,opt,name=inc_num,json=incNum,proto3" json:"inc_num,omitempty"`
	SeqNum               uint64   `protobuf:"varint,2,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

对等时间定义对等生命的逻辑时间

func (*PeerTime) Descriptor

func (*PeerTime) Descriptor() ([]byte, []int)

func (*PeerTime) GetIncNum

func (m *PeerTime) GetIncNum() uint64

func (*PeerTime) GetSeqNum

func (m *PeerTime) GetSeqNum() uint64

func (*PeerTime) ProtoMessage

func (*PeerTime) ProtoMessage()

func (*PeerTime) Reset

func (m *PeerTime) Reset()

func (*PeerTime) String

func (m *PeerTime) String() string

func (*PeerTime) XXX_DiscardUnknown

func (m *PeerTime) XXX_DiscardUnknown()

func (*PeerTime) XXX_Marshal

func (m *PeerTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerTime) XXX_Merge

func (dst *PeerTime) XXX_Merge(src proto.Message)

func (*PeerTime) XXX_Size

func (m *PeerTime) XXX_Size() int

func (*PeerTime) XXX_Unmarshal

func (m *PeerTime) XXX_Unmarshal(b []byte) error

type PrivateDataMessage

type PrivateDataMessage struct {
	Payload              *PrivatePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

包含private的privatedatamessage消息 向分布式一次事务发送数据信息 已背书

func (*PrivateDataMessage) Descriptor

func (*PrivateDataMessage) Descriptor() ([]byte, []int)

func (*PrivateDataMessage) GetPayload

func (m *PrivateDataMessage) GetPayload() *PrivatePayload

func (*PrivateDataMessage) ProtoMessage

func (*PrivateDataMessage) ProtoMessage()

func (*PrivateDataMessage) Reset

func (m *PrivateDataMessage) Reset()

func (*PrivateDataMessage) String

func (m *PrivateDataMessage) String() string

func (*PrivateDataMessage) XXX_DiscardUnknown

func (m *PrivateDataMessage) XXX_DiscardUnknown()

func (*PrivateDataMessage) XXX_Marshal

func (m *PrivateDataMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrivateDataMessage) XXX_Merge

func (dst *PrivateDataMessage) XXX_Merge(src proto.Message)

func (*PrivateDataMessage) XXX_Size

func (m *PrivateDataMessage) XXX_Size() int

func (*PrivateDataMessage) XXX_Unmarshal

func (m *PrivateDataMessage) XXX_Unmarshal(b []byte) error

type PrivatePayload

type PrivatePayload struct {
	CollectionName       string                          `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"`
	Namespace            string                          `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	TxId                 string                          `protobuf:"bytes,3,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"`
	PrivateRwset         []byte                          `protobuf:"bytes,4,opt,name=private_rwset,json=privateRwset,proto3" json:"private_rwset,omitempty"`
	PrivateSimHeight     uint64                          `protobuf:"varint,5,opt,name=private_sim_height,json=privateSimHeight,proto3" json:"private_sim_height,omitempty"`
	CollectionConfigs    *common.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collection_configs,json=collectionConfigs,proto3" json:"collection_configs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                        `json:"-"`
	XXX_unrecognized     []byte                          `json:"-"`
	XXX_sizecache        int32                           `json:"-"`
}

privatePayload有效载荷用于封装private 具有集合名称的数据以启用路由 基于集合分区

func (*PrivatePayload) Descriptor

func (*PrivatePayload) Descriptor() ([]byte, []int)

func (*PrivatePayload) GetCollectionConfigs

func (m *PrivatePayload) GetCollectionConfigs() *common.CollectionConfigPackage

func (*PrivatePayload) GetCollectionName

func (m *PrivatePayload) GetCollectionName() string

func (*PrivatePayload) GetNamespace

func (m *PrivatePayload) GetNamespace() string

func (*PrivatePayload) GetPrivateRwset

func (m *PrivatePayload) GetPrivateRwset() []byte

func (*PrivatePayload) GetPrivateSimHeight

func (m *PrivatePayload) GetPrivateSimHeight() uint64

func (*PrivatePayload) GetTxId

func (m *PrivatePayload) GetTxId() string

func (*PrivatePayload) ProtoMessage

func (*PrivatePayload) ProtoMessage()

func (*PrivatePayload) Reset

func (m *PrivatePayload) Reset()

func (*PrivatePayload) String

func (m *PrivatePayload) String() string

func (*PrivatePayload) XXX_DiscardUnknown

func (m *PrivatePayload) XXX_DiscardUnknown()

func (*PrivatePayload) XXX_Marshal

func (m *PrivatePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrivatePayload) XXX_Merge

func (dst *PrivatePayload) XXX_Merge(src proto.Message)

func (*PrivatePayload) XXX_Size

func (m *PrivatePayload) XXX_Size() int

func (*PrivatePayload) XXX_Unmarshal

func (m *PrivatePayload) XXX_Unmarshal(b []byte) error

type Properties

type Properties struct {
	LedgerHeight         uint64       `protobuf:"varint,1,opt,name=ledger_height,json=ledgerHeight,proto3" json:"ledger_height,omitempty"`
	LeftChannel          bool         `protobuf:"varint,2,opt,name=left_channel,json=leftChannel,proto3" json:"left_channel,omitempty"`
	Chaincodes           []*Chaincode `protobuf:"bytes,3,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*Properties) Descriptor

func (*Properties) Descriptor() ([]byte, []int)

func (*Properties) GetChaincodes

func (m *Properties) GetChaincodes() []*Chaincode

func (*Properties) GetLedgerHeight

func (m *Properties) GetLedgerHeight() uint64

func (*Properties) GetLeftChannel

func (m *Properties) GetLeftChannel() bool

func (*Properties) ProtoMessage

func (*Properties) ProtoMessage()

func (*Properties) Reset

func (m *Properties) Reset()

func (*Properties) String

func (m *Properties) String() string

func (*Properties) XXX_DiscardUnknown

func (m *Properties) XXX_DiscardUnknown()

func (*Properties) XXX_Marshal

func (m *Properties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Properties) XXX_Merge

func (dst *Properties) XXX_Merge(src proto.Message)

func (*Properties) XXX_Size

func (m *Properties) XXX_Size() int

func (*Properties) XXX_Unmarshal

func (m *Properties) XXX_Unmarshal(b []byte) error

type PullMsgType

type PullMsgType int32
const (
	PullMsgType_UNDEFINED    PullMsgType = 0
	PullMsgType_BLOCK_MSG    PullMsgType = 1
	PullMsgType_IDENTITY_MSG PullMsgType = 2
)

func (PullMsgType) EnumDescriptor

func (PullMsgType) EnumDescriptor() ([]byte, []int)

func (PullMsgType) String

func (x PullMsgType) String() string

type PvtDataDigest

type PvtDataDigest struct {
	TxId                 string   `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"`
	Namespace            string   `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Collection           string   `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"`
	BlockSeq             uint64   `protobuf:"varint,4,opt,name=block_seq,json=blockSeq,proto3" json:"block_seq,omitempty"`
	SeqInBlock           uint64   `protobuf:"varint,5,opt,name=seq_in_block,json=seqInBlock,proto3" json:"seq_in_block,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

pvtDataDigest定义私有数据摘要

func (*PvtDataDigest) Descriptor

func (*PvtDataDigest) Descriptor() ([]byte, []int)

func (*PvtDataDigest) GetBlockSeq

func (m *PvtDataDigest) GetBlockSeq() uint64

func (*PvtDataDigest) GetCollection

func (m *PvtDataDigest) GetCollection() string

func (*PvtDataDigest) GetNamespace

func (m *PvtDataDigest) GetNamespace() string

func (*PvtDataDigest) GetSeqInBlock

func (m *PvtDataDigest) GetSeqInBlock() uint64

func (*PvtDataDigest) GetTxId

func (m *PvtDataDigest) GetTxId() string

func (*PvtDataDigest) Hash

func (dig *PvtDataDigest) Hash() (string, error)

hash返回pvtDataDigest字节的sha256表示形式

func (*PvtDataDigest) ProtoMessage

func (*PvtDataDigest) ProtoMessage()

func (*PvtDataDigest) Reset

func (m *PvtDataDigest) Reset()

func (*PvtDataDigest) String

func (m *PvtDataDigest) String() string

func (*PvtDataDigest) XXX_DiscardUnknown

func (m *PvtDataDigest) XXX_DiscardUnknown()

func (*PvtDataDigest) XXX_Marshal

func (m *PvtDataDigest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PvtDataDigest) XXX_Merge

func (dst *PvtDataDigest) XXX_Merge(src proto.Message)

func (*PvtDataDigest) XXX_Size

func (m *PvtDataDigest) XXX_Size() int

func (*PvtDataDigest) XXX_Unmarshal

func (m *PvtDataDigest) XXX_Unmarshal(b []byte) error

type PvtDataElement

type PvtDataElement struct {
	Digest *PvtDataDigest `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	//有效负载是封送的kvrwset.kvrwset
	Payload              [][]byte `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PvtDataElement) Descriptor

func (*PvtDataElement) Descriptor() ([]byte, []int)

func (*PvtDataElement) GetDigest

func (m *PvtDataElement) GetDigest() *PvtDataDigest

func (*PvtDataElement) GetPayload

func (m *PvtDataElement) GetPayload() [][]byte

func (*PvtDataElement) ProtoMessage

func (*PvtDataElement) ProtoMessage()

func (*PvtDataElement) Reset

func (m *PvtDataElement) Reset()

func (*PvtDataElement) String

func (m *PvtDataElement) String() string

func (*PvtDataElement) XXX_DiscardUnknown

func (m *PvtDataElement) XXX_DiscardUnknown()

func (*PvtDataElement) XXX_Marshal

func (m *PvtDataElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PvtDataElement) XXX_Merge

func (dst *PvtDataElement) XXX_Merge(src proto.Message)

func (*PvtDataElement) XXX_Size

func (m *PvtDataElement) XXX_Size() int

func (*PvtDataElement) XXX_Unmarshal

func (m *PvtDataElement) XXX_Unmarshal(b []byte) error

type PvtDataPayload

type PvtDataPayload struct {
	TxSeqInBlock uint64 `protobuf:"varint,1,opt,name=tx_seq_in_block,json=txSeqInBlock,proto3" json:"tx_seq_in_block,omitempty"`
	//对rwset.txpvtreadwriteset的marhslaed字节进行编码
	//在rwset.proto中定义
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

pvtpayload增加了私有rwset数据和tx索引 在街区内

func (*PvtDataPayload) Descriptor

func (*PvtDataPayload) Descriptor() ([]byte, []int)

func (*PvtDataPayload) GetPayload

func (m *PvtDataPayload) GetPayload() []byte

func (*PvtDataPayload) GetTxSeqInBlock

func (m *PvtDataPayload) GetTxSeqInBlock() uint64

func (*PvtDataPayload) ProtoMessage

func (*PvtDataPayload) ProtoMessage()

func (*PvtDataPayload) Reset

func (m *PvtDataPayload) Reset()

func (*PvtDataPayload) String

func (m *PvtDataPayload) String() string

func (*PvtDataPayload) XXX_DiscardUnknown

func (m *PvtDataPayload) XXX_DiscardUnknown()

func (*PvtDataPayload) XXX_Marshal

func (m *PvtDataPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PvtDataPayload) XXX_Merge

func (dst *PvtDataPayload) XXX_Merge(src proto.Message)

func (*PvtDataPayload) XXX_Size

func (m *PvtDataPayload) XXX_Size() int

func (*PvtDataPayload) XXX_Unmarshal

func (m *PvtDataPayload) XXX_Unmarshal(b []byte) error

type ReceivedMessage

type ReceivedMessage interface {

	//response将一条八卦消息发送到发送此接收消息的来源。
	Respond(msg *GossipMessage)

	//GetGossipMessage返回基础的GossipMessage
	GetGossipMessage() *SignedGossipMessage

	//GetSourceMessage返回接收到的消息所在的信封
	//建筑用
	GetSourceEnvelope() *Envelope

	//getConnectionInfo返回有关远程对等机的信息
	//发出信息的
	GetConnectionInfo() *ConnectionInfo

	//ACK向发送方返回消息确认
	//ACK可以接收一个错误,该错误指示与操作相关
	//到消息失败
	Ack(err error)
}

ReceivedMessage是一个八卦消息包装器, 允许用户将消息发送到来源 接收到的消息是从发送的。 它还允许知道发送者的身份, 要获取未封送gossipMessage的原始字节, 以及这些原始字节上的签名。

type RemotePvtDataRequest

type RemotePvtDataRequest struct {
	Digests              []*PvtDataDigest `protobuf:"bytes,1,rep,name=digests,proto3" json:"digests,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

用于请求的RemotePrivateDataRequest消息 缺少private rwset

func (*RemotePvtDataRequest) Descriptor

func (*RemotePvtDataRequest) Descriptor() ([]byte, []int)

func (*RemotePvtDataRequest) GetDigests

func (m *RemotePvtDataRequest) GetDigests() []*PvtDataDigest

func (*RemotePvtDataRequest) ProtoMessage

func (*RemotePvtDataRequest) ProtoMessage()

func (*RemotePvtDataRequest) Reset

func (m *RemotePvtDataRequest) Reset()

func (*RemotePvtDataRequest) String

func (m *RemotePvtDataRequest) String() string

func (*RemotePvtDataRequest) XXX_DiscardUnknown

func (m *RemotePvtDataRequest) XXX_DiscardUnknown()

func (*RemotePvtDataRequest) XXX_Marshal

func (m *RemotePvtDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemotePvtDataRequest) XXX_Merge

func (dst *RemotePvtDataRequest) XXX_Merge(src proto.Message)

func (*RemotePvtDataRequest) XXX_Size

func (m *RemotePvtDataRequest) XXX_Size() int

func (*RemotePvtDataRequest) XXX_Unmarshal

func (m *RemotePvtDataRequest) XXX_Unmarshal(b []byte) error

type RemotePvtDataResponse

type RemotePvtDataResponse struct {
	Elements             []*PvtDataElement `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

要在专用服务器上响应的RemotePrivateData消息 数据复制请求

func (*RemotePvtDataResponse) Descriptor

func (*RemotePvtDataResponse) Descriptor() ([]byte, []int)

func (*RemotePvtDataResponse) GetElements

func (m *RemotePvtDataResponse) GetElements() []*PvtDataElement

func (*RemotePvtDataResponse) ProtoMessage

func (*RemotePvtDataResponse) ProtoMessage()

func (*RemotePvtDataResponse) Reset

func (m *RemotePvtDataResponse) Reset()

func (*RemotePvtDataResponse) String

func (m *RemotePvtDataResponse) String() string

func (*RemotePvtDataResponse) ToString

func (res *RemotePvtDataResponse) ToString() string

ToString返回此RemotePvtDataResponse的字符串表示形式

func (*RemotePvtDataResponse) XXX_DiscardUnknown

func (m *RemotePvtDataResponse) XXX_DiscardUnknown()

func (*RemotePvtDataResponse) XXX_Marshal

func (m *RemotePvtDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemotePvtDataResponse) XXX_Merge

func (dst *RemotePvtDataResponse) XXX_Merge(src proto.Message)

func (*RemotePvtDataResponse) XXX_Size

func (m *RemotePvtDataResponse) XXX_Size() int

func (*RemotePvtDataResponse) XXX_Unmarshal

func (m *RemotePvtDataResponse) XXX_Unmarshal(b []byte) error

type RemoteStateRequest

type RemoteStateRequest struct {
	StartSeqNum          uint64   `protobuf:"varint,1,opt,name=start_seq_num,json=startSeqNum,proto3" json:"start_seq_num,omitempty"`
	EndSeqNum            uint64   `protobuf:"varint,2,opt,name=end_seq_num,json=endSeqNum,proto3" json:"end_seq_num,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RemoteStateRequest用于请求一组块 从远程对等机

func (*RemoteStateRequest) Descriptor

func (*RemoteStateRequest) Descriptor() ([]byte, []int)

func (*RemoteStateRequest) GetEndSeqNum

func (m *RemoteStateRequest) GetEndSeqNum() uint64

func (*RemoteStateRequest) GetStartSeqNum

func (m *RemoteStateRequest) GetStartSeqNum() uint64

func (*RemoteStateRequest) ProtoMessage

func (*RemoteStateRequest) ProtoMessage()

func (*RemoteStateRequest) Reset

func (m *RemoteStateRequest) Reset()

func (*RemoteStateRequest) String

func (m *RemoteStateRequest) String() string

func (*RemoteStateRequest) XXX_DiscardUnknown

func (m *RemoteStateRequest) XXX_DiscardUnknown()

func (*RemoteStateRequest) XXX_Marshal

func (m *RemoteStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoteStateRequest) XXX_Merge

func (dst *RemoteStateRequest) XXX_Merge(src proto.Message)

func (*RemoteStateRequest) XXX_Size

func (m *RemoteStateRequest) XXX_Size() int

func (*RemoteStateRequest) XXX_Unmarshal

func (m *RemoteStateRequest) XXX_Unmarshal(b []byte) error

type RemoteStateResponse

type RemoteStateResponse struct {
	Payloads             []*Payload `protobuf:"bytes,1,rep,name=payloads,proto3" json:"payloads,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

RemoteStateResponse用于发送一组块 到远程对等机

func (*RemoteStateResponse) Descriptor

func (*RemoteStateResponse) Descriptor() ([]byte, []int)

func (*RemoteStateResponse) GetPayloads

func (m *RemoteStateResponse) GetPayloads() []*Payload

func (*RemoteStateResponse) ProtoMessage

func (*RemoteStateResponse) ProtoMessage()

func (*RemoteStateResponse) Reset

func (m *RemoteStateResponse) Reset()

func (*RemoteStateResponse) String

func (m *RemoteStateResponse) String() string

func (*RemoteStateResponse) XXX_DiscardUnknown

func (m *RemoteStateResponse) XXX_DiscardUnknown()

func (*RemoteStateResponse) XXX_Marshal

func (m *RemoteStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoteStateResponse) XXX_Merge

func (dst *RemoteStateResponse) XXX_Merge(src proto.Message)

func (*RemoteStateResponse) XXX_Size

func (m *RemoteStateResponse) XXX_Size() int

func (*RemoteStateResponse) XXX_Unmarshal

func (m *RemoteStateResponse) XXX_Unmarshal(b []byte) error

type Secret

type Secret struct {
	//有效分配给内容的类型:
	//*机密\u InternalEndpoint
	Content              isSecret_Content `protobuf_oneof:"content"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

秘密是一个可以省略的实体 当远程对等机接收到 信封不应该知道秘密的内容。

func (*Secret) Descriptor

func (*Secret) Descriptor() ([]byte, []int)

func (*Secret) GetContent

func (m *Secret) GetContent() isSecret_Content

func (*Secret) GetInternalEndpoint

func (m *Secret) GetInternalEndpoint() string

func (*Secret) ProtoMessage

func (*Secret) ProtoMessage()

func (*Secret) Reset

func (m *Secret) Reset()

func (*Secret) String

func (m *Secret) String() string

func (*Secret) XXX_DiscardUnknown

func (m *Secret) XXX_DiscardUnknown()

func (*Secret) XXX_Marshal

func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Secret) XXX_Merge

func (dst *Secret) XXX_Merge(src proto.Message)

func (*Secret) XXX_OneofFuncs

func (*Secret) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

xxxoneoffuncs用于Proto包的内部使用。

func (*Secret) XXX_Size

func (m *Secret) XXX_Size() int

func (*Secret) XXX_Unmarshal

func (m *Secret) XXX_Unmarshal(b []byte) error

type SecretEnvelope

type SecretEnvelope struct {
	Payload              []byte   `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	Signature            []byte   `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

秘密私藏是一个秘密 还有上面的签名。 签名应由对等方验证 在信封上签名的秘密信封 来了

func (*SecretEnvelope) Descriptor

func (*SecretEnvelope) Descriptor() ([]byte, []int)

func (*SecretEnvelope) GetPayload

func (m *SecretEnvelope) GetPayload() []byte

func (*SecretEnvelope) GetSignature

func (m *SecretEnvelope) GetSignature() []byte

func (*SecretEnvelope) InternalEndpoint

func (s *SecretEnvelope) InternalEndpoint() string

InternalEndpoint返回内部终结点 在秘密信封或空字符串中 如果发生故障。

func (*SecretEnvelope) ProtoMessage

func (*SecretEnvelope) ProtoMessage()

func (*SecretEnvelope) Reset

func (m *SecretEnvelope) Reset()

func (*SecretEnvelope) String

func (m *SecretEnvelope) String() string

func (*SecretEnvelope) XXX_DiscardUnknown

func (m *SecretEnvelope) XXX_DiscardUnknown()

func (*SecretEnvelope) XXX_Marshal

func (m *SecretEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SecretEnvelope) XXX_Merge

func (dst *SecretEnvelope) XXX_Merge(src proto.Message)

func (*SecretEnvelope) XXX_Size

func (m *SecretEnvelope) XXX_Size() int

func (*SecretEnvelope) XXX_Unmarshal

func (m *SecretEnvelope) XXX_Unmarshal(b []byte) error

type Secret_InternalEndpoint

type Secret_InternalEndpoint struct {
	InternalEndpoint string `protobuf:"bytes,1,opt,name=internalEndpoint,proto3,oneof"`
}

type SignedGossipMessage

type SignedGossipMessage struct {
	*Envelope
	*GossipMessage
}

SignedGossipMessage包含一个八卦消息 以及它来自的信封

func (*SignedGossipMessage) IsSigned

func (m *SignedGossipMessage) IsSigned() bool

ISSIGNED返回消息 信封上有签名。

func (*SignedGossipMessage) Sign

func (m *SignedGossipMessage) Sign(signer Signer) (*Envelope, error)

签名与给定的签名者签署流言蜚语。 成功时返回信封, 失败时的恐慌。

func (*SignedGossipMessage) String

func (m *SignedGossipMessage) String() string

字符串返回字符串表示形式 已签名的邮件

func (*SignedGossipMessage) Verify

func (m *SignedGossipMessage) Verify(peerIdentity []byte, verify Verifier) error

verify使用给定的验证器验证签名的八卦消息。 成功时返回零,失败时返回错误。

type Signer

type Signer func(msg []byte) ([]byte, error)

签名者在消息上签名,然后返回(签名,无) 成功时,零,失败时出错。

type StateInfo

type StateInfo struct {
	Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	PkiId     []byte    `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"`
	//channel_mac是验证
	//发送此消息的对等方知道
	//频道的名称。
	Channel_MAC          []byte      `protobuf:"bytes,4,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"`
	Properties           *Properties `protobuf:"bytes,5,opt,name=properties,proto3" json:"properties,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

stateinfo用于对等机中继其状态信息。 对其他同行

func (*StateInfo) Descriptor

func (*StateInfo) Descriptor() ([]byte, []int)

func (*StateInfo) GetChannel_MAC

func (m *StateInfo) GetChannel_MAC() []byte

func (*StateInfo) GetPkiId

func (m *StateInfo) GetPkiId() []byte

func (*StateInfo) GetProperties

func (m *StateInfo) GetProperties() *Properties

func (*StateInfo) GetTimestamp

func (m *StateInfo) GetTimestamp() *PeerTime

func (*StateInfo) LedgerHeight

func (msg *StateInfo) LedgerHeight() (uint64, error)

LedgerHeight返回指定的分类帐高度 在StateInfo消息中

func (*StateInfo) ProtoMessage

func (*StateInfo) ProtoMessage()

func (*StateInfo) Reset

func (m *StateInfo) Reset()

func (*StateInfo) String

func (m *StateInfo) String() string

func (*StateInfo) XXX_DiscardUnknown

func (m *StateInfo) XXX_DiscardUnknown()

func (*StateInfo) XXX_Marshal

func (m *StateInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StateInfo) XXX_Merge

func (dst *StateInfo) XXX_Merge(src proto.Message)

func (*StateInfo) XXX_Size

func (m *StateInfo) XXX_Size() int

func (*StateInfo) XXX_Unmarshal

func (m *StateInfo) XXX_Unmarshal(b []byte) error

type StateInfoPullRequest

type StateInfoPullRequest struct {
	//channel_mac是验证
	//发送此消息的对等方知道
	//频道的名称。
	Channel_MAC          []byte   `protobuf:"bytes,1,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StateInfoPullRequest用于获取StateInfoSnapshot 从远程对等机

func (*StateInfoPullRequest) Descriptor

func (*StateInfoPullRequest) Descriptor() ([]byte, []int)

func (*StateInfoPullRequest) GetChannel_MAC

func (m *StateInfoPullRequest) GetChannel_MAC() []byte

func (*StateInfoPullRequest) ProtoMessage

func (*StateInfoPullRequest) ProtoMessage()

func (*StateInfoPullRequest) Reset

func (m *StateInfoPullRequest) Reset()

func (*StateInfoPullRequest) String

func (m *StateInfoPullRequest) String() string

func (*StateInfoPullRequest) XXX_DiscardUnknown

func (m *StateInfoPullRequest) XXX_DiscardUnknown()

func (*StateInfoPullRequest) XXX_Marshal

func (m *StateInfoPullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StateInfoPullRequest) XXX_Merge

func (dst *StateInfoPullRequest) XXX_Merge(src proto.Message)

func (*StateInfoPullRequest) XXX_Size

func (m *StateInfoPullRequest) XXX_Size() int

func (*StateInfoPullRequest) XXX_Unmarshal

func (m *StateInfoPullRequest) XXX_Unmarshal(b []byte) error

type StateInfoSnapshot

type StateInfoSnapshot struct {
	Elements             []*Envelope `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

StateInfoSnapshot是StateInfo消息的聚合

func (*StateInfoSnapshot) Descriptor

func (*StateInfoSnapshot) Descriptor() ([]byte, []int)

func (*StateInfoSnapshot) GetElements

func (m *StateInfoSnapshot) GetElements() []*Envelope

func (*StateInfoSnapshot) ProtoMessage

func (*StateInfoSnapshot) ProtoMessage()

func (*StateInfoSnapshot) Reset

func (m *StateInfoSnapshot) Reset()

func (*StateInfoSnapshot) String

func (m *StateInfoSnapshot) String() string

func (*StateInfoSnapshot) XXX_DiscardUnknown

func (m *StateInfoSnapshot) XXX_DiscardUnknown()

func (*StateInfoSnapshot) XXX_Marshal

func (m *StateInfoSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StateInfoSnapshot) XXX_Merge

func (dst *StateInfoSnapshot) XXX_Merge(src proto.Message)

func (*StateInfoSnapshot) XXX_Size

func (m *StateInfoSnapshot) XXX_Size() int

func (*StateInfoSnapshot) XXX_Unmarshal

func (m *StateInfoSnapshot) XXX_Unmarshal(b []byte) error

type Verifier

type Verifier func(peerIdentity []byte, signature, message []byte) error

验证程序接收对等身份、签名和消息 如果消息上的签名可以验证,则返回nil 使用给定的标识。

Jump to

Keyboard shortcuts

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