localconfig

package
v0.0.0-...-579b097 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Defaults = TopLevel{
	General: General{
		ListenAddress:   "127.0.0.1",
		ListenPort:      7050,
		BootstrapMethod: "none",
		Profile: Profile{
			Enabled: false,
			Address: "0.0.0.0:6060",
		},
		Cluster: Cluster{
			ReplicationMaxRetries:          12,
			RPCTimeout:                     time.Second * 7,
			DialTimeout:                    time.Second * 5,
			ReplicationBufferSize:          20971520,
			SendBufferSize:                 100,
			ReplicationRetryTimeout:        time.Second * 5,
			ReplicationPullTimeout:         time.Second * 5,
			CertExpirationWarningThreshold: time.Hour * 24 * 7,
		},
		LocalMSPDir: "msp",
		LocalMSPID:  "SampleOrg",
		BCCSP:       bccsp.GetDefaultOpts(),
		Authentication: Authentication{
			TimeWindow: 15 * time.Minute,
		},
		MaxRecvMsgSize: comm.DefaultMaxRecvMsgSize,
		MaxSendMsgSize: comm.DefaultMaxSendMsgSize,
	},
	FileLedger: FileLedger{
		Location: "/var/hyperledger/production/orderer",
	},
	Debug: Debug{
		BroadcastTraceDir: "",
		DeliverTraceDir:   "",
	},
	Operations: Operations{
		ListenAddress: "127.0.0.1:0",
	},
	Metrics: Metrics{
		Provider: "disabled",
	},
	ChannelParticipation: ChannelParticipation{
		Enabled:            true,
		MaxRequestBodySize: 1024 * 1024,
	},
	Admin: Admin{
		ListenAddress: "127.0.0.1:0",
	},
}

Defaults carries the default orderer configuration values.

Functions

func Flatten

func Flatten(i interface{}) []string

Flatten performs a depth-first serialization of a struct to a slice of strings. Each string will be formatted at 'path.to.leaf = value'.

Types

type Admin

type Admin struct {
	ListenAddress string
	TLS           TLS
}

Admin configures the admin endpoint for the orderer.

type Authentication

type Authentication struct {
	TimeWindow         time.Duration
	NoExpirationChecks bool
}

Authentication contains configuration parameters related to authenticating client messages.

type Backoff

type Backoff struct {
	BaseDelay  time.Duration
	Multiplier float64
	MaxDelay   time.Duration
}

Backoff defines the configuration options for GRPC client.

type ChannelParticipation

type ChannelParticipation struct {
	Enabled            bool // Deprecated: always overridden to 'true'
	MaxRequestBodySize uint32
}

ChannelParticipation provides the channel participation API configuration for the orderer. Channel participation uses the same ListenAddress and TLS settings of the Operations service.

type Cluster

type Cluster struct {
	ListenAddress                  string
	ListenPort                     uint16
	ServerCertificate              string
	ServerPrivateKey               string
	ClientCertificate              string
	ClientPrivateKey               string
	RootCAs                        []string
	DialTimeout                    time.Duration
	RPCTimeout                     time.Duration
	ReplicationBufferSize          int
	ReplicationPullTimeout         time.Duration
	ReplicationRetryTimeout        time.Duration
	ReplicationMaxRetries          int
	SendBufferSize                 int
	CertExpirationWarningThreshold time.Duration
	TLSHandshakeTimeShift          time.Duration
}

type Debug

type Debug struct {
	BroadcastTraceDir string
	DeliverTraceDir   string
}

Debug contains configuration for the orderer's debug parameters.

type FileLedger

type FileLedger struct {
	Location string
	Prefix   string // For compatibility only. This setting is no longer supported.
}

FileLedger contains configuration for the file-based ledger.

type General

type General struct {
	ListenAddress     string
	ListenPort        uint16
	TLS               TLS
	Cluster           Cluster
	Keepalive         Keepalive
	Backoff           Backoff
	ConnectionTimeout time.Duration
	GenesisMethod     string // Deprecated: For compatibility only, will be replaced by BootstrapMethod
	GenesisFile       string // Deprecated: For compatibility only, will be replaced by BootstrapFile
	BootstrapMethod   string // Deprecated: System channel is no longer supported.
	BootstrapFile     string // Deprecated: System channel is no longer supported.
	Profile           Profile
	LocalMSPDir       string
	LocalMSPID        string
	BCCSP             *bccsp.FactoryOpts
	Authentication    Authentication
	MaxRecvMsgSize    int32
	MaxSendMsgSize    int32
}

General contains config which should be common among all orderer types.

type Keepalive

type Keepalive struct {
	ServerMinInterval time.Duration
	ServerInterval    time.Duration
	ServerTimeout     time.Duration
}

Keepalive contains configuration for gRPC servers.

type Metrics

type Metrics struct {
	Provider string
	Statsd   Statsd
}

Metrics configures the metrics provider for the orderer.

type Operations

type Operations struct {
	ListenAddress string
	TLS           TLS
}

Operations configures the operations endpoint for the orderer.

type Profile

type Profile struct {
	Enabled bool
	Address string
}

Profile contains configuration for Go pprof profiling.

type Statsd

type Statsd struct {
	Network       string
	Address       string
	WriteInterval time.Duration
	Prefix        string
}

Statsd provides the configuration required to emit statsd metrics from the orderer.

type TLS

type TLS struct {
	Enabled               bool
	PrivateKey            string
	Certificate           string
	RootCAs               []string
	ClientAuthRequired    bool
	ClientRootCAs         []string
	TLSHandshakeTimeShift time.Duration
}

TLS contains configuration for TLS connections.

type TopLevel

type TopLevel struct {
	General              General
	FileLedger           FileLedger
	Debug                Debug
	Consensus            interface{}
	Operations           Operations
	Metrics              Metrics
	ChannelParticipation ChannelParticipation
	Admin                Admin
}

TopLevel directly corresponds to the orderer config YAML.

func Load

func Load() (*TopLevel, error)

Load parses the orderer YAML file and environment, producing a struct suitable for config use, returning error on failure.

Jump to

Keyboard shortcuts

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