localconfig

package
v0.0.0-...-cc0dd9b Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "ORDERER"

Prefix for environment variables.

Variables

View Source
var Defaults = TopLevel{
	General: General{
		LedgerType:     "file",
		ListenAddress:  "127.0.0.1",
		ListenPort:     7050,
		GenesisMethod:  "provisional",
		GenesisProfile: "SampleSingleMSPSolo",
		SystemChannel:  "test-system-channel-name",
		GenesisFile:    "genesisblock",
		Profile: Profile{
			Enabled: false,
			Address: "0.0.0.0:6060",
		},
		LogLevel:    "INFO",
		LogFormat:   "%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}",
		LocalMSPDir: "msp",
		LocalMSPID:  "SampleOrg",
		BCCSP:       bccsp.GetDefaultOpts(),
		Authentication: Authentication{
			TimeWindow: time.Duration(15 * time.Minute),
		},
	},
	RAMLedger: RAMLedger{
		HistorySize: 10000,
	},
	FileLedger: FileLedger{
		Location: "/var/hyperledger/production/orderer",
		Prefix:   "hyperledger-fabric-ordererledger",
	},
	Kafka: Kafka{
		Retry: Retry{
			ShortInterval: 1 * time.Minute,
			ShortTotal:    10 * time.Minute,
			LongInterval:  10 * time.Minute,
			LongTotal:     12 * time.Hour,
			NetworkTimeouts: NetworkTimeouts{
				DialTimeout:  30 * time.Second,
				ReadTimeout:  30 * time.Second,
				WriteTimeout: 30 * time.Second,
			},
			Metadata: Metadata{
				RetryBackoff: 250 * time.Millisecond,
				RetryMax:     3,
			},
			Producer: Producer{
				RetryBackoff: 100 * time.Millisecond,
				RetryMax:     3,
			},
			Consumer: Consumer{
				RetryBackoff: 2 * time.Second,
			},
		},
		Verbose: false,
		Version: sarama.V0_10_2_0,
		TLS: TLS{
			Enabled: false,
		},
	},
	Debug: Debug{
		BroadcastTraceDir: "",
		DeliverTraceDir:   "",
	},
}

Defaults carries the default orderer configuration values.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	TimeWindow time.Duration
}

Authentication contains configuration parameters related to authenticating client messages.

type Consumer

type Consumer struct {
	RetryBackoff time.Duration
}

Consumer contains configuration for the consumer's retries when failing to read from a Kafa partition.

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
}

FileLedger contains configuration for the file-based ledger.

type General

type General struct {
	LedgerType     string
	ListenAddress  string
	ListenPort     uint16
	TLS            TLS
	Keepalive      Keepalive
	GenesisMethod  string
	GenesisProfile string
	SystemChannel  string
	GenesisFile    string
	Profile        Profile
	LogLevel       string
	LogFormat      string
	LocalMSPDir    string
	LocalMSPID     string
	BCCSP          *bccsp.FactoryOpts
	Authentication Authentication
}

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

type Kafka

type Kafka struct {
	Retry   Retry
	Verbose bool
	Version sarama.KafkaVersion // TODO Move this to global config
	TLS     TLS
}

Kafka contains configuration for the Kafka-based orderer.

type Keepalive

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

Keepalive contains configuration for gRPC servers.

type Metadata

type Metadata struct {
	RetryMax     int
	RetryBackoff time.Duration
}

Metadata contains configuration for the metadata requests to the Kafka cluster.

type NetworkTimeouts

type NetworkTimeouts struct {
	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

NetworkTimeouts contains the socket timeouts for network requests to the Kafka cluster.

type Producer

type Producer struct {
	RetryMax     int
	RetryBackoff time.Duration
}

Producer contains configuration for the producer's retries when failing to post a message to a Kafka partition.

type Profile

type Profile struct {
	Enabled bool
	Address string
}

Profile contains configuration for Go pprof profiling.

type RAMLedger

type RAMLedger struct {
	HistorySize uint
}

RAMLedger contains configuration for the RAM ledger.

type Retry

type Retry struct {
	ShortInterval   time.Duration
	ShortTotal      time.Duration
	LongInterval    time.Duration
	LongTotal       time.Duration
	NetworkTimeouts NetworkTimeouts
	Metadata        Metadata
	Producer        Producer
	Consumer        Consumer
}

Retry contains configuration related to retries and timeouts when the connection to the Kafka cluster cannot be established, or when Metadata requests needs to be repeated (because the cluster is in the middle of a leader election).

type TLS

type TLS struct {
	Enabled            bool
	PrivateKey         string
	Certificate        string
	RootCAs            []string
	ClientAuthRequired bool
	ClientRootCAs      []string
}

TLS contains configuration for TLS connections.

type TopLevel

type TopLevel struct {
	General    General
	FileLedger FileLedger
	RAMLedger  RAMLedger
	Kafka      Kafka
	Debug      Debug
}

TopLevel directly corresponds to the orderer config YAML. Note, for non 1-1 mappings, you may append something like `mapstructure:"weirdFoRMat"` to modify the default mapping, see the "Unmarshal" section of https://github.com/spf13/viper for more info.

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