问题描述
这是我需要分步骤进行的操作:
Here is what I need to do in steps:
- 用2个组织(Org1和Org2)创建一个Fabric网络.
- 在它们之间创建一个频道:publicchannel.
- 现在按照本教程中的步骤,按结构添加Org3: https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html
- 在org3和org1之间创建一个新频道:org3org1channel.
- Create a fabric network with 2 orgs: Org1 and Org2.
- Create a channel between them: publicchannel.
- now add an Org3 using steps from this tutorial by fabric: https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html
- Create a new channel: org3org1channel, between org3 and org1.
我在第4步遇到问题,它正在返回:
I'm experiencing problems with step 4, it is returning:
Error: got unexpected status: BAD_REQUEST -- Attempted to include a member which is not in the consortium
当我跑步时:
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
此外,我确保您所有的路径和ENV变量都正确.
Also, I ensure you all the paths and ENV variables are correct.
这是我的configtx.yaml文件:
Here's my configtx.yaml file:
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/example.com/msp
- &Org1
Name: Org1MSP
ID: Org1MSP
MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
AnchorPeers:
- Host: peer0.org1.example.com
Port: 7051
- &Org2
Name: Org2MSP
ID: Org2MSP
MSPDir: crypto-config/peerOrganizations/bitpay.example.com/msp
AnchorPeers:
- Host: peer0.org2.example.com
Port: 7051
Capabilities:
Global: &ChannelCapabilities
V1_1: true
Orderer: &OrdererCapabilities
V1_1: true
Application: &ApplicationCapabilities
V1_2: true
Application: &ApplicationDefaults
Organizations:
Orderer: &OrdererDefaults
OrdererType: solo
Addresses:
- orderer.example.com:7050
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
Kafka:
Brokers:
- 127.0.0.1:9092
Organizations:
Profiles:
ExampleOrdererGenesis:
Capabilities:
<<: *ChannelCapabilities
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Consortiums:
ExampleConsortium:
Organizations:
- *Org1
- *Org2
ExampleChannel:
Consortium: ExampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2
Capabilities:
<<: *ApplicationCapabilities
TestChannel:
Consortium: ExampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org3
Capabilities:
<<: *ApplicationCapabilities
我使用黑客为新组织创建了新渠道:
I have created new channels with the new org, using a hack:
- 我创建了2个组织作为组织的一部分:org1,org2,channelcreatororg.
- 我创建了一个新的名为org3org1channel的频道,仅由org1组成.
- 现在,我使用了 https://hyperledger-fabric.readthedocs.io/zh/latest/channel_update_tutorial.html 使org3加入org3org1channel.
- I created 2 orgs as part of the consortium: org1, org2, channelcreatororg.
- I created a new channel named org3org1channel only consisting of org1.
- Now I used https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html to make org3 join org3org1channel.
这有效!但是我认为这是一个黑客,因为org1已经在ExampleConsortium
的创世块定义中.假设我要向该网络添加一个org4并在org4和org3之间创建一个通道.这是不可能的.我们应该能够在创世块中更新财团的定义.
This works! But I think this is a hack because org1 was already in the genesis block definition of ExampleConsortium
. Suppose I want to add an org4 to this network and create a channel between org4 and org3. it won't be possible. We should be able to update the consortium definition in genesis block to do so.
我们应该在以上文件的个人资料"部分中添加内容:
We should emphesise on the Profile section of the above file:
Profiles:
ExampleOrdererGenesis:
Capabilities:
<<: *ChannelCapabilities
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Consortiums:
ExampleConsortium:
Organizations:
- *Org1
- *Org2
ExampleChannel:
Consortium: ExampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2
Capabilities:
<<: *ApplicationCapabilities
TestChannel:
Consortium: ExampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org3
Capabilities:
<<: *ApplicationCapabilities
我认为问题是ExampleOrdererGenesis
包含联盟定义,并且不包含Org3
.有人可以帮助我使用configtxlator工具进行更新的步骤吗?
I think the problem is that the ExampleOrdererGenesis
contains a consortium definition and it does not include Org3
. Can someone help me with the steps to update it using configtxlator tool?
推荐答案
我使用以下链接解决了该问题: https://github.com/rohitadivi/Reconfigure-BYFN/blob/master/Create_channel.md
I solved it using this link: https://github.com/rohitadivi/Reconfigure-BYFN/blob/master/Create_channel.md
请确保您了解上述链接中的步骤中的testchaninid
.当使用peer
命令触发创始块交易时,我们为定购者创建一个渠道.我们正在获取该频道并进行更新,而不是其他任何频道.
Make sure you understand what a testchaninid
is within the steps of above link. We create a channel for the orderer, when we fire our genesis block transaction using peer
command. We are fetching that channel and updating it and not any other channel.
这篇关于无法在Fabric中使用新组织创建频道,出现错误:尝试包含联盟中未包含的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!