Here is what I need to do in steps:
- 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.
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
when I run:
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
Also, I ensure you all the paths and ENV variables are correct.
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:
- 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.
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
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?