【发布时间】:2019-11-30 08:30:07
【问题描述】:
这是我需要分步执行的操作:
- 创建一个包含 2 个组织的结构网络:Org1 和 Org2。
- 在它们之间创建一个频道:publicchannel。
- 现在使用本教程中的步骤通过fabric 添加一个Org3:https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html
- 在 org3 和 org1 之间创建一个新频道:org3org1channel。
我在第 4 步遇到问题,它正在返回:
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 变量都是正确的。
这是我的 configtx.yaml 文件:
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
我使用 hack 创建了新组织的新频道:
- 我创建了 2 个组织作为联盟的一部分:org1、org2、channelcreatororg。
- 我创建了一个名为 org3org1channel 的新频道,仅包含 org1。
- 现在我使用https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html 让org3 加入org3org1 频道。
这行得通!但我认为这是一个 hack,因为 org1 已经在 ExampleConsortium 的创世块定义中。假设我想在这个网络中添加一个 org4 并在 org4 和 org3 之间创建一个通道。这是不可能的。我们应该能够更新创世区块中的联盟定义来做到这一点。
我们应该强调上述文件的 Profile 部分:
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 工具更新它吗?
【问题讨论】:
标签: hyperledger-fabric hyperledger