如何在具有两个组织的网络中拥有一个具有1个组织的联盟?



我正在设置一个由两个组织组成的服务器(3个以后(,如以下链接所示 https://hyperledger-fabric.readthedocs.io/en/release-1.4/network/network.html:

但是,联盟不得包含两个组织(Org1 和 Org2(,而只能包含组织 1 (Org1(,如下图所示:https://i.stack.imgur.com/X9pI7.jpg

在我的configtx.yaml文件中,我将SampleConsortium值设置为如下:

Profiles:
TwoOrgsOrdererGenesis:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Consortiums:
SampleConsortium:
Organizations:
- *Org1
# - *Org2
TwoOrgsChannel:
Consortium: SampleConsortium
<<: *ChannelDefaults
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2
Capabilities:
<<: *ApplicationCapabilities

因此,我定义了一个具有单个组织的联盟:Org2。

但是,当用代码行实例化我的频道时

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example. com-cert.pem

屏幕显示一个错误,告诉我:错误:获得意外状态:BAD_REQUEST -- 试图包括不在联盟中的成员

您是否有想法通过在我的联盟中只有一个组织来生成我的频道?

提前非常感谢您的回答:)

PS :这是我使用超级账本结构的第一个项目,所以我对这项技术仍然是"新手"。但是,在我看来,没有迹象表明一个财团不应该有至少 2 个组织。

您必须从TwoOrgsChannel配置文件中评论Org2。 然后,您将能够创建我的频道 完成此操作后,您可以通过更新频道配置来添加 Org2 有关更多详细信息,您可以参考阅读文档 https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html

非常感谢,您的解决方案奏效了。但是,我只能在我的频道中添加 Org1 组织。如果我在 Org2 行上发表评论,则会出现错误

Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied

虽然我的configtx.yaml文件看起来像这样:

Profiles:
TwoOrgsOrdererGenesis:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Consortiums:
SampleConsortium:
Organizations:
- *Org1
- *Org2
TwoOrgsChannel:
Consortium: SampleConsortium
<<: *ChannelDefaults
Application:
<<: *ApplicationDefaults
Organizations:
# - *Org1
- *Org2
Capabilities:
<<: *ApplicationCapabilities

最新更新