Documentation ¶
Index ¶
- Constants
- func Get() (memserviceapi.Service, error)
- func NewLocalNetworkChannelMember(endpoint string, ledgerHeight uint64) discovery.NetworkMember
- func NewNetworkChannelMember(pkiID gcommon.PKIidType, endpoint string, ledgerHeight uint64) discovery.NetworkMember
- func NewNetworkMember(pkiID gcommon.PKIidType, endpoint string) discovery.NetworkMember
- type MspNetworkMembers
- type Roles
- type Service
Constants ¶
const ( // EndorserRole indicates that the peer may be used for endorsements EndorserRole = "endorser" // CommitterRole indicates that the peer commits transactions CommitterRole = "committer" )
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get() (memserviceapi.Service, error)
Get returns the Membership Service instance. If the service hasn't been initialized yet then it will be initialized.
func NewLocalNetworkChannelMember ¶ added in v0.4.3
func NewLocalNetworkChannelMember(endpoint string, ledgerHeight uint64) discovery.NetworkMember
NewLocalNetworkChannelMember creates a new NetworkMember instance for a local peer
func NewNetworkChannelMember ¶ added in v0.2.15
func NewNetworkChannelMember(pkiID gcommon.PKIidType, endpoint string, ledgerHeight uint64) discovery.NetworkMember
NewNetworkChannelMember creates a new NetworkMember instance
func NewNetworkMember ¶
func NewNetworkMember(pkiID gcommon.PKIidType, endpoint string) discovery.NetworkMember
NewNetworkMember creates a new NetworkMember instance
Types ¶
type MspNetworkMembers ¶
type MspNetworkMembers struct { MspID api.OrgIdentityType NetworkMembers []discovery.NetworkMember }
MspNetworkMembers contains an array of network members for a given MSP
func NewMSPNetworkMembers ¶
func NewMSPNetworkMembers(mspID []byte, networkMembers ...discovery.NetworkMember) MspNetworkMembers
NewMSPNetworkMembers creates a new MspNetworkMembers instance
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides functions to query peers
func NewServiceWithMocks ¶
func NewServiceWithMocks(localMSPID []byte, self discovery.NetworkMember, members ...MspNetworkMembers) *Service
NewServiceWithMocks creates a membership service with the given mocks. - self is the local peer - members contains zero or more MSP network members
func (*Service) GetAllPeers ¶
func (s *Service) GetAllPeers() []*memserviceapi.PeerEndpoint
GetAllPeers returns all peers on the gossip network
func (*Service) GetLocalPeer ¶ added in v0.4.3
func (s *Service) GetLocalPeer(channelID string) (*memserviceapi.PeerEndpoint, error)
GetLocalPeer returns all peers on the gossip network joined to the given channel
func (*Service) GetPeersOfChannel ¶
func (s *Service) GetPeersOfChannel(channelID string) ([]*memserviceapi.PeerEndpoint, error)
GetPeersOfChannel returns all peers on the gossip network joined to the given channel