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

package fab

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


Package Files

api.go endpointconfig.go opts.go

func BuildConfigEndpointFromOptions Uses

func BuildConfigEndpointFromOptions(opts ...interface{}) (fab.EndpointConfig, error)

BuildConfigEndpointFromOptions will return an EndpointConfig instance pre-built with Optional interfaces provided in fabsdk's WithEndpointConfig(opts...) call

func ConfigFromBackend Uses

func ConfigFromBackend(coreBackend ...core.ConfigBackend) (fab.EndpointConfig, error)

ConfigFromBackend returns endpoint config implementation for given backend

func IsEndpointConfigFullyOverridden Uses

func IsEndpointConfigFullyOverridden(c *EndpointConfigOptions) bool

IsEndpointConfigFullyOverridden will return true if all of the argument's sub interfaces is not nil (ie EndpointConfig interface not fully overridden)

func UpdateMissingOptsWithDefaultConfig Uses

func UpdateMissingOptsWithDefaultConfig(c *EndpointConfigOptions, d fab.EndpointConfig) fab.EndpointConfig

UpdateMissingOptsWithDefaultConfig will verify if any functions of the EndpointConfig were not updated with fabsdk's WithConfigEndpoint(opts...) call, then use default EndpointConfig interface for these functions instead

type BalancerType Uses

type BalancerType string

BalancerType is the load-balancer type

const (
    // RoundRobin (default) chooses endorsers in a round-robin fashion
    RoundRobin BalancerType = "RoundRobin"

    // Random chooses endorsers randomly
    Random BalancerType = "Random"

type ChannelEndpointConfig Uses

type ChannelEndpointConfig struct {
    // Orderers list of ordering service nodes
    Orderers []string
    // Peers a list of peer-channels that are part of this organization
    // to get the real Peer config object, use the Name field and fetch NetworkConfig.Peers[Name]
    Peers map[string]PeerChannelConfig
    //Policies list of policies for channel
    Policies ChannelPolicies

ChannelEndpointConfig provides the definition of channels for the network

type ChannelPolicies Uses

type ChannelPolicies struct {
    //Policy for querying channel block
    QueryChannelConfig QueryChannelConfigPolicy
    //Policy for querying discovery
    Discovery DiscoveryPolicy
    //Policy for endorser selection
    Selection SelectionPolicy
    //Policy for event service
    EventService EventServicePolicy

ChannelPolicies defines list of policies defined for a channel

type ClientConfig Uses

type ClientConfig struct {
    Organization string
    TLSCerts     ClientTLSConfig

ClientConfig provides the definition of the client configuration

type ClientTLSConfig Uses

type ClientTLSConfig struct {
    //Client TLS information
    Client endpoint.TLSKeyPair

ClientTLSConfig contains the client TLS configuration

type DiscoveryPolicy Uses

type DiscoveryPolicy struct {
    MinResponses int
    MaxTargets   int
    RetryOpts    retry.Opts

DiscoveryPolicy defines policy for discovery

type EndpointConfig Uses

type EndpointConfig struct {
    // contains filtered or unexported fields

EndpointConfig represents the endpoint configuration for the client

func (*EndpointConfig) ChannelConfig Uses

func (c *EndpointConfig) ChannelConfig(name string) *fab.ChannelEndpointConfig

ChannelConfig returns the channel configuration

func (*EndpointConfig) ChannelOrderers Uses

func (c *EndpointConfig) ChannelOrderers(name string) []fab.OrdererConfig

ChannelOrderers returns a list of channel orderers

func (*EndpointConfig) ChannelPeers Uses

func (c *EndpointConfig) ChannelPeers(name string) []fab.ChannelPeer

ChannelPeers returns the channel peers configuration

func (*EndpointConfig) CryptoConfigPath Uses

func (c *EndpointConfig) CryptoConfigPath() string

CryptoConfigPath ...

func (*EndpointConfig) NetworkConfig Uses

func (c *EndpointConfig) NetworkConfig() *fab.NetworkConfig

NetworkConfig returns the network configuration defined in the config file

func (*EndpointConfig) NetworkPeers Uses

func (c *EndpointConfig) NetworkPeers() []fab.NetworkPeer

NetworkPeers returns the network peers configuration, all the peers from all the orgs in config.

func (*EndpointConfig) OrdererConfig Uses

func (c *EndpointConfig) OrdererConfig(nameOrURL string) (*fab.OrdererConfig, bool, bool)

OrdererConfig returns the requested orderer

func (*EndpointConfig) OrderersConfig Uses

func (c *EndpointConfig) OrderersConfig() []fab.OrdererConfig

OrderersConfig returns a list of defined orderers

func (*EndpointConfig) PeerConfig Uses

func (c *EndpointConfig) PeerConfig(nameOrURL string) (*fab.PeerConfig, bool)

PeerConfig Retrieves a specific peer from the configuration by name or url

func (*EndpointConfig) PeersConfig Uses

func (c *EndpointConfig) PeersConfig(org string) ([]fab.PeerConfig, bool)

PeersConfig Retrieves the fabric peers for the specified org from the config file provided

func (*EndpointConfig) ResetNetworkConfig Uses

func (c *EndpointConfig) ResetNetworkConfig() error

ResetNetworkConfig clears network config cache

func (*EndpointConfig) TLSCACertPool Uses

func (c *EndpointConfig) TLSCACertPool() commtls.CertPool

TLSCACertPool returns the configured cert pool. If a certConfig is provided, the certificate is added to the pool

func (*EndpointConfig) TLSClientCerts Uses

func (c *EndpointConfig) TLSClientCerts() []tls.Certificate

TLSClientCerts loads the client's certs for mutual TLS

func (*EndpointConfig) Timeout Uses

func (c *EndpointConfig) Timeout(tType fab.TimeoutType) time.Duration

Timeout reads timeouts for the given timeout type, if type is not found in the config then default is set as per the const value above for the corresponding type

type EndpointConfigOptions Uses

type EndpointConfigOptions struct {
    // contains filtered or unexported fields

EndpointConfigOptions represents EndpointConfig interface with overridable interface functions if a function is not overridden, the default EndpointConfig implementation will be used.

type EventServicePolicy Uses

type EventServicePolicy struct {
    ResolverStrategy                 string
    MinBlockHeightResolverMode       string
    Balancer                         BalancerType
    BlockHeightLagThreshold          int
    PeerMonitor                      string
    ReconnectBlockHeightLagThreshold int
    PeerMonitorPeriod                time.Duration

EventServicePolicy specifies the policy for the event service

type MatchConfig Uses

type MatchConfig struct {
    Pattern string

    // these are used for hostname mapping
    URLSubstitutionExp                  string
    SSLTargetOverrideURLSubstitutionExp string
    MappedHost                          string

    // this is used for Name mapping instead of hostname mappings
    MappedName string

    //IgnoreEndpoint option to exclude given entity from any kind of search or from entity list
    IgnoreEndpoint bool

MatchConfig contains match pattern and substitution pattern for pattern matching of network configured hostnames or channel names with static config

type OrdererConfig Uses

type OrdererConfig struct {
    URL         string
    GRPCOptions map[string]interface{}
    TLSCACerts  endpoint.TLSConfig

OrdererConfig defines an orderer configuration

type OrganizationConfig Uses

type OrganizationConfig struct {
    MSPID                  string
    CryptoPath             string
    Users                  map[string]endpoint.TLSKeyPair
    Peers                  []string
    CertificateAuthorities []string

OrganizationConfig provides the definition of an organization in the network

type PeerChannelConfig Uses

type PeerChannelConfig struct {
    EndorsingPeer  bool
    ChaincodeQuery bool
    LedgerQuery    bool
    EventSource    bool

PeerChannelConfig defines the peer capabilities

type PeerConfig Uses

type PeerConfig struct {
    URL         string
    GRPCOptions map[string]interface{}
    TLSCACerts  endpoint.TLSConfig

PeerConfig defines a peer configuration

type QueryChannelConfigPolicy Uses

type QueryChannelConfigPolicy struct {
    MinResponses int
    MaxTargets   int
    RetryOpts    retry.Opts

QueryChannelConfigPolicy defines opts for channelConfigBlock

type SelectionPolicy Uses

type SelectionPolicy struct {
    // SortingStrategy is the endorser sorting strategy to use
    SortingStrategy SelectionSortingStrategy

    // BalancerType is the balancer to use in order to load-balance calls to endorsers
    Balancer BalancerType

    // BlockHeightLagThreshold is the number of blocks from the highest block number of a group of peers
    // that a peer can lag behind and still be considered to be up-to-date. These peers will be sorted
    // using the given Balancer. If a peer's block height falls behind this threshold then it will be
    // demoted to a lower priority list of peers which will be sorted according to block height.
    // Note: This property only applies to BlockHeightPriority sorter
    BlockHeightLagThreshold int

SelectionPolicy defines policy for selection

type SelectionSortingStrategy Uses

type SelectionSortingStrategy string

SelectionSortingStrategy is the endorser selection sorting strategy

const (
    // BlockHeightPriority (default) is a load-balancing selection sorting strategy
    // which also prioritizes peers at a block height that is above a certain "lag" threshold.
    BlockHeightPriority SelectionSortingStrategy = "BlockHeightPriority"

    // Balanced is a load-balancing selection sorting strategy
    Balanced SelectionSortingStrategy = "Balanced"


resourcePackage resource provides access to fabric network resource management, typically using system channel queries.
txnPackage txn enables creating, endorsing and sending transactions to Fabric peers and orderers.

Package fab imports 22 packages (graph) and is imported by 4 packages. Updated 2020-09-03. Refresh now. Tools for package owners.