config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMSPCacheSize               = 3
	DefaultBroadcastNumRetries        = 3
	VaultPersistenceOptsKey           = "vault.persistence.opts"
	DefaultOrderingConnectionPoolSize = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BCCSP

type BCCSP struct {
	Default string            `yaml:"Default,omitempty"`
	SW      *SoftwareProvider `yaml:"SW,omitempty"`
	PKCS11  *PKCS11           `yaml:"PKCS11,omitempty"`
}

type Chaincode

type Chaincode struct {
	Name    string `yaml:"Name,omitempty"`
	Private bool   `yaml:"Private,omitempty"`
}

type Channel

type Channel struct {
	Name       string        `yaml:"Name,omitempty"`
	Default    bool          `yaml:"Default,omitempty"`
	Quiet      bool          `yaml:"Quiet,omitempty"`
	NumRetries uint          `yaml:"NumRetries,omitempty"`
	RetrySleep time.Duration `yaml:"RetrySleep,omitempty"`
	Chaincodes []*Chaincode  `yaml:"Chaincodes,omitempty"`
}

type Config

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

func New

func New(configService configService, name string, defaultConfig bool) (*Config, error)

func (*Config) BroadcastNumRetries

func (c *Config) BroadcastNumRetries() int

func (*Config) BroadcastRetryInterval

func (c *Config) BroadcastRetryInterval() time.Duration

func (*Config) Channels

func (c *Config) Channels() ([]*Channel, error)

func (*Config) ClientConnTimeout

func (c *Config) ClientConnTimeout() time.Duration

func (*Config) DefaultMSP

func (c *Config) DefaultMSP() string

DefaultMSP returns the default MSP

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

func (*Config) GetDuration

func (c *Config) GetDuration(key string) time.Duration

func (*Config) GetPath

func (c *Config) GetPath(key string) string

func (*Config) GetString

func (c *Config) GetString(key string) string

func (*Config) IsSet

func (c *Config) IsSet(key string) bool

func (*Config) KeepAliveClientInterval

func (c *Config) KeepAliveClientInterval() time.Duration

func (*Config) KeepAliveClientTimeout

func (c *Config) KeepAliveClientTimeout() time.Duration

func (*Config) MSPCacheSize

func (c *Config) MSPCacheSize() int

func (*Config) MSPs

func (c *Config) MSPs() ([]MSP, error)

func (*Config) Name

func (c *Config) Name() string

func (*Config) OrdererConnectionPoolSize added in v0.3.0

func (c *Config) OrdererConnectionPoolSize() int

func (*Config) Orderers

func (c *Config) Orderers() ([]*grpc.ConnectionConfig, error)

func (*Config) Peers

func (*Config) Resolvers

func (c *Config) Resolvers() ([]Resolver, error)

func (*Config) TLSClientAuthRequired

func (c *Config) TLSClientAuthRequired() bool

func (*Config) TLSClientCertFile

func (c *Config) TLSClientCertFile() string

func (*Config) TLSClientKeyFile

func (c *Config) TLSClientKeyFile() string

func (*Config) TLSEnabled

func (c *Config) TLSEnabled() bool

func (*Config) TLSServerHostOverride

func (c *Config) TLSServerHostOverride() string

func (*Config) TranslatePath

func (c *Config) TranslatePath(path string) string

TranslatePath translates the passed path relative to the path from which the configuration has been loaded

func (*Config) UnmarshalKey

func (c *Config) UnmarshalKey(key string, rawVal interface{}) error

func (*Config) VaultPersistencePrefix

func (c *Config) VaultPersistencePrefix() string

func (*Config) VaultPersistenceType

func (c *Config) VaultPersistenceType() string

func (*Config) VaultTXStoreCacheSize

func (c *Config) VaultTXStoreCacheSize(defaultCacheSize int) int

type ConnectionConfig

type ConnectionConfig struct {
	Address            string        `yaml:"address,omitempty"`
	ConnectionTimeout  time.Duration `yaml:"connectionTimeout,omitempty"`
	TLSEnabled         bool          `yaml:"tlsEnabled,omitempty"`
	TLSRootCertFile    string        `yaml:"tlsRootCertFile,omitempty"`
	TLSRootCertBytes   [][]byte      `yaml:"tlsRootCertBytes,omitempty"`
	ServerNameOverride string        `yaml:"serverNameOverride,omitempty"`
}

type Endpoint

type Endpoint struct {
	Resolvers []Resolver `yaml:"resolvers,omitempty"`
}

type File

type File struct {
	File string `yaml:"file"`
}

type Files

type Files struct {
	Files []string `yaml:"files"`
}

type KeyIDMapping

type KeyIDMapping struct {
	SKI string `yaml:"SKI,omitempty"`
	ID  string `yaml:"ID,omitempty"`
}

type MSP

type MSP struct {
	ID        string                      `yaml:"id"`
	MSPType   string                      `yaml:"mspType"`
	MSPID     string                      `yaml:"mspID"`
	Path      string                      `yaml:"path"`
	CacheSize int                         `yaml:"cacheSize"`
	Opts      map[interface{}]interface{} `yaml:"opts, omitempty"`
}

type MSPOpts

type MSPOpts struct {
	BCCSP *BCCSP `yaml:"BCCSP,omitempty"`
}

type Network

type Network struct {
	Default    bool                `yaml:"default,omitempty"`
	DefaultMSP string              `yaml:"defaultMSP"`
	MSPs       []*MSP              `yaml:"msps"`
	TLS        TLS                 `yaml:"tls"`
	Orderers   []*ConnectionConfig `yaml:"orderers"`
	Peers      []*ConnectionConfig `yaml:"peers"`
	Channels   []*Channel          `yaml:"channels"`
	Vault      Vault               `yaml:"vault"`
	Endpoint   *Endpoint           `yaml:"endpoint,omitempty"`
}

type PKCS11

type PKCS11 struct {
	// Default algorithms when not specified (Deprecated?)
	Security int    `yaml:"Security"`
	Hash     string `yaml:"Hash"`

	// PKCS11 options
	Library        string         `yaml:"Library"`
	Label          string         `yaml:"Label"`
	Pin            string         `yaml:"Pin"`
	SoftwareVerify bool           `yaml:"SoftwareVerify,omitempty"`
	Immutable      bool           `yaml:"Immutable,omitempty"`
	AltID          string         `yaml:"AltId,omitempty"`
	KeyIDs         []KeyIDMapping `yaml:"KeyIds,omitempty" mapstructure:"KeyIds"`
}

type Resolver

type Resolver struct {
	// Name of the resolver
	Name string `yaml:"name,omitempty"`
	// Domain is option
	Domain string `yaml:"domain,omitempty"`
	// Identity specifies an MSP Identity
	Identity MSP `yaml:"identity,omitempty"`
	// Addresses where to reach this identity
	Addresses map[string]string `yaml:"addresses,omitempty"`
	// Aliases is a list of alias for this resolver
	Aliases []string `yaml:"aliases,omitempty"`
}

Resolver models a Fabric identity resolver

type SoftwareProvider

type SoftwareProvider struct {
	Hash     string `yaml:"Hash,omitempty"`
	Security int    `yaml:"Security,omitempty"`
}

type TLS

type TLS struct {
	Enabled            bool
	ClientAuthRequired bool
	Cert               File   `yaml:"cert"`
	Key                File   `yaml:"key"`
	ClientCert         File   `yaml:"clientCert"`
	ClientKey          File   `yaml:"clientKey"`
	RootCert           File   `yaml:"rootCert"`
	ClientRootCAs      Files  `yaml:"clientRootCAs"`
	RootCertFile       string `yaml:"rootCertFile"`
}

type Vault

type Vault struct {
	Persistence VaultPersistence `yaml:"persistence"`
}

type VaultOpts

type VaultOpts struct {
	Path string `yaml:"path"`
}

type VaultPersistence

type VaultPersistence struct {
	Type string    `yaml:"type"`
	Opts VaultOpts `yaml:"opts"`
}

Jump to

Keyboard shortcuts

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