Skip to content

fabric-x-orderer · 配置

顶层 — Configuration

来源:config/config.go:41-43

go
type Configuration struct {
    LocalConfig  *LocalConfig
    SharedConfig *protos.SharedConfig
}

加载:ReadConfig()config/config.go:47),返回 (*Configuration, *common.Block, error);支持 YAML bootstrap(config/config.go:72-80)。

NodeLocalConfig

来源:config/local_config.go:29-48

字段yaml tag
PartyIDPartyID
GeneralConfigGeneral
FileStoreFileStore
RouterParamsRouter
BatcherParamsBatcher
ConsensusParamsConsensus
AssemblerParamsAssembler
OperationsConfigOperations
MetricsConfigMetrics

GeneralConfig

来源:config/local_config.go:75-104

字段yaml tag / 用途
ListenAddressListenAddress
ListenPortListenPort
TLSConfigTLS
KeepaliveSettingsBackoffSettingsMaxRecvMsgSizeMaxSendMsgSize
BootstrapBootstrap(支持 yaml 方法)
LocalMSPDirLocalMSPIDBCCSP
LogSpec节点日志级别

PartyConfig(shared)

来源:config/party_shared_config.go:11-26

字段yaml tag
PartyIDPartyIDtypes.PartyID
CACertsCACerts
TLSCACertsTLSCACerts
RouterConfigRouterConfig
BatchersConfigBatchersConfig([])
ConsenterConfigConsenterConfig
AssemblerConfigAssemblerConfig

各角色 NodeConfig

来源:config/party_shared_config.go:28-68

RouterNodeConfig(28-35)

TLSCertHostPort

BatcherNodeConfig(37-48)

ShardIDtypes.ShardID)、SignCertTLSCertHostPort

ConsenterNodeConfig(50-59)

SignCertTLSCertHostPort

AssemblerNodeConfig(61-68)

TLSCertHostPort

默认 armageddon 配置

来源:common/tools/armageddon/armageddon.go:46-75

  • 4 Party(ID 1-4)
  • 每 Party:1 assembler + 1 consenter + 1 router + 2 batchers
  • 端点:127.0.0.1:7050-7069(每 Party 5 个连续端口,依次为 assembler/consenter/router/batcher×2)

共享类型

来源:common/types/types.go

ShardID uint16(:15)、PartyID uint16(:21)、BatchID(接口,:34)。

TLS 与 MSP

GeneralConfig.TLSConfigLocalMSPDirLocalMSPIDBCCSPconfig/local_config.go:75-104)。具体子字段 [未核]。

部署样本

来源:deployment/vms/sample-config。具体 yaml 样例 [未核]。