Does Hyperledger support running multi-channels in one peer?

谁说我不能喝 提交于 2019-12-25 01:48:10

问题


Same as the topic, is it possible to run 2 or more channels on a same peer container? I have been reading the docs for days about how to configure the MSP to allow such doing so?


回答1:


Yes, you can run on one peer multiple chains, all you need is to produce configuration for each one of them and make peer to join it. Basically the flow works as following:

  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 depends of number of organizations you need to produce an update for anchor peers per each org as following:

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

need to be repeated for each org, if you have only one org, no need to follow this step.

  1. 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 genesis block for your channel, last step is to make peer to join it.

  1. Joining new channel:

    peer channel join -o orderer:7050 -c --blockpath YourNewChannel.block
    

You can find more examples and details on Getting Started page.



来源:https://stackoverflow.com/questions/44838201/does-hyperledger-support-running-multi-channels-in-one-peer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!