membership

package module
v0.0.0-...-fa3df64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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

func NewLocalNetworkChannelMember(endpoint string, ledgerHeight uint64) discovery.NetworkMember

NewLocalNetworkChannelMember creates a new NetworkMember instance for a local peer

func NewNetworkChannelMember

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 Roles

type Roles []string

Roles is a set of peer roles

func (Roles) HasRole

func (r Roles) HasRole(role string) bool

HasRole return true if the given role is included in the set

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL