Does Hyperledger support running multi-channels in

2019-09-15 05:51发布

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条回答
等我变得足够好
2楼-- · 2019-09-15 06:26

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.

查看更多
登录 后发表回答