Skip to content

Commit 7e7e23c

Browse files
committed
MultiChannel internal API changes
This commit: 1) Gets rid of the api.go, since no one needs it anymore 2) Moves the Payload from api.go to common.go, and adds a chainID to the Payload Part of: https://jira.hyperledger.org/browse/FAB-872 Change-Id: I46df0842fbabde0dc39f6591c430ffb39ba7f6ae Signed-off-by: Yacov Manevich <[email protected]>
1 parent 943391b commit 7e7e23c

File tree

3 files changed

+20
-73
lines changed

3 files changed

+20
-73
lines changed

gossip/api/api.go

-66
This file was deleted.

gossip/api/channel.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ type JoinChannelMessage interface {
4444
// GetTimestamp returns the timestamp of the message's creation
4545
GetTimestamp() time.Time
4646

47-
// PeerList returns all the peers that are in the channel
48-
PeerList() []RemotePeer
47+
// Members returns all the peers that are in the channel
48+
Members() []ChannelMember
4949
}
5050

5151
// ChainID defines the identity representation of a chain
5252
type ChainID []byte
5353

54-
// RemotePeer is a peer's certificate and endpoint (host:port)
55-
type RemotePeer struct {
56-
cert PeerCert
57-
host string
58-
port int
54+
// ChannelMember is a peer's certificate and endpoint (host:port)
55+
type ChannelMember struct {
56+
Cert PeerCert // Cert defines the certificate of the remote peer
57+
Host string // Host is the hostname/ip address of the remote peer
58+
Port int // Port is the port the remote peer is listening on
5959
}
6060

6161
// PeerCert defines the cryptographic identity of a peer

gossip/common/common.go

+13
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,21 @@ limitations under the License.
1616

1717
package common
1818

19+
import "github.com/hyperledger/fabric/gossip/api"
20+
1921
// PKIidType defines the type that holds the PKI-id
2022
// which is the security identifier of a peer
2123
type PKIidType []byte
2224

25+
// MessageAcceptor is a predicate that is used to
26+
// determine in which messages the subscriber that created the
27+
// instance of the MessageAcceptor is interested in.
2328
type MessageAcceptor func(interface{}) bool
29+
30+
// Payload defines an object that contains a ledger block
31+
type Payload struct {
32+
ChainID api.ChainID // The channel's ID of the block
33+
Data []byte // The content of the message, possibly encrypted or signed
34+
Hash string // The message hash
35+
SeqNum uint64 // The message sequence number
36+
}

0 commit comments

Comments
 (0)