Knowee
Questions
Features
Study Tools

A user has created a channel in Hyperledger Terminal between two organizations, Org1 and Org2. Now he wants to merge the organisational peer Org1 into the channel.

Question

A user has created a channel in Hyperledger Terminal between two organizations, Org1 and Org2. Now he wants to merge the organisational peer Org1 into the channel.

🧐 Not the exact question you are looking for?Go ask a question

Solution

To merge the organizational peer Org1 into the channel, follow these steps:

  1. Fetch the most recent configuration block of the channel:

    peer channel fetch config config_block.pb -o orderer.example.com:7050 -c $CHANNEL_NAME --tls --cafile $ORDERER_CA
    
  2. Decode the configuration block to JSON and isolate the configuration:

    configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config > config.json
    
  3. Modify the configuration to add the Org1 MSP. This involves adding the Org1 MSP definition to the config.json file.

  4. Encode the modified configuration back to protobuf:

    configtxlator proto_encode --input config.json --type common.Config --output config.pb
    
  5. Compute the update needed to go from the original configuration to the modified configuration:

    configtxlator compute_update --channel_id $CHANNEL_NAME --original config.pb --updated modified_config.pb --output org1_update.pb
    
  6. Decode this output, which is the actual channel configuration update transaction:

    configtxlator proto_decode --input org1_update.pb --type common.ConfigUpdate | jq . > org1_update.json
    
  7. Add the envelope message, encode it back to protobuf format, and then sign the configuration update transaction:

    echo '{"payload":{"header":{"channel_header":{"channel_id":"'$CHANNEL_NAME'", "type":2}},"data":{"config_update":'$(cat org1_update.json)'}}}' | jq . > org1_update_in_envelope.json
    configtxlator proto_encode --input org1_update_in_envelope.json --type common.Envelope --output org1_update_in_envelope.pb
    
  8. The admin of Org1 can now sign the configuration update:

    peer channel signconfigtx -f org1_update_in_envelope.pb
    
  9. Finally, the admin of the channel can send the configuration update:

    peer channel update -f org1_update_in_envelope.pb -c $CHANNEL_NAME -o orderer.example.com:7050 --tls --cafile $ORDERER_CA
    

After these steps, Org1 should be added to the channel.

This problem has been solved

Similar Questions

A user has created a channel in Hyperledger Terminal between two organizations, Org1 and Org2. Now he wants to merge the organisational peer Org1 into the channel.Which of the following commands can be used here?source ./scripts/setOrgPeerContext.sh 1<br /> Peer channel join -ps ./channel-artifacts/mychannel.blocksource ./config/scripts/setOrgPeerContext.sh 1<br /> Peer channel merge -b ./channel-artifacts/mychannel.blocksource ./scripts/setOrgPeerContext.sh 1<br /> Peer channel join -b ./channel-artifacts/mychannel.blocksource ./set/scripts/OrgPeerContext.sh 1<br /> Peer channel merge -ps ./channel-artifacts/mychannel.block

While creating a channel in Hyperledger fabric, which of the following Docker commands will you use for updating the anchor peer for the Org2 organization?

While creating a channel in Hyperledger fabric, which of the following Docker commands will you use for updating the anchor peer for the Org2 organization?docker run cli ./set/scripts/setAnchorPeer.sh 2 $CHANNEL_NAMEdocker exec cli ./scripts/setAnchorPeer.sh 2 $CHANNEL_NAMEdocker run cli ./scripts/AnchorPeer.sh 2 $CHANNEL_NAMEdocker exec cli ./set/scripts/AnchorPeer.sh 2 $CHANNEL_NAME

While creating a channel in Hyperledger fabric, which of the following Docker commands will you use for updating the anchor peer for the Org2 organization?docker exec cli ./scripts/setAnchorPeer.sh 2 $CHANNEL_NAMEdocker run cli ./scripts/AnchorPeer.sh 2 $CHANNEL_NAMEdocker run cli ./set/scripts/setAnchorPeer.sh 2 $CHANNEL_NAMEdocker exec cli ./set/scripts/AnchorPeer.sh 2 $CHANNEL_NAME

How do you merge a branch into the current branch in Git?

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.