config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAConfig

type CAConfig struct {
	Crypto CryptoConfig `yaml:"crypto"`
	Host   string       `yaml:"host"`
	Tls    TlsConfig    `yaml:"tls"`
}

type Config

type Config struct {
	Crypto    CryptoConfig       `yaml:"crypto"`
	Orderers  []ConnectionConfig `yaml:"orderers"`
	Discovery DiscoveryConfig    `yaml:"discovery"`
	// peer pool for local configuration without gossip discovery
	MSP  []MSPConfig `yaml:"msp"`
	Pool PoolConfig  `yaml:"pool"`
	// if tls is enabled maps TLS certs to discovered peers
	EndpointsMap []Endpoint `yaml:"endpoints_map"`
}

func NewYamlConfig

func NewYamlConfig(configPath string) (*Config, error)

type ConnectionConfig

type ConnectionConfig struct {
	Host    string     `yaml:"host"`
	Tls     TlsConfig  `yaml:"tls"`
	GRPC    GRPCConfig `yaml:"grpc"`
	Timeout Duration   `yaml:"timeout"`
}

type CryptoConfig

type CryptoConfig struct {
	Type    string          `yaml:"type"`
	Options CryptoSuiteOpts `yaml:"options"`
}

type CryptoSuiteOpts

type CryptoSuiteOpts map[string]interface{}

type DiscoveryChaincode

type DiscoveryChaincode struct {
	Name    string `json:"chaincode_name" yaml:"name"`
	Version string `json:"version"`
	Policy  string `json:"policy"`
}

type DiscoveryChannel

type DiscoveryChannel struct {
	Name       string               `json:"channel_name" yaml:"name"`
	Chaincodes []DiscoveryChaincode `json:"chaincodes" yaml:"chaincodes"`
	Orderers   []ConnectionConfig   `json:"orderers" yaml:"orderers"`
}

type DiscoveryConfig

type DiscoveryConfig struct {
	Type string `yaml:"type"`
	// connection to local MSP which will be used for gossip discovery
	Connection *ConnectionConfig `yaml:"connection"`
	// configuration of channels/chaincodes in local(from config) discovery type
	Options DiscoveryConfigOpts `yaml:"options"`
}

type DiscoveryConfigOpts

type DiscoveryConfigOpts map[string]interface{}

DiscoveryConfigOpts - channel configuration for local config contains []DiscoveryChannel

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

type Endpoint added in v0.8.5

type Endpoint struct {
	Host         string    `yaml:"host"`
	HostOverride string    `yaml:"host_override"`
	TlsConfig    TlsConfig `yaml:"tls"`
}

type GRPCConfig

type GRPCConfig struct {
	KeepAlive *GRPCKeepAliveConfig `yaml:"keep_alive"`
	Retry     *GRPCRetryConfig     `yaml:"retry"`
}

type GRPCKeepAliveConfig

type GRPCKeepAliveConfig struct {
	// See keepalive.ClientParameters.Time, current value in seconds, default: 1 min.
	Time int `yaml:"time" default:"60"`
	// See keepalive.ClientParameters.Timeout, current value in seconds, default: 20 sec.
	Timeout int `yaml:"timeout" default:"20"`
}

type GRPCRetryConfig

type GRPCRetryConfig struct {
	// Count for max retries
	Max uint `yaml:"max"`
	// Timeout is used for back-off
	Timeout Duration `yaml:"timeout"`
}

type MSPConfig

type MSPConfig struct {
	Name      string             `yaml:"name"`
	Endorsers []ConnectionConfig `yaml:"endorsers"`
}

type PoolConfig

type PoolConfig struct {
	DeliverTimeout Duration `yaml:"deliver_timeout"`
}

type TlsConfig

type TlsConfig struct {
	Enabled    bool `yaml:"enabled"`
	SkipVerify bool `yaml:"skip_verify"`

	// Cert take precedence over CertPath
	Cert     []byte `yaml:"cert"`
	CertPath string `yaml:"cert_path"`

	// Key take precedence over KeyPath
	Key     []byte `yaml:"key"`
	KeyPath string `yaml:"key_path"`

	// CACert take precedence over CACertPath
	CACert     []byte `yaml:"ca_cert"`
	CACertPath string `yaml:"ca_cert_path"`
}

Jump to

Keyboard shortcuts

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