Hyperledger Fabric 添加组织 - cryptogen 无法正确解析 configtx.yaml
Hyperledger Fabric Adding Org - cryptogen does not parse configtx.yaml correctly
我正在尝试将新组织添加到 Fabric 测试网络 (v2.2)。
我在 add-org-org5/docker 文件夹中创建了一个 configtx.yaml 文件(来源:https://gist.github.com/RafaelAPB/d55916b4b7151027ee3349b867e9fbdc):
Organizations:
- &org5
Name: org5MSP
ID: org5MSP
MSPDir: ../organizations/peerOrganizations/org5MSP.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.peer','org5MSP.client')"
Writers:
Type: Signature
Rule:
- "OR('org5MSP.admin','org5MSP.client')"
Admins:
Type: Signature
Rule:
- "OR('org5MSP.admin')"
Endorsement:
Type: Signature
Rule:
- "OR('org5MSP.peer')"
当运行 configtxgen -printOrg org5MSP -configPath /add-org-org5/docker
时,我得到以下(完整日志:https://gist.github.com/RafaelAPB/8144665eda4f91229f32d1b1f42058f2):
'\x1B[35m2021-05-21 16:05:03.341 UTC [common.tools.configtxgen] func1 -> PANI 012\x1B[0m failed to load configCache: Error unmarshaling config into struct: 3 error(s) decoding:\r\n' +
'\r\n' +
"* 'Organizations[0].Policies[Admins].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
"* 'Organizations[0].Policies[Endorsement].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
"* 'Organizations[0].Policies[Writers].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
'panic: failed to load configCache: Error unmarshaling config into struct: 3 error(s) decoding:\r\n' +
'\r\n' +
cryptogen 似乎无法识别“Rule”字符串。这是为什么?有什么建议吗?
默认 configtx.yaml 文件一切正常(来源:https://gist.github.com/RafaelAPB/a1d9269d94f8f4f4d87b60d54c7b2247):
Organizations:
- &Org3
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org3MSP
# ID to load the MSP definition as
ID: Org3MSP
MSPDir: ../organizations/peerOrganizations/org3.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org3MSP.admin', 'Org3MSP.peer', 'Org3MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org3MSP.admin', 'Org3MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org3MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org3MSP.peer')"
提前致谢!
我认为你应该将你的 org5 configtx.yaml 修改为这些,你可以找到字段 Rule
不一样。
Organizations:
- &org5
Name: org5MSP
ID: org5MSP
MSPDir: ../organizations/peerOrganizations/org5MSP.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.peer','org5MSP.client')"
Writers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.client')"
Admins:
Type: Signature
Rule: "OR('org5MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('org5MSP.peer')"
我正在尝试将新组织添加到 Fabric 测试网络 (v2.2)。 我在 add-org-org5/docker 文件夹中创建了一个 configtx.yaml 文件(来源:https://gist.github.com/RafaelAPB/d55916b4b7151027ee3349b867e9fbdc):
Organizations:
- &org5
Name: org5MSP
ID: org5MSP
MSPDir: ../organizations/peerOrganizations/org5MSP.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.peer','org5MSP.client')"
Writers:
Type: Signature
Rule:
- "OR('org5MSP.admin','org5MSP.client')"
Admins:
Type: Signature
Rule:
- "OR('org5MSP.admin')"
Endorsement:
Type: Signature
Rule:
- "OR('org5MSP.peer')"
当运行 configtxgen -printOrg org5MSP -configPath /add-org-org5/docker
时,我得到以下(完整日志:https://gist.github.com/RafaelAPB/8144665eda4f91229f32d1b1f42058f2):
'\x1B[35m2021-05-21 16:05:03.341 UTC [common.tools.configtxgen] func1 -> PANI 012\x1B[0m failed to load configCache: Error unmarshaling config into struct: 3 error(s) decoding:\r\n' +
'\r\n' +
"* 'Organizations[0].Policies[Admins].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
"* 'Organizations[0].Policies[Endorsement].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
"* 'Organizations[0].Policies[Writers].Rule' expected type 'string', got unconvertible type '[]interface {}'\r\n" +
'panic: failed to load configCache: Error unmarshaling config into struct: 3 error(s) decoding:\r\n' +
'\r\n' +
cryptogen 似乎无法识别“Rule”字符串。这是为什么?有什么建议吗?
默认 configtx.yaml 文件一切正常(来源:https://gist.github.com/RafaelAPB/a1d9269d94f8f4f4d87b60d54c7b2247):
Organizations:
- &Org3
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org3MSP
# ID to load the MSP definition as
ID: Org3MSP
MSPDir: ../organizations/peerOrganizations/org3.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org3MSP.admin', 'Org3MSP.peer', 'Org3MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org3MSP.admin', 'Org3MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org3MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org3MSP.peer')"
提前致谢!
我认为你应该将你的 org5 configtx.yaml 修改为这些,你可以找到字段 Rule
不一样。
Organizations:
- &org5
Name: org5MSP
ID: org5MSP
MSPDir: ../organizations/peerOrganizations/org5MSP.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.peer','org5MSP.client')"
Writers:
Type: Signature
Rule: "OR('org5MSP.admin','org5MSP.client')"
Admins:
Type: Signature
Rule: "OR('org5MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('org5MSP.peer')"