Tools, FAQ, Tutorials:
Upgrade Chaincode Instance on BYFN
How to upgrade chaincode instance on BYFN?
✍: FYIcenter.com
 You can follow this tutorial to upgrade the chaincode instance on BYFN.
You can use this process to fix any issues with chaincode instance 
without destroy its data.
You can follow this tutorial to upgrade the chaincode instance on BYFN.
You can use this process to fix any issues with chaincode instance 
without destroy its data.  
1. Install new version, 2.0, of the chaincode on the default peer, peer0.org1.
bash-4.4# echo $CORE_PEER_ADDRESS peer0.org1.example.com:7051 bash-4.4# peer chaincode install -n mycc -v 2.0 -l golang \ -p github.com/chaincode/chaincode_example02/go/ [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc [chaincodeCmd] submitInstallProposal -> INFO 003 Installed remotely: response:<status:200 payload:"OK" >
2. Install new version, 2.0, of the chaincode on peer0.org2.
bash-4.4# CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger\ /fabric/peer/crypto/peerOrganizations/org2.example.com/users\ /Admin@org2.example.com/msp CORE_PEER_ADDRESS=peer0.org2.example.com:7051 \ CORE_PEER_LOCALMSPID=Org2MSP CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src\ /github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com\ /peers/peer0.org2.example.com/tls/ca.crt \ peer chaincode install -n mycc -v 2.0 -l golang \ -p github.com/chaincode/chaincode_example02/go/ [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc [chaincodeCmd] submitInstallProposal -> INFO 003 Installed remotely: response:<status:200 payload:"OK" >
3. Upgrade the chaincode instance, mycc, from default peer.
bash-4.4# export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric\
   /peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com\
   /msp/tlscacerts/tlsca.example.com-cert.pem
bash-4.4# peer chaincode upgrade -o orderer.example.com:7050 --tls \
   --cafile $ORDERER_CA -C mychannel -n mycc -v 2.0 \
   -c '{"Args":["init","a","100","b","200"]}' \
   -P "AND ('Org1MSP.peer','Org2MSP.peer')"
[chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
[chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
4. Verify the chaincode instance, mycc, from default peer.
bash-4.4# peer chaincode list --instantiated -C mychannel Get instantiated chaincodes on channel mychannel: Name: mycc, Version: 2.0, Path: github.com/chaincode/chaincode_example02/go/, Escc: escc, Vscc: vscc
As you can see, the chaincode, mycc, is running as version 2.0. Both peers, peer0.org1 and peer0.org2, should have the same Golang code to support it now.
⇒ Remove Older Versions Chaincode Containers
⇐ Uninstall Chaincode on BYFN Peers
2020-09-12, ∼1285🔥, 1💬
Popular Posts:
How To Merge Cells in a Column? If you want to merge multiple cells vertically in a row, you need to...
How to start Visual Studio Command Prompt? I have Visual Studio 2017 Community version with Visual C...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user e...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...