HyperLedger(2)动态添加channel、organization

Add a new channel

  1. create channel configuration

    configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/newchannel.tx -channelID newchannel
  2. generate anchor peer configuratoin for Organizations

    
    #for organizations 1
    
    configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID newchannel -asOrg Org1MSP
    
    #for organizations 2
    
    configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID newchannel -asOrg Org2MSP
  3. create a channel

    peer channel create -o orderer.example.com:7050 -c newchannel -f ./channel-artifacts/newchannel.tx
  4. join new channel

    peer channel join -b newchannel.block -o orderer.example.com:7050
  5. update anchor peer

    peer channel update -o orderer.example.com:7050 -c newchannel -f ./channel-artifacts/Org1MSPanchors.tx

你可能感兴趣的:(HyperLedger)