Documentation ¶
Overview ¶
Package proto is a generated protocol buffer package.
It is generated from these files:
message.proto
It has these top-level messages:
GossipMessage StateInfo StateInfoSnapshot StateInfoPullRequest ConnEstablish PeerIdentity DataRequest GossipHello DataUpdate DataDigest DataMessage Payload AliveMessage LeadershipMessage PeerTime MembershipRequest MembershipResponse Member Empty RemoteStateRequest RemoteStateResponse
Index ¶
- Variables
- func NewGossipMessageComparator(dataBlockStorageSize int) common.MessageReplacingPolicy
- func RegisterGossipServer(s *grpc.Server, srv GossipServer)
- type AliveMessage
- type ConnEstablish
- type DataDigest
- type DataMessage
- type DataRequest
- type DataUpdate
- type Empty
- type GossipClient
- type GossipHello
- type GossipMessage
- func (*GossipMessage) Descriptor() ([]byte, []int)
- func (m *GossipMessage) GetAliveMsg() *AliveMessage
- func (m *GossipMessage) GetConn() *ConnEstablish
- func (m *GossipMessage) GetContent() isGossipMessage_Content
- func (m *GossipMessage) GetDataDig() *DataDigest
- func (m *GossipMessage) GetDataMsg() *DataMessage
- func (m *GossipMessage) GetDataReq() *DataRequest
- func (m *GossipMessage) GetDataUpdate() *DataUpdate
- func (m *GossipMessage) GetEmpty() *Empty
- func (m *GossipMessage) GetHello() *GossipHello
- func (m *GossipMessage) GetLeadershipMsg() *LeadershipMessage
- func (m *GossipMessage) GetMemReq() *MembershipRequest
- func (m *GossipMessage) GetMemRes() *MembershipResponse
- func (m *GossipMessage) GetPeerIdentity() *PeerIdentity
- func (m *GossipMessage) GetPullMsgType() PullMsgType
- func (m *GossipMessage) GetStateInfo() *StateInfo
- func (m *GossipMessage) GetStateInfoPullReq() *StateInfoPullRequest
- func (m *GossipMessage) GetStateRequest() *RemoteStateRequest
- func (m *GossipMessage) GetStateResponse() *RemoteStateResponse
- func (m *GossipMessage) GetStateSnapshot() *StateInfoSnapshot
- func (m *GossipMessage) IsAliveMsg() bool
- func (m *GossipMessage) IsChannelRestricted() bool
- func (m *GossipMessage) IsDataMsg() bool
- func (m *GossipMessage) IsDataReq() bool
- func (m *GossipMessage) IsDataUpdate() bool
- func (m *GossipMessage) IsDigestMsg() bool
- func (m *GossipMessage) IsHelloMsg() bool
- func (m *GossipMessage) IsIdentityMsg() bool
- func (m *GossipMessage) IsLeadershipMsg() bool
- func (m *GossipMessage) IsOrgRestricted() bool
- func (m *GossipMessage) IsPullMsg() bool
- func (m *GossipMessage) IsRemoteStateMessage() bool
- func (m *GossipMessage) IsStateInfoMsg() bool
- func (m *GossipMessage) IsStateInfoPullRequestMsg() bool
- func (m *GossipMessage) IsStateInfoSnapshot() bool
- func (m *GossipMessage) IsTagLegal() error
- func (*GossipMessage) ProtoMessage()
- func (m *GossipMessage) Reset()
- func (m *GossipMessage) Sign(signer Signer) error
- func (m *GossipMessage) String() string
- func (m *GossipMessage) Verify(peerIdentity []byte, verify Verifier) error
- func (*GossipMessage) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, ...)
- type GossipMessage_AliveMsg
- type GossipMessage_Conn
- type GossipMessage_DataDig
- type GossipMessage_DataMsg
- type GossipMessage_DataReq
- type GossipMessage_DataUpdate
- type GossipMessage_Empty
- type GossipMessage_Hello
- type GossipMessage_LeadershipMsg
- type GossipMessage_MemReq
- type GossipMessage_MemRes
- type GossipMessage_PeerIdentity
- type GossipMessage_StateInfo
- type GossipMessage_StateInfoPullReq
- type GossipMessage_StateRequest
- type GossipMessage_StateResponse
- type GossipMessage_StateSnapshot
- type GossipMessage_Tag
- type GossipServer
- type Gossip_GossipStreamClient
- type Gossip_GossipStreamServer
- type IdentifierExtractor
- type LeadershipMessage
- type Member
- type MembershipRequest
- type MembershipResponse
- type MsgConsumer
- type Payload
- type PeerIdentity
- type PeerTime
- type PullMsgType
- type RemoteStateRequest
- type RemoteStateResponse
- type Signer
- type StateInfo
- type StateInfoPullRequest
- type StateInfoSnapshot
- type Verifier
Constants ¶
This section is empty.
Variables ¶
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",
}
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,
}
var PullMsgType_name = map[int32]string{
0: "Undefined",
1: "BlockMessage",
2: "IdentityMsg",
}
var PullMsgType_value = map[string]int32{
"Undefined": 0,
"BlockMessage": 1,
"IdentityMsg": 2,
}
Functions ¶
func NewGossipMessageComparator ¶
func NewGossipMessageComparator(dataBlockStorageSize int) common.MessageReplacingPolicy
NewGossipMessageComparator creates a MessageReplacingPolicy given a maximum number of blocks to hold
func RegisterGossipServer ¶
func RegisterGossipServer(s *grpc.Server, srv GossipServer)
Types ¶
type AliveMessage ¶
type AliveMessage struct { Membership *Member `protobuf:"bytes,1,opt,name=membership" json:"membership,omitempty"` Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` Identity []byte `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` }
AliveMessage is sent to inform remote peers of a peer's existence and activity
func (*AliveMessage) Descriptor ¶
func (*AliveMessage) Descriptor() ([]byte, []int)
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
type ConnEstablish ¶
type ConnEstablish struct { PkiID []byte `protobuf:"bytes,1,opt,name=pkiID,proto3" json:"pkiID,omitempty"` Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"` Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` }
ConnEstablish is the message used for the gossip handshake Whenever a peer connects to another peer, it handshakes with it by sending this message that proves its identity
func (*ConnEstablish) Descriptor ¶
func (*ConnEstablish) Descriptor() ([]byte, []int)
func (*ConnEstablish) ProtoMessage ¶
func (*ConnEstablish) ProtoMessage()
func (*ConnEstablish) Reset ¶
func (m *ConnEstablish) Reset()
func (*ConnEstablish) String ¶
func (m *ConnEstablish) String() string
type DataDigest ¶
type DataDigest struct { Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` Digests []string `protobuf:"bytes,2,rep,name=digests" json:"digests,omitempty"` MsgType PullMsgType `protobuf:"varint,3,opt,name=msgType,enum=proto.PullMsgType" json:"msgType,omitempty"` }
DataDigest is the message sent from the receiver peer to the initator peer and contains the data items it has
func (*DataDigest) Descriptor ¶
func (*DataDigest) Descriptor() ([]byte, []int)
func (*DataDigest) ProtoMessage ¶
func (*DataDigest) ProtoMessage()
func (*DataDigest) Reset ¶
func (m *DataDigest) Reset()
func (*DataDigest) String ¶
func (m *DataDigest) String() string
type DataMessage ¶
type DataMessage struct {
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}
DataMessage is the message that contains a block
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
type DataRequest ¶
type DataRequest struct { Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` Digests []string `protobuf:"bytes,2,rep,name=digests" json:"digests,omitempty"` MsgType PullMsgType `protobuf:"varint,3,opt,name=msgType,enum=proto.PullMsgType" json:"msgType,omitempty"` }
DataRequest is a message used for a peer to request certain data blocks from a remote peer
func (*DataRequest) Descriptor ¶
func (*DataRequest) Descriptor() ([]byte, []int)
func (*DataRequest) ProtoMessage ¶
func (*DataRequest) ProtoMessage()
func (*DataRequest) Reset ¶
func (m *DataRequest) Reset()
func (*DataRequest) String ¶
func (m *DataRequest) String() string
type DataUpdate ¶
type DataUpdate struct { Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` Data []*GossipMessage `protobuf:"bytes,2,rep,name=data" json:"data,omitempty"` MsgType PullMsgType `protobuf:"varint,3,opt,name=msgType,enum=proto.PullMsgType" json:"msgType,omitempty"` }
DataUpdate is the the final message in the pull phase sent from the receiver to the initiator
func (*DataUpdate) Descriptor ¶
func (*DataUpdate) Descriptor() ([]byte, []int)
func (*DataUpdate) GetData ¶
func (m *DataUpdate) GetData() []*GossipMessage
func (*DataUpdate) ProtoMessage ¶
func (*DataUpdate) ProtoMessage()
func (*DataUpdate) Reset ¶
func (m *DataUpdate) Reset()
func (*DataUpdate) String ¶
func (m *DataUpdate) String() string
type Empty ¶
type Empty struct { }
Empty is used for pinging and in tests
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type GossipClient ¶
type GossipClient interface { // GossipStream is the gRPC stream used for sending and receiving messages GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error) // Ping is used to probe a remote peer's aliveness Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) }
func NewGossipClient ¶
func NewGossipClient(cc *grpc.ClientConn) GossipClient
type GossipHello ¶
type GossipHello struct { Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` MsgType PullMsgType `protobuf:"varint,3,opt,name=msgType,enum=proto.PullMsgType" json:"msgType,omitempty"` }
GossipHello is the message that is used for the peer to initiate a pull round with another peer
func (*GossipHello) Descriptor ¶
func (*GossipHello) Descriptor() ([]byte, []int)
func (*GossipHello) ProtoMessage ¶
func (*GossipHello) ProtoMessage()
func (*GossipHello) Reset ¶
func (m *GossipHello) Reset()
func (*GossipHello) String ¶
func (m *GossipHello) String() string
type GossipMessage ¶
type GossipMessage struct { // used mainly for testing, but will might be used in the future // for ensuring message delivery by acking Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` // The channel of the message. // Some GossipMessages may set this to nil, because // they are cross-channels but some may not Channel []byte `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` // determines to which peers it is allowed // to forward the message Tag GossipMessage_Tag `protobuf:"varint,3,opt,name=tag,enum=proto.GossipMessage_Tag" json:"tag,omitempty"` Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` // Types that are valid to be assigned to Content: // *GossipMessage_AliveMsg // *GossipMessage_MemReq // *GossipMessage_MemRes // *GossipMessage_DataMsg // *GossipMessage_Hello // *GossipMessage_DataDig // *GossipMessage_DataReq // *GossipMessage_DataUpdate // *GossipMessage_Empty // *GossipMessage_Conn // *GossipMessage_StateInfo // *GossipMessage_StateSnapshot // *GossipMessage_StateInfoPullReq // *GossipMessage_StateRequest // *GossipMessage_StateResponse // *GossipMessage_LeadershipMsg // *GossipMessage_PeerIdentity Content isGossipMessage_Content `protobuf_oneof:"content"` }
GossipMessage defines the message sent in a gossip network
func (*GossipMessage) Descriptor ¶
func (*GossipMessage) Descriptor() ([]byte, []int)
func (*GossipMessage) GetAliveMsg ¶
func (m *GossipMessage) GetAliveMsg() *AliveMessage
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) GetPeerIdentity ¶
func (m *GossipMessage) GetPeerIdentity() *PeerIdentity
func (*GossipMessage) GetPullMsgType ¶
func (m *GossipMessage) GetPullMsgType() PullMsgType
GetPullMsgType returns the phase of the pull mechanism this GossipMessage belongs to for example: Hello, Digest, etc. If this isn't a pull message, PullMsgType_Undefined is returned.
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) IsAliveMsg ¶
func (m *GossipMessage) IsAliveMsg() bool
IsAliveMsg returns whether this GossipMessage is an AliveMessage
func (*GossipMessage) IsChannelRestricted ¶
func (m *GossipMessage) IsChannelRestricted() bool
IsChannelRestricted returns whether this GossipMessage should be routed only in its channel
func (*GossipMessage) IsDataMsg ¶
func (m *GossipMessage) IsDataMsg() bool
IsDataMsg returns whether this GossipMessage is a data message
func (*GossipMessage) IsDataReq ¶
func (m *GossipMessage) IsDataReq() bool
IsDataReq returns whether this GossipMessage is a data request message
func (*GossipMessage) IsDataUpdate ¶
func (m *GossipMessage) IsDataUpdate() bool
IsDataUpdate returns whether this GossipMessage is a data update message
func (*GossipMessage) IsDigestMsg ¶
func (m *GossipMessage) IsDigestMsg() bool
IsDigestMsg returns whether this GossipMessage is a digest message
func (*GossipMessage) IsHelloMsg ¶
func (m *GossipMessage) IsHelloMsg() bool
IsHelloMsg returns whether this GossipMessage is a hello message
func (*GossipMessage) IsIdentityMsg ¶
func (m *GossipMessage) IsIdentityMsg() bool
IsIdentityMsg returns whether this GossipMessage is an identity message
func (*GossipMessage) IsLeadershipMsg ¶
func (m *GossipMessage) IsLeadershipMsg() bool
IsLeadershipMsg returns whether this GossipMessage is a leadership (leader election) message
func (*GossipMessage) IsOrgRestricted ¶
func (m *GossipMessage) IsOrgRestricted() bool
IsOrgRestricted returns whether this GossipMessage should be routed only inside the organization
func (*GossipMessage) IsPullMsg ¶
func (m *GossipMessage) IsPullMsg() bool
IsPullMsg returns whether this GossipMessage is a message that belongs to the pull mechanism
func (*GossipMessage) IsRemoteStateMessage ¶
func (m *GossipMessage) IsRemoteStateMessage() bool
IsRemoteStateMessage returns whether this GossipMessage is related to state synchronization
func (*GossipMessage) IsStateInfoMsg ¶
func (m *GossipMessage) IsStateInfoMsg() bool
IsStateInfoMsg returns whether this GossipMessage is a stateInfo message
func (*GossipMessage) IsStateInfoPullRequestMsg ¶
func (m *GossipMessage) IsStateInfoPullRequestMsg() bool
IsStateInfoPullRequestMsg returns whether this GossipMessage is a stateInfoPullRequest
func (*GossipMessage) IsStateInfoSnapshot ¶
func (m *GossipMessage) IsStateInfoSnapshot() bool
IsStateInfoSnapshot returns whether this GossipMessage is a stateInfo snapshot
func (*GossipMessage) IsTagLegal ¶
func (m *GossipMessage) IsTagLegal() error
IsTagLegal checks the GossipMessage tags and inner type and returns an error if the tag doesn't match the type.
func (*GossipMessage) ProtoMessage ¶
func (*GossipMessage) ProtoMessage()
func (*GossipMessage) Reset ¶
func (m *GossipMessage) Reset()
func (*GossipMessage) Sign ¶
func (m *GossipMessage) Sign(signer Signer) error
Sign signs a GossipMessage with given Signer. Returns a signed message on success or an error on failure
func (*GossipMessage) String ¶
func (m *GossipMessage) String() string
func (*GossipMessage) Verify ¶
func (m *GossipMessage) Verify(peerIdentity []byte, verify Verifier) error
Verify verifies a signed GossipMessage with a given Verifier. Returns nil on success, error on failure.
func (*GossipMessage) XXX_OneofFuncs ¶
func (*GossipMessage) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type GossipMessage_AliveMsg ¶
type GossipMessage_AliveMsg struct {
AliveMsg *AliveMessage `protobuf:"bytes,5,opt,name=aliveMsg,oneof"`
}
type GossipMessage_Conn ¶
type GossipMessage_Conn struct {
Conn *ConnEstablish `protobuf:"bytes,14,opt,name=conn,oneof"`
}
type GossipMessage_DataDig ¶
type GossipMessage_DataDig struct {
DataDig *DataDigest `protobuf:"bytes,10,opt,name=dataDig,oneof"`
}
type GossipMessage_DataMsg ¶
type GossipMessage_DataMsg struct {
DataMsg *DataMessage `protobuf:"bytes,8,opt,name=dataMsg,oneof"`
}
type GossipMessage_DataReq ¶
type GossipMessage_DataReq struct {
DataReq *DataRequest `protobuf:"bytes,11,opt,name=dataReq,oneof"`
}
type GossipMessage_DataUpdate ¶
type GossipMessage_DataUpdate struct {
DataUpdate *DataUpdate `protobuf:"bytes,12,opt,name=dataUpdate,oneof"`
}
type GossipMessage_Empty ¶
type GossipMessage_Empty struct {
Empty *Empty `protobuf:"bytes,13,opt,name=empty,oneof"`
}
type GossipMessage_Hello ¶
type GossipMessage_Hello struct {
Hello *GossipHello `protobuf:"bytes,9,opt,name=hello,oneof"`
}
type GossipMessage_LeadershipMsg ¶
type GossipMessage_LeadershipMsg struct {
LeadershipMsg *LeadershipMessage `protobuf:"bytes,20,opt,name=leadershipMsg,oneof"`
}
type GossipMessage_MemReq ¶
type GossipMessage_MemReq struct {
MemReq *MembershipRequest `protobuf:"bytes,6,opt,name=memReq,oneof"`
}
type GossipMessage_MemRes ¶
type GossipMessage_MemRes struct {
MemRes *MembershipResponse `protobuf:"bytes,7,opt,name=memRes,oneof"`
}
type GossipMessage_PeerIdentity ¶
type GossipMessage_PeerIdentity struct {
PeerIdentity *PeerIdentity `protobuf:"bytes,21,opt,name=peerIdentity,oneof"`
}
type GossipMessage_StateInfo ¶
type GossipMessage_StateInfo struct {
StateInfo *StateInfo `protobuf:"bytes,15,opt,name=stateInfo,oneof"`
}
type GossipMessage_StateInfoPullReq ¶
type GossipMessage_StateInfoPullReq struct {
StateInfoPullReq *StateInfoPullRequest `protobuf:"bytes,17,opt,name=stateInfoPullReq,oneof"`
}
type GossipMessage_StateRequest ¶
type GossipMessage_StateRequest struct {
StateRequest *RemoteStateRequest `protobuf:"bytes,18,opt,name=stateRequest,oneof"`
}
type GossipMessage_StateResponse ¶
type GossipMessage_StateResponse struct {
StateResponse *RemoteStateResponse `protobuf:"bytes,19,opt,name=stateResponse,oneof"`
}
type GossipMessage_StateSnapshot ¶
type GossipMessage_StateSnapshot struct {
StateSnapshot *StateInfoSnapshot `protobuf:"bytes,16,opt,name=stateSnapshot,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 Gossip_GossipStreamClient ¶
type Gossip_GossipStreamClient interface { Send(*GossipMessage) error Recv() (*GossipMessage, error) grpc.ClientStream }
type Gossip_GossipStreamServer ¶
type Gossip_GossipStreamServer interface { Send(*GossipMessage) error Recv() (*GossipMessage, error) grpc.ServerStream }
type IdentifierExtractor ¶
type IdentifierExtractor func(*GossipMessage) string
IdentifierExtractor extracts from a GossipMessage an identifier
type LeadershipMessage ¶
type LeadershipMessage struct { Membership *Member `protobuf:"bytes,1,opt,name=membership" json:"membership,omitempty"` Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` }
Leadership Message is sent during leader election to inform remote peers about intent of peer to proclaim itself as leader
func (*LeadershipMessage) Descriptor ¶
func (*LeadershipMessage) Descriptor() ([]byte, []int)
func (*LeadershipMessage) GetMembership ¶
func (m *LeadershipMessage) GetMembership() *Member
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
type Member ¶
type Member struct { Endpoint string `protobuf:"bytes,1,opt,name=endpoint" json:"endpoint,omitempty"` Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` PkiID []byte `protobuf:"bytes,3,opt,name=pkiID,proto3" json:"pkiID,omitempty"` }
Member holds membership-related information about a peer
func (*Member) Descriptor ¶
func (*Member) ProtoMessage ¶
func (*Member) ProtoMessage()
type MembershipRequest ¶
type MembershipRequest struct { SelfInformation *GossipMessage `protobuf:"bytes,1,opt,name=selfInformation" json:"selfInformation,omitempty"` Known [][]byte `protobuf:"bytes,2,rep,name=known,proto3" json:"known,omitempty"` }
MembershipRequest is used to ask membership information from a remote peer
func (*MembershipRequest) Descriptor ¶
func (*MembershipRequest) Descriptor() ([]byte, []int)
func (*MembershipRequest) GetSelfInformation ¶
func (m *MembershipRequest) GetSelfInformation() *GossipMessage
func (*MembershipRequest) ProtoMessage ¶
func (*MembershipRequest) ProtoMessage()
func (*MembershipRequest) Reset ¶
func (m *MembershipRequest) Reset()
func (*MembershipRequest) String ¶
func (m *MembershipRequest) String() string
type MembershipResponse ¶
type MembershipResponse struct { Alive []*GossipMessage `protobuf:"bytes,1,rep,name=alive" json:"alive,omitempty"` Dead []*GossipMessage `protobuf:"bytes,2,rep,name=dead" json:"dead,omitempty"` }
MembershipResponse is used for replying to MembershipRequests
func (*MembershipResponse) Descriptor ¶
func (*MembershipResponse) Descriptor() ([]byte, []int)
func (*MembershipResponse) GetAlive ¶
func (m *MembershipResponse) GetAlive() []*GossipMessage
func (*MembershipResponse) GetDead ¶
func (m *MembershipResponse) GetDead() []*GossipMessage
func (*MembershipResponse) ProtoMessage ¶
func (*MembershipResponse) ProtoMessage()
func (*MembershipResponse) Reset ¶
func (m *MembershipResponse) Reset()
func (*MembershipResponse) String ¶
func (m *MembershipResponse) String() string
type MsgConsumer ¶
type MsgConsumer func(*GossipMessage)
MsgConsumer invokes code given a GossipMessage
type Payload ¶
type Payload struct { SeqNum uint64 `protobuf:"varint,1,opt,name=seqNum" json:"seqNum,omitempty"` Hash string `protobuf:"bytes,2,opt,name=hash" json:"hash,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` }
Payload contains a block
func (*Payload) Descriptor ¶
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
type PeerIdentity ¶
type PeerIdentity struct { PkiID []byte `protobuf:"bytes,1,opt,name=pkiID,proto3" json:"pkiID,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"` }
PeerIdentity defines the identity of the peer Used to make other peers learn of the identity of a certain peer
func (*PeerIdentity) Descriptor ¶
func (*PeerIdentity) Descriptor() ([]byte, []int)
func (*PeerIdentity) ProtoMessage ¶
func (*PeerIdentity) ProtoMessage()
func (*PeerIdentity) Reset ¶
func (m *PeerIdentity) Reset()
func (*PeerIdentity) String ¶
func (m *PeerIdentity) String() string
type PeerTime ¶
type PeerTime struct { IncNumber uint64 `protobuf:"varint,1,opt,name=inc_number,json=incNumber" json:"inc_number,omitempty"` SeqNum uint64 `protobuf:"varint,2,opt,name=seqNum" json:"seqNum,omitempty"` }
PeerTime defines the logical time of a peer's life
func (*PeerTime) Descriptor ¶
func (*PeerTime) ProtoMessage ¶
func (*PeerTime) ProtoMessage()
type PullMsgType ¶
type PullMsgType int32
const ( PullMsgType_Undefined PullMsgType = 0 PullMsgType_BlockMessage PullMsgType = 1 PullMsgType_IdentityMsg PullMsgType = 2 )
func (PullMsgType) EnumDescriptor ¶
func (PullMsgType) EnumDescriptor() ([]byte, []int)
func (PullMsgType) String ¶
func (x PullMsgType) String() string
type RemoteStateRequest ¶
type RemoteStateRequest struct {
SeqNums []uint64 `protobuf:"varint,1,rep,packed,name=seqNums" json:"seqNums,omitempty"`
}
RemoteStateRequest is used to ask a set of blocks from a remote peer
func (*RemoteStateRequest) Descriptor ¶
func (*RemoteStateRequest) Descriptor() ([]byte, []int)
func (*RemoteStateRequest) ProtoMessage ¶
func (*RemoteStateRequest) ProtoMessage()
func (*RemoteStateRequest) Reset ¶
func (m *RemoteStateRequest) Reset()
func (*RemoteStateRequest) String ¶
func (m *RemoteStateRequest) String() string
type RemoteStateResponse ¶
type RemoteStateResponse struct {
Payloads []*Payload `protobuf:"bytes,1,rep,name=payloads" json:"payloads,omitempty"`
}
RemoteStateResponse is used to send a set of blocks to a remote peer
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
type StateInfo ¶
type StateInfo struct { Metadata []byte `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` PkiID []byte `protobuf:"bytes,3,opt,name=pkiID,proto3" json:"pkiID,omitempty"` }
StateInfo is used for a peer to relay its state information to other peers
func (*StateInfo) Descriptor ¶
func (*StateInfo) GetTimestamp ¶
func (*StateInfo) ProtoMessage ¶
func (*StateInfo) ProtoMessage()
type StateInfoPullRequest ¶
type StateInfoPullRequest struct { }
StateInfoPullRequest is used to fetch a StateInfoSnapshot from a remote peer
func (*StateInfoPullRequest) Descriptor ¶
func (*StateInfoPullRequest) Descriptor() ([]byte, []int)
func (*StateInfoPullRequest) ProtoMessage ¶
func (*StateInfoPullRequest) ProtoMessage()
func (*StateInfoPullRequest) Reset ¶
func (m *StateInfoPullRequest) Reset()
func (*StateInfoPullRequest) String ¶
func (m *StateInfoPullRequest) String() string
type StateInfoSnapshot ¶
type StateInfoSnapshot struct {
Elements []*GossipMessage `protobuf:"bytes,1,rep,name=elements" json:"elements,omitempty"`
}
StateInfoSnapshot is an aggregation of StateInfo messages
func (*StateInfoSnapshot) Descriptor ¶
func (*StateInfoSnapshot) Descriptor() ([]byte, []int)
func (*StateInfoSnapshot) GetElements ¶
func (m *StateInfoSnapshot) GetElements() []*GossipMessage
func (*StateInfoSnapshot) ProtoMessage ¶
func (*StateInfoSnapshot) ProtoMessage()
func (*StateInfoSnapshot) Reset ¶
func (m *StateInfoSnapshot) Reset()
func (*StateInfoSnapshot) String ¶
func (m *StateInfoSnapshot) String() string