gpt4 book ai didi

yaml - Hyperledger Fabric configtxgen - 读取配置时出错 : map merge requires map or sequence of maps as the value

转载 作者:行者123 更新时间:2023-12-04 15:36:44 24 4
gpt4 key购买 nike

我正在尝试使用以下内容设置一个简单的 Fabric 网络:

  • 订购者组织 [abccoinOrderers]
  • 示例组织 [ABC]

使用 cryptogen 工具生成所有必需的文件后,运行 configtxgen 命令会出现以下错误:

student@abc:~/Desktop/fabric/network$ configtxgen -profile DefaultBlockOrderingService -outputBlock ./config/genesis.block -configPath $PWD
2019-12-26 12:35:42.131 MST [common.tools.configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen for output operations is deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2019-12-26 12:35:42.136 MST [common.tools.configtxgen] main -> INFO 002 Loading configuration
2019-12-26 12:35:42.137 MST [common.tools.configtxgen.localconfig] Load -> PANI 003 Error reading configuration: While parsing config: yaml: map merge requires map or sequence of maps as the value
2019-12-26 12:35:42.137 MST [common.tools.configtxgen] func1 -> PANI 004 Error reading configuration: While parsing config: yaml: map merge requires map or sequence of maps as the value
panic: Error reading configuration: While parsing config: yaml: map merge requires map or sequence of maps as the value [recovered]
panic: Error reading configuration: While parsing config: yaml: map merge requires map or sequence of maps as the value

这是configtx.yaml

Organizations:
- &abccoinOrderers
Name: abccoinOrderersMSP
ID: abccoinOrderersMSP
MSPDir: crypto-config/ordererOrganizations/abccoin.com/msp
- &ABC
Name: ABCMSP
ID: ABCMSP
MSPDir: crypto-config/peerOrganizations/ABC.abccoin.com/msp
AnchorPeers:
- Host: Andy.ABC.abccoin.com
Port: 7051

Application: &ApplicationDefaults

Orderer:
- &DevModeOrdering
OrdererType: solo
Addresses:
- Devorderer.abccoin.com:7050
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 1

Profiles:
DefaultBlockOrderingService:
Orderer:
<<: *DevModeOrdering
Organizations:
- *abccoinOrderers
Consortiums:
SampleConsortium:
Organizations:
- *ABC


abcMembersOnly:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *ABC

我已经尝试重新排列代码块,如 this post 中所述.如本期 YML document "<<: value" cannot be parsed #245 中所述,我还尝试在引号中调整“<<”键的步调但它没有帮助。

最佳答案

configtx.yaml 中有 2 个错误。

  1. Orderer:是map类型或者object类型,不是array或者slice类型。当您使用 - 定义参数时,它在 yaml 中用作数组。
Orderer:
// remove -
&DevModeOrdering
OrdererType: solo
Addresses:
- Devorderer.abccoin.com:7050
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 1
  1. Application:您必须声明 Organizations: 参数。它可以是空的。如果你不声明任何东西,它就不会编译。要检查您应该尝试在任何在线转换器中将 yaml 转换为 json。
Application: &ApplicationDefaults
Organizations:

关于yaml - Hyperledger Fabric configtxgen - 读取配置时出错 : map merge requires map or sequence of maps as the value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59493047/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com