fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery Index | Files | Directories

package discovery

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery"


Package Files

discovery.go request.go

func CcCalls Uses

func CcCalls(ccNames ...string) []*discovery.ChaincodeCall

CcCalls creates an array of ChaincodeCalls based of cc names, can be used in AddPeersQuery(CcCalls(...))

func CcInterests Uses

func CcInterests(invocationsChains ...[]*discovery.ChaincodeCall) []*discovery.ChaincodeInterest

CcInterests creates an array of ChaincodeInterests based of ChaincodeCalls, can be used in AddEndorsersQuery(CcInterests(CcCalls(...)))

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client implements a Discovery client

func New Uses

func New(ctx fabcontext.Client) (*Client, error)

New returns a new Discover client

func (*Client) Send Uses

func (c *Client) Send(ctx context.Context, req *Request, targets ...fab.PeerConfig) ([]Response, error)

Send retrieves information about channel peers, endorsers, and MSP config from the given set of peers. A set of successful responses is returned and/or an error is returned from each of the peers that was unsuccessful (note that if more than one peer returned an error then the returned error may be cast to multi.Errors).

type Request Uses

type Request struct {
    // contains filtered or unexported fields

Request aggregates several queries inside it

func NewRequest Uses

func NewRequest() *Request

NewRequest creates a new request

func (*Request) AddConfigQuery Uses

func (req *Request) AddConfigQuery() *Request

AddConfigQuery adds to the request a config query

func (*Request) AddEndorsersQuery Uses

func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)

AddEndorsersQuery adds to the request a query for given chaincodes interests are the chaincode interests that the client wants to query for. All interests for a given channel should be supplied in an aggregated slice

func (*Request) AddLocalPeersQuery Uses

func (req *Request) AddLocalPeersQuery() *Request

AddLocalPeersQuery adds to the request a local peer query

func (*Request) AddPeersQuery Uses

func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request

AddPeersQuery adds to the request a peer query

func (*Request) OfChannel Uses

func (req *Request) OfChannel(ch string) *Request

OfChannel sets the next queries added to be in the given channel's context

type Response Uses

type Response interface {
    Target() string

Response extends the response from the Discovery invocation on the peer by adding the endpoint URL of the peer that was invoked.



Package discovery imports 13 packages (graph) and is imported by 3 packages. Updated 2019-10-30. Refresh now. Tools for package owners.