System Channel and Application Channel in Hyperledger Fabric

Overview

Test Network: Modified for Demonstration

cryptogen

channel artifacts

docker compose file

repository

Tutorial Replay

peer0.org1.example.com: join mychannel
peer0.org2.example.com: join mychannel
peer0.org3.example.com: not joining mychannel yet
Signing from Org1 (peer0.org1.example.com)
Signing from Org2 (peer0.org2.example.com) and submit to ordering service
peer0.org1.example.com (new block committed)
peer0.org2.example.com (new block committed)
Fetch channel genesis block from peer0.org1.example.com
Join peer0.org3.example.com with genesis block file
peer0.org3.example.com gets the blockchain from other peers
After completing the tutorial, peer0.org3 is now a member of mychannel.

Simulating the Problem

peer channel create -o localhost:7050 -c channel1-3 --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/channel1-3.tx --outputBlock ./channel-artifacts/channel1-3.block --tls --cafile $ORDERER_CA

Observation: System Channel and Application Channel

Configuration file: configtx.yaml

The original configtx.yaml only has these two profiles defined.
configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel

Configuration Block captured in System Channel

source terminalordererpeer channel fetch config config_block_sys.pb -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c system-channel --tls --cafile $ORDERER_CA
Extract from the configuration block from system-channel

Configuration Block captured in Application Channel

Extract from the configuration block from mychannel (application channel)

Observation

block file for channel1–3 cannot be created as Org3 is not yet in consortium

Add Org3 to System Channel and then Create Channel with Org3

Fetch configuration block from system channel

source terminalordererpeer channel fetch config config_block_sys.pb -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c system-channel --tls --cafile $ORDERER_CA

Construct configuration update

configtxlator proto_decode --input config_block_sys.pb --type common.Block | jq .data.data[0].payload.data.config > config.jsonjq -s '.[0] * {"channel_group":{"groups":{"Consortiums":{"groups":{"SampleConsortium":{"groups": {"Org3MSP":.[1]}}}}}}}' config.json ./organizations/peerOrganizations/org3.example.com/org3.json > modified_config.jsonconfigtxlator proto_encode --input config.json --type common.Config --output config.pbconfigtxlator proto_encode --input modified_config.json --type common.Config --output modified_config.pbconfigtxlator compute_update --channel_id system-channel --original config.pb --updated modified_config.pb --output org3_update.pbconfigtxlator proto_decode --input org3_update.pb --type common.ConfigUpdate | jq . > org3_update.jsonecho '{"payload":{"header":{"channel_header":{"channel_id":"'system-channel'", "type":2}},"data":{"config_update":'$(cat org3_update.json)'}}}' | jq . > org3_update_in_envelope.jsonconfigtxlator proto_encode --input org3_update_in_envelope.json --type common.Envelope --output org3_update_in_envelope.pb

Sign the update with orderer admin

peer channel update -f org3_update_in_envelope.pb -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c system-channel --tls --cafile $ORDERER_CA
peer channel fetch config config_block_sys_update.pb -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -c system-channel --tls --cafile $ORDERER_CA
We see Org3MSP is already included in the Consortium.

Create Channel with Org3

peer channel create -o localhost:7050 -c channel1-3 --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/channel1-3.tx --outputBlock ./channel-artifacts/channel1-3.block --tls --cafile $ORDERER_CA
Block file for channel1–3 is now created successfully
Terminal for Org1
Terminal for Org3
Top: Org1, Middle: Org2, Bottom: Org3
block file for channel1–3 is created after Org3 is added in consortium

Summary

Visit http://www.ledgertech.biz/kcarticles.html for all my works. Reach me on https://www.linkedin.com/in/ktam1/ or follow me @kctheservant in Twitter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store