Hyperledger Fabric v1.2中的渠道创建失败



我正试图在v1.2中用自己生成的网络(使用二进制configtxgen(启动Hyperledger Fabric网络。网络启动正确,没有任何组件指示错误。

但是,当我尝试创建一个新通道时,订购者级别会发生错误(以下三个错误之一(,并且不会创建任何通道

Orderer Server Status Code: (400) BAD_REQUEST. Description: error authorizing update: error validating ReadSet: existing config does not contain element for [Group]  /Channel/Application/Org1MSP but was in the read set

Orderer Server Status Code: (400) BAD_REQUEST. Description: error authorizing update: error validating ReadSet: existing config does not contain element for [Group]  /Channel/Application but was in the read set

Orderer Server Status Code: (400) BAD_REQUEST. Description: error authorizing update: error validating ReadSet: existing config does not contain element for [Value]  /Channel/Consortium but was in the read set

为了创建通道,我在master分支上使用Go SDK,并遵循与功能测试相同的过程。

如有任何帮助,我们将不胜感激。

详细的订购者日志

2018-07-30 07:54:34.988 UTC [cauthdsl] func2 -> DEBU 0c0 0xc42017c0b8 principal evaluation succeeds for identity 0
2018-07-30 07:54:34.988 UTC [cauthdsl] func1 -> DEBU 0c1 0xc42017c0b8 gate 1532937274988361380 evaluation succeeds
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c2 Signature set satisfies policy /Channel/Orderer/OrdererMSP/Writers
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c3 == Done Evaluating *cauthdsl.policy Policy /Channel/Orderer/OrdererMSP/Writers
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c4 Signature set satisfies policy /Channel/Orderer/Writers
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c5 == Done Evaluating *policies.implicitMetaPolicy Policy /Channel/Orderer/Writers
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c6 Signature set satisfies policy /Channel/Writers
2018-07-30 07:54:34.988 UTC [policies] Evaluate -> DEBU 0c7 == Done Evaluating *policies.implicitMetaPolicy Policy /Channel/Writers
2018-07-30 07:54:34.989 UTC [common/configtx] addToMap -> DEBU 0c8 Adding to config map: [Group]  /Channel
2018-07-30 07:54:34.989 UTC [common/configtx] addToMap -> DEBU 0c9 Adding to config map: [Group]  /Channel/Application
2018-07-30 07:54:34.989 UTC [common/configtx] addToMap -> DEBU 0ca Adding to config map: [Group]  /Channel/Application/Org1MSP
2018-07-30 07:54:34.989 UTC [common/configtx] addToMap -> DEBU 0cb Adding to config map: [Value]  /Channel/Consortium
2018-07-30 07:54:34.989 UTC [orderer/common/broadcast] Handle -> WARN 0cc [channel: chainhero] Rejecting broadcast of config message from 172.18.0.1:35764 because of error: error authorizing update: error validating ReadSet: existing config does not contain element for [Group]  /Channel/Application but was in the read set
2018-07-30 07:54:34.989 UTC [orderer/common/server] func1 -> DEBU 0cd Closing Broadcast stream

以前没有任何警告或错误。

configtx.yaml

---
Organizations:
- &OrdererOrg
Name: OrdererMSP
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/hf.chainhero.io/msp
Policies: &OrdererOrgPolicies
Readers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Writers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Admins:
Type: Signature
Rule: "OR('OrdererMSP.admin')"
- &Org1
Name: Org1MSP
ID: Org1MSP
MSPDir: crypto-config/peerOrganizations/org1.hf.chainhero.io/msp
Policies: &Org1Policies
Readers:
Type: Signature
Rule: "OR('Org1MSP.member')"
Writers:
Type: Signature
Rule: "OR('Org1MSP.member')"
Admins:
Type: Signature
Rule: "OR('Org1MSP.admin')"
AnchorPeers:
- Host: peer0.org1.hf.chainhero.io
Port: 7051
Capabilities:
Channel: &ChannelCapabilities
V1_1: true
Orderer: &OrdererCapabilities
V1_1: true
Application: &ApplicationCapabilities
V1_2: true
V1_1: false
Application: &ApplicationDefaults
ACLs: &ACLsDefault
lscc/ChaincodeExists: /Channel/Application/Readers
lscc/GetDeploymentSpec: /Channel/Application/Readers
lscc/GetChaincodeData: /Channel/Application/Readers
lscc/GetInstantiatedChaincodes: /Channel/Application/Readers
qscc/GetChainInfo: /Channel/Application/Readers
qscc/GetBlockByNumber: /Channel/Application/Readers
qscc/GetBlockByHash: /Channel/Application/Readers
qscc/GetTransactionByID: /Channel/Application/Readers
qscc/GetBlockByTxID: /Channel/Application/Readers
cscc/GetConfigBlock: /Channel/Application/Readers
cscc/GetConfigTree: /Channel/Application/Readers
cscc/SimulateConfigTreeUpdate: /Channel/Application/Readers
peer/Propose: /Channel/Application/Writers
peer/ChaincodeToChaincode: /Channel/Application/Readers
event/Block: /Channel/Application/Readers
event/FilteredBlock: /Channel/Application/Readers
Organizations:
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
Org1MemberPolicy:
Type: Signature
Rule: "OR('Org1MSP.member')"
Capabilities:
<<: *ApplicationCapabilities
Orderer: &OrdererDefaults
OrdererType: solo
Addresses:
- orderer.hf.chainhero.io:7050
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 98 MB
PreferredMaxBytes: 512 KB
MaxChannels: 0
Kafka:
Brokers:
Organizations:
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
BlockValidation:
Type: ImplicitMeta
Rule: "ANY Writers"
Capabilities:
<<: *OrdererCapabilities
Channel: &ChannelDefaults
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
Capabilities:
<<: *ChannelCapabilities
Profiles:
OrdererGenesis:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Organizations:
- <<: *OrdererOrg
Policies:
<<: *OrdererOrgPolicies
Admins:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Consortiums:
SampleConsortium:
Organizations:
- <<: *Org1
Policies:
<<: *Org1Policies
Admins:
Type: Signature
Rule: "OR('Org1MSP.member')"
Channel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1

我从JSKIM得到了解决方案。由于您使用的是fabric v1.2,当orderer节点使用genesis块启动时,orderer将创建一个默认通道。

我猜您正在使用configtxgen生成自己的通道工件,但忽略了通道的命名规则。因此,当您的exec进入订购方的集装箱时:

docker exec -it <orderer's container ID> bash

并将cd保存到默认设置为/var/hyperledger/production/orderer/chainschains目录中。您会注意到已经有一个通道退出。

以下是解决方案:

configtxgen -profile testOrgsOrdererGenesis -channelID testchannel -outputBlock ./crypto-config/ordererOrganizations/orderer.block
configtxgen -profile testorgschannel -channelID mychannel-outputCreateChannelTx ./crypto-config/ordererOrganizations/mychannel.tx

当你生成genesis块时,使用channelID来指定它。或者你可以在创建通道配置事务时重命名你的通道。

我最终通过更改生成的通道的名称来克服这个错误。然而,这并不能解释为什么有些名字不起作用。

相关内容

  • 没有找到相关文章

最新更新