Saddam Husen
Saddam Husen

Reputation: 21

How to upgrade/update a chaincode after modification?

I facing issue to deploy golang/nodejs chain in after modification. I need to delete all docker container and docker image to see changes done.

I also go through this example How to upgrade a chaincode after modification? and Currently i am working on this example : http://websecuritypatterns.com/blogs/2017/12/15/exploring-hyperledger-fabric-v1-supply-chain-demo-tuna-fish-shipments/ with hyperledger fabric.

Please help me !!!

Upvotes: 0

Views: 1379

Answers (2)

Puneet7nov
Puneet7nov

Reputation: 32

You can follow the below link, specially the Upgrade section:

http://hyperledger-fabric.readthedocs.io/en/release-1.1/chaincode4noah.html

Key points to take care of:

1) The chaincode name must be the same; otherwise it would be considered as a totally different chaincode. 2) Prior to upgrade, the new version of the chaincode must be installed on the required endorsers.

Upvotes: 0

user 12321
user 12321

Reputation: 2906

One solution would be installing and instantiating your chaincode in your channel and peers as a new version. This would work most of the times, but there are still times that some artifacts that have been generated in the previous version might conflict and hence the changes won't reflect in your whole application.

In order to avoid above, you can save your updated chaincode(go file) as a new name and install and instantiate this new one instead of old one (you need to update wherever you are calling old one though)

Upvotes: 1

Related Questions