fabric: github.com/hyperledger/fabric/discovery Index | Files | Directories

package discovery

import "github.com/hyperledger/fabric/discovery"

Index

Package Files

api.go authcache.go service.go

func NewService Uses

func NewService(config Config, sup Support) *service

NewService creates a new discovery service instance

type AccessControlSupport Uses

type AccessControlSupport interface {
    // Eligible returns whether the given peer is eligible for receiving
    // service from the discovery service for a given channel
    EligibleForService(channel string, data common2.SignedData) error
}

AccessControlSupport checks if clients are eligible of being serviced

type Config Uses

type Config struct {
    TLS                          bool
    AuthCacheEnabled             bool
    AuthCacheMaxSize             int
    AuthCachePurgeRetentionRatio float64
}

Config defines the configuration of the discovery service

func (Config) String Uses

func (c Config) String() string

String returns a string representation of this Config

type ConfigSequenceSupport Uses

type ConfigSequenceSupport interface {
    // ConfigSequence returns the configuration sequence of the a given channel
    ConfigSequence(channel string) uint64
}

ConfigSequenceSupport returns the config sequence of the given channel

type ConfigSupport Uses

type ConfigSupport interface {
    // Config returns the channel's configuration
    Config(channel string) (*discprotos.ConfigResult, error)
}

ConfigSupport provides access to channel configuration

type EndorsementSupport Uses

type EndorsementSupport interface {
    // PeersForEndorsement returns an EndorsementDescriptor for a given set of peers, channel, and chaincode
    PeersForEndorsement(channel common.ChainID, interest *discprotos.ChaincodeInterest) (*discprotos.EndorsementDescriptor, error)

    // PeersAuthorizedByCriteria returns the peers of the channel that are authorized by the given chaincode interest
    // That is - taking in account if the chaincode(s) in the interest are installed on the peers, and also
    // taking in account whether the peers are part of the collections of the chaincodes.
    // If a nil interest, or an empty interest is passed - no filtering is done.
    PeersAuthorizedByCriteria(chainID common.ChainID, interest *discprotos.ChaincodeInterest) (discovery.Members, error)
}

EndorsementSupport provides knowledge of endorsement policy selection for chaincodes

type GossipSupport Uses

type GossipSupport interface {
    // ChannelExists returns whether a given channel exists or not
    ChannelExists(channel string) bool

    // PeersOfChannel returns the NetworkMembers considered alive
    // and also subscribed to the channel given
    PeersOfChannel(common.ChainID) discovery.Members

    // Peers returns the NetworkMembers considered alive
    Peers() discovery.Members

    // IdentityInfo returns identity information about peers
    IdentityInfo() api.PeerIdentitySet
}

GossipSupport aggregates abilities that the gossip module provides to the discovery service, such as knowing information about peers

type Support Uses

type Support interface {
    AccessControlSupport
    GossipSupport
    EndorsementSupport
    ConfigSupport
    ConfigSequenceSupport
}

Support defines an interface that allows the discovery service to obtain information that other peer components have

Directories

PathSynopsis
client
cmd
cmd/mocksCode generated by mockery v1.0.0.
endorsement
support
support/acl
support/chaincode
support/config
support/gossip
support/mocksCode generated by counterfeiter.

Package discovery imports 15 packages (graph) and is imported by 4 packages. Updated 2019-08-29. Refresh now. Tools for package owners.