Can multi-channels be supported by Hyperledger in one peer

+2 votes

Is it possible to run two or more channels on the same peer container? 

Apr 11, 2018 in Blockchain by Johnathon
• 9,090 points
2,877 views

3 answers to this question.

+1 vote
Best answer

Yes you can run  multiple chains on one peer, all you need is to produce a configuration for each one of them and make your peer to join it. Just follow the following steps: 

  1. You need to provide chain configuration within [ configtx.yaml ]

  2. Use [ configtxgen ] to produce create channel transaction and updates for anchor peers

configtxgen -profile PeerChannelProfile -channelID YourNewChannel -outputcreateChannelTx=newchannel.tx

where PeerChannelProfile is the configuration profile you have defined in configtx.yaml file.

Now an update is needed for anchor peers per organisations depending on he number of organisations as following:

  configtxgen -profile PeerChannelProfile -channelID YourNewChannel -outputAchorPeersUpdate=Org1MSPAnchor.tx -asOrg=Org1MSP

The above steps need to be repeated for each organisation.

3. Now when you have create channel transaction you can actually make your peer to join the network by:

peer channel create -o orderer:7050 -c YourNewChannel -f newchannel.tx

This will produce the genesis block for your channel

4. Make the peer join it:

peer channel join -o orderer:7050 -c --blockpath YourNewChannel.block
answered Apr 11, 2018 by Perry
• 17,100 points

selected Jun 14, 2018 by Johnathon
Error: got unexpected status: BAD_REQUEST -- Attempted to include a member which is not in the consortium

doesnt produce genesis block for new channel...gives the  above error.

Try exporting channel name first:

/opt/gopath/src/github.com/hyperledger/fabric/peer# export CHANNEL_NAME=mychannel

And then run the above commands.

+2 votes
Yes, there can be multiple channels for a single peer. Channels hold applications data. Multiple channels are used to provide privacy and security.
answered May 2, 2019 by Neeraj
Hey @Neeraj, thanks for the answer. You mentioned it holds the application data. What data does it hold?
Hi @Raj, you're welcome.

Channels mainly hold user data, order data, etc.
Hi. I have a doubt. Why would someone create two channels in a single peer?
@Kishan

Think of a situation where there are two users. These users and some shared data and some data that they don't want the other user to see. In such case, each user will create a channel and store the private data in it so that it is not accessible to the other user.
+1 vote
Yes, Hyperledger supports multiple channels in a peer. This is actually a feature that most of the organizations use.
answered May 2, 2019 by Guru

Related Questions In Blockchain

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Can not make a peer in Hyperledger Fabric

You have not installed jdk on your system. ...READ MORE

answered Nov 22, 2018 in Blockchain by Omkar
• 69,220 points
616 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
1,003 views
+1 vote
1 answer
+15 votes
5 answers
0 votes
1 answer

How to get the already existing channels in Hyperledger v1.0?

You cannot see all available channels,  but you ...READ MORE

answered Jun 4, 2018 in Blockchain by Perry
• 17,100 points
2,504 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP