fab

package
Version: v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfigEndpointFromOptions

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

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

ConfigFromBackend returns endpoint config implementation for given backend

func IsEndpointConfigFullyOverridden

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

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

Types

type ChannelEndpointConfig

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

type ChannelPolicies struct {
	//Policy for querying channel block
	QueryChannelConfig QueryChannelConfigPolicy
}

ChannelPolicies defines list of policies defined for a channel

type ClientConfig

type ClientConfig struct {
	Organization string
	TLSCerts     ClientTLSConfig
}

ClientConfig provides the definition of the client configuration

type ClientTLSConfig

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

ClientTLSConfig contains the client TLS configuration

type EndpointConfig

type EndpointConfig struct {
	// contains filtered or unexported fields
}

EndpointConfig represents the endpoint configuration for the client

func (*EndpointConfig) ChannelConfig

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

ChannelConfig returns the channel configuration

func (*EndpointConfig) ChannelOrderers

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

ChannelOrderers returns a list of channel orderers

func (*EndpointConfig) ChannelPeers

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

ChannelPeers returns the channel peers configuration

func (*EndpointConfig) CryptoConfigPath

func (c *EndpointConfig) CryptoConfigPath() string

CryptoConfigPath ...

func (*EndpointConfig) EventServiceType

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

EventServiceType returns the type of event service client to use

func (*EndpointConfig) NetworkConfig

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

NetworkConfig returns the network configuration defined in the config file

func (*EndpointConfig) NetworkPeers

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

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

func (*EndpointConfig) OrdererConfig

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

OrdererConfig returns the requested orderer

func (*EndpointConfig) OrderersConfig

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

OrderersConfig returns a list of defined orderers

func (*EndpointConfig) PeerConfig

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

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

func (*EndpointConfig) PeersConfig

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

func (c *EndpointConfig) ResetNetworkConfig() error

ResetNetworkConfig clears network config cache

func (*EndpointConfig) TLSCACertPool

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

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

func (*EndpointConfig) TLSClientCerts

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

TLSClientCerts loads the client's certs for mutual TLS

func (*EndpointConfig) Timeout

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

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 MatchConfig

type MatchConfig struct {
	Pattern string

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

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

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

type OrdererConfig

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

OrdererConfig defines an orderer configuration

type OrganizationConfig

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

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

PeerChannelConfig defines the peer capabilities

type PeerConfig

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

PeerConfig defines a peer configuration

type QueryChannelConfigPolicy

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

QueryChannelConfigPolicy defines opts for channelConfigBlock

Directories

Path Synopsis
ccpackager
events
api
Package resource provides access to fabric network resource management, typically using system channel queries.
Package resource provides access to fabric network resource management, typically using system channel queries.
Package txn enables creating, endorsing and sending transactions to Fabric peers and orderers.
Package txn enables creating, endorsing and sending transactions to Fabric peers and orderers.

Jump to

Keyboard shortcuts

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