localconfig

package
v0.0.0-...-523a819 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Prefix = "ORDERER"

环境变量的前缀。

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",
		},
		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,
		},
		Topic: Topic{
			ReplicationFactor: 3,
		},
	},
	Debug: Debug{
		BroadcastTraceDir: "",
		DeliverTraceDir:   "",
	},
	Operations: Operations{
		ListenAddress: "127.0.0.1:0",
	},
	Metrics: Metrics{
		Provider: "disabled",
	},
}

默认值包含默认的订购者配置值。

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	TimeWindow time.Duration
}

身份验证包含与身份验证相关的配置参数 客户端消息。

type Cluster

type Cluster struct {
	RootCAs                 []string
	ClientCertificate       string
	ClientPrivateKey        string
	DialTimeout             time.Duration
	RPCTimeout              time.Duration
	ReplicationBufferSize   int
	ReplicationPullTimeout  time.Duration
	ReplicationRetryTimeout time.Duration
}

type Consumer

type Consumer struct {
	RetryBackoff time.Duration
}

使用者包含使用者在失败时重试的配置 从kafa分区读取。

type Debug

type Debug struct {
	BroadcastTraceDir string
	DeliverTraceDir   string
}

调试包含订购方调试参数的配置。

type FileLedger

type FileLedger struct {
	Location string
	Prefix   string
}

file ledger包含基于文件的分类帐的配置。

type General

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

General包含在所有排序器类型中应该是通用的配置。

type Kafka

type Kafka struct {
	Retry     Retry
	Verbose   bool
	Version   sarama.KafkaVersion //TODO将此移动到全局配置
	TLS       TLS
	SASLPlain SASLPlain
	Topic     Topic
}

Kafka包含基于Kafka的医嘱者的配置。

type Keepalive

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

keepalive包含GRPC服务器的配置。

type Metadata

type Metadata struct {
	RetryMax     int
	RetryBackoff time.Duration
}

元数据包含对Kafka的元数据请求的配置 集群。

type Metrics

type Metrics struct {
	Provider string
	Statsd   Statsd
}

操作配置医嘱者的度量提供程序。

type NetworkTimeouts

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

NetworkTimeouts包含网络请求的套接字超时 卡夫卡簇。

type Operations

type Operations struct {
	ListenAddress string
	TLS           TLS
}

操作为医嘱者配置操作endpont。

type Producer

type Producer struct {
	RetryMax     int
	RetryBackoff time.Duration
}

Producer包含失败时Producer重试的配置 将消息发送到Kafka分区。

type Profile

type Profile struct {
	Enabled bool
	Address string
}

配置文件包含Go-PProf配置文件的配置。

type RAMLedger

type RAMLedger struct {
	HistorySize uint
}

ram ledger包含RAM分类账的配置。

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
}

重试包含与重试和超时相关的配置,当 无法建立到Kafka群集的连接,或者当元数据 需要重复请求(因为集群位于 领袖选举)。

type SASLPlain

type SASLPlain struct {
	Enabled  bool
	User     string
	Password string
}

sasl plain包含sasl/plain身份验证的配置

type Statsd

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

statsd提供从订购方发出statsd度量所需的配置。

type TLS

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

TLS包含TLS连接的配置。

type TopLevel

type TopLevel struct {
	General    General
	FileLedger FileLedger
	RAMLedger  RAMLedger
	Kafka      Kafka
	Debug      Debug
	Consensus  interface{}
	Operations Operations
	Metrics    Metrics
}

顶层直接对应于订购者配置yaml。 注意,对于非1-1映射,可以附加 类似于'mapstructure:“weirdformat”`to 修改默认映射,请参见“取消标记” 更多信息,请访问https://github.com/spf13/viper。

func Load

func Load() (*TopLevel, error)

加载解析排序器yaml文件和环境,生成 适用于配置使用的结构,失败时返回错误。

type Topic

type Topic struct {
	ReplicationFactor int16
}

主题包含创建卡夫卡主题时要使用的设置

Jump to

Keyboard shortcuts

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