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:
- You need to provide chain configuration within
configtx.yaml
. Use
configtxgen
to produce create channel transaction and updates for anchor peersconfigtxgen -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.
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.
Joining new channel:
peer channel join -o orderer:7050 -c --blockpath YourNewChannel.block
You can find more examples and details on Getting Started page.