Skip to content

Commit

Permalink
MultiChannel internal API changes
Browse files Browse the repository at this point in the history
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 <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Nov 11, 2016
1 parent 943391b commit 7e7e23c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 73 deletions.
66 changes: 0 additions & 66 deletions gossip/api/api.go

This file was deleted.

14 changes: 7 additions & 7 deletions gossip/api/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ type JoinChannelMessage interface {
// GetTimestamp returns the timestamp of the message's creation
GetTimestamp() time.Time

// PeerList returns all the peers that are in the channel
PeerList() []RemotePeer
// Members returns all the peers that are in the channel
Members() []ChannelMember
}

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

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

// PeerCert defines the cryptographic identity of a peer
Expand Down
13 changes: 13 additions & 0 deletions gossip/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ limitations under the License.

package common

import "github.com/hyperledger/fabric/gossip/api"

// PKIidType defines the type that holds the PKI-id
// which is the security identifier of a peer
type PKIidType []byte

// MessageAcceptor is a predicate that is used to
// determine in which messages the subscriber that created the
// instance of the MessageAcceptor is interested in.
type MessageAcceptor func(interface{}) bool

// Payload defines an object that contains a ledger block
type Payload struct {
ChainID api.ChainID // The channel's ID of the block
Data []byte // The content of the message, possibly encrypted or signed
Hash string // The message hash
SeqNum uint64 // The message sequence number
}

0 comments on commit 7e7e23c

Please sign in to comment.