How to customize Hyperledger Fabric test network?

Viewed 134

I am currently working at a blockchain project with Hyperledger Fabric, and I'm facing some issues.

The scenario I would like to achieve is the following:

  • three organizations (Org1, Org2, Org3) with one peer each
  • a private channel between Org1 and Org2, say channel12
  • a private channel between Org2 and Org3, say channel23

My problem is that I can't understand how to customize the provided Hyperledger Fabric test network, in order to achieve the described scenario.

How can I proceed?

1 Answers

You can customize the configuration of the test network in configtx.yaml (test-network/configtx/configtx.yaml). I would start by adding a definition for Org3, which you can model off the existing definitions for Org1 and Org2 under the Organizations section, then creating a new channel profile that includes (Org2, Org3) under the Profiles section.

If by private channel you mean:

There is a need to encapsulate all the attributes of a channel like the chaincode deployed and the peers on the channel. In this case, you can use the createChannel.sh script (test-network/scripts/createChannel.sh) to join Org1 and Org2 to a new channel, then use this script as a base for another script joining Org2 and Org3 to another channel, referencing the new channel profile created earlier.

There is a need to keep only the data within transactions private. In this case, a separate channel for Org2 and Org3 would be unnecessary. You can use the addOrg3 script to create and add Org3 to an existing channel between Org1 and Org2. You can then use private data to hide the data in transactions on the channel.

Related