Skip to content

Commit 8d53e6d

Browse files
committed
FAB-1018 MultiChannel API fabric<-->gossip
This commit changes the API the fabric provides to the gossip layer to conform to latest discussions. Previously the JoinChannel message was expected to have all peers in the channel, now it can have only the anchor peers. In addition, each peer needs to know in which organization a fellow peer is, in order to know whether its safe to pass a block to it or not via state transfer. Change-Id: I6af5ce21a14bf6c4eaf1416aefe2877a147f15ec Signed-off-by: Yacov Manevich <[email protected]>
1 parent f9e8f3b commit 8d53e6d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

gossip/api/channel.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ import (
2525
// SecurityAdvisor defines an external auxiliary object
2626
// that provides security and identity related capabilities
2727
type SecurityAdvisor interface {
28-
// IsInMyOrg returns whether the given peer's certificate represents
29-
// a peer in the invoker's organization
30-
IsInMyOrg(PeerIdentityType) bool
28+
// OrgByPeerIdentity returns the OrgIdentityType
29+
// of a given peer identity
30+
OrgByPeerIdentity(PeerIdentityType) OrgIdentityType
3131

3232
// Verify verifies a JoinChannelMessage, returns nil on success,
3333
// and an error on failure
3434
Verify(JoinChannelMessage) error
35+
36+
3537
}
3638

3739
// ChannelNotifier is implemented by the gossip component and is used for the peer
@@ -48,13 +50,16 @@ type JoinChannelMessage interface {
4850
// GetTimestamp returns the timestamp of the message's creation
4951
GetTimestamp() time.Time
5052

51-
// Members returns all the peers that are in the channel
52-
Members() []ChannelMember
53+
// AnchorPeers returns all the anchor peers that are in the channel
54+
AnchorPeers() []AnchorPeer
5355
}
5456

55-
// ChannelMember is a peer's certificate and endpoint (host:port)
56-
type ChannelMember struct {
57-
Cert PeerIdentityType // PeerIdentityType defines the certificate of the remote peer
57+
// AnchorPeer is an anchor peer's certificate and endpoint (host:port)
58+
type AnchorPeer struct {
59+
Cert PeerIdentityType // Cert defines the certificate of the remote peer
5860
Host string // Host is the hostname/ip address of the remote peer
5961
Port int // Port is the port the remote peer is listening on
6062
}
63+
64+
// OrgIdentityType defines the identity of an organization
65+
type OrgIdentityType []byte

0 commit comments

Comments
 (0)