DiscoveryWrapper wraps a target discovery service and adds endpoint data to each of the discovered peers.
type DiscoveryWrapper struct { fab.DiscoveryService // contains filtered or unexported fields }
func NewEndpointDiscoveryWrapper(ctx context.Client, channelID string, target fab.DiscoveryService, opts ...Opt) (*DiscoveryWrapper, error)
NewEndpointDiscoveryWrapper returns a new event endpoint discovery service that wraps a given target discovery service and adds endpoint data to each of the discovered peers.
func (s *DiscoveryWrapper) GetPeers() ([]fab.Peer, error)
GetPeers returns the discovered peers
EventEndpoint extends a Peer endpoint
type EventEndpoint struct { Certificate *x509.Certificate fab.Peer // contains filtered or unexported fields }
func FromPeerConfig(config fab.EndpointConfig, peer fab.Peer, peerCfg *fab.PeerConfig) *EventEndpoint
FromPeerConfig creates a new EventEndpoint from the given config
func (e *EventEndpoint) BlockHeight() uint64
BlockHeight returns the block height of the peer. If the peer doesn't contain any state info then 0 is returned.
func (e *EventEndpoint) Opts() []options.Opt
Opts returns additional options for the event connection
Opt is a discoveryProvider option
type Opt func(p *DiscoveryWrapper)
func WithTargetFilter(filter fab.TargetFilter) Opt
WithTargetFilter applies the target filter to the discovery provider