discover

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChaincodeQuery

func ChaincodeQuery(chanel string, interests ...*peer.ChaincodeInterest) discovery.Query

func ConfigQuery

func ConfigQuery(channel string) discovery.Query

func LocalPeerQuery

func LocalPeerQuery() discovery.Query

LocalPeerQuery queries for peers in a non channel context,

func PeerMembershipQuery

func PeerMembershipQuery(channel string, filter *peer.ChaincodeInterest) discovery.Query

PeerMembershipQuery The filter field: filter according to chaincodes that are installed on peers and collection access control policies.

func Request

func Request(crypto protoutil.Signer, clientTlsCertHash []byte, queries ...*discovery.Query) discovery.SignedRequest

Types

type AliveMessage

type AliveMessage struct {
	Endpoint string
	PkiId    []byte

	Timestamp *gossip.PeerTime
}

type CCQueryRes

type CCQueryRes struct {
	IsQueryResult
	Content []*discovery.EndorsementDescriptor
}

type Client

type Client struct {
	discovery.DiscoveryClient
	context.Context
	ClientTlsCertHash []byte
}

func (*Client) Init

func (c *Client) Init(grpcClient grpc.ClientConnInterface)

func (Client) Request

func (c Client) Request(crypto protoutil.Signer, queries ...*discovery.Query) (responses []IsQueryResult)

type ConfigResult

type ConfigResult struct {
	IsQueryResult
	// msps is a map from MSP_ID to FabricMSPConfig
	Msps map[string]*msp.FabricMSPConfig
	// orderers is a map from MSP_ID to endpoint lists of orderers
	Orderers map[string]*discovery.Endpoints
}

func (ConfigResult) GetMSPs

func (c ConfigResult) GetMSPs() map[string]FabricMSPConfig

type Error

type Error struct {
	IsQueryResult
	Content string
}

func (Error) Error

func (e Error) Error() string

type FabricMSPConfig

type FabricMSPConfig struct {

	// List of root certificates trusted by this MSP
	// they are used upon certificate validation (see
	// comment for IntermediateCerts below)
	RootCerts [][]byte `protobuf:"bytes,2,rep,name=root_certs,json=rootCerts,proto3" json:"root_certs,omitempty"`
	// List of intermediate certificates trusted by this MSP;
	// they are used upon certificate validation as follows:
	// validation attempts to build a path from the certificate
	// to be validated (which is at one end of the path) and
	// one of the certs in the RootCerts field (which is at
	// the other end of the path). If the path is longer than
	// 2, certificates in the middle are searched within the
	// IntermediateCerts pool
	IntermediateCerts [][]byte `protobuf:"bytes,3,rep,name=intermediate_certs,json=intermediateCerts,proto3" json:"intermediate_certs,omitempty"`
	// Identity denoting the administrator of this MSP
	Admins [][]byte `protobuf:"bytes,4,rep,name=admins,proto3" json:"admins,omitempty"`
	// Identity revocation list
	RevocationList [][]byte `protobuf:"bytes,5,rep,name=revocation_list,json=revocationList,proto3" json:"revocation_list,omitempty"`
	// OrganizationalUnitIdentifiers holds one or more
	// fabric organizational unit identifiers that belong to
	// this MSP configuration
	OrganizationalUnitIdentifiers []*msp.FabricOUIdentifier `` /* 150-byte string literal not displayed */
	// FabricCryptoConfig contains the configuration parameters
	// for the cryptographic algorithms used by this MSP
	CryptoConfig *msp.FabricCryptoConfig `protobuf:"bytes,8,opt,name=crypto_config,json=cryptoConfig,proto3" json:"crypto_config,omitempty"`
	// List of TLS root certificates trusted by this MSP.
	// They are returned by GetTLSRootCerts.
	TlsRootCerts [][]byte `protobuf:"bytes,9,rep,name=tls_root_certs,json=tlsRootCerts,proto3" json:"tls_root_certs,omitempty"`
	// List of TLS intermediate certificates trusted by this MSP;
	// They are returned by GetTLSIntermediateCerts.
	TlsIntermediateCerts [][]byte `protobuf:"bytes,10,rep,name=tls_intermediate_certs,json=tlsIntermediateCerts,proto3" json:"tls_intermediate_certs,omitempty"`
}

type IsQueryResult

type IsQueryResult interface {
}

type Members

type Members struct {
	IsQueryResult
	PeersByOrg map[string]*discovery.Peers
}

func (Members) GetPeersByOrg

func (m Members) GetPeersByOrg(fromLocalPeer bool) map[string][]Peer

type Peer

type Peer struct {
	StateInfo      StateInfo
	MembershipInfo AliveMessage
	// This is the msp.SerializedIdentity of the peer, represented in bytes.
	Identity []byte
}

func (*Peer) Init

func (p *Peer) Init(raw *discovery.Peer, fromLocalPeer bool)

func (*Peer) String added in v0.0.9

func (p *Peer) String() string

type StateInfo

type StateInfo struct {
	Timestamp *gossip.PeerTime
	PkiId     []byte

	// Channel_MAC is an authentication code that proves that the peer that sent this message knows the name of the channel.
	Channel_MAC  []byte
	LedgerHeight uint64
	LeftChannel  bool
	Chaincodes   []*gossip.Chaincode
}

Jump to

Keyboard shortcuts

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