0

If I want to make some changes in my Smart Contract , I have to delete the docker image of my running application. Which results in complete loss of data. How can I push the changes in my smart contract such that I don't have to delete the docker image of the current application ???????????

Harshit
  • 35
  • 1
  • 5
  • I think you mean container, not image https://stackoverflow.com/questions/23735149/docker-image-vs-container – Mathias Jan 21 '18 at 15:05
  • I mean image only . when I run my application for the first time a docker image is created which can checked by running this command in a terminal $ docker images It shows all the docker images among which there is an image of my application. – Harshit Jan 21 '18 at 18:32

2 Answers2

0

peer chaincode upgrade ...

peer chaincode upgrade --help

Full details in the docs.

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

It's almost identical to peer chaincode instantiate ...

jworthington
  • 723
  • 1
  • 9
  • 17
0

You need to upgrade your current version of the chaincode into a new one which will contain required changes, the steps are as following:

  1. Installing new chaincode with updated version on all peers involved

    peer chaincode install -o localhost:7050 -n myCC -v 2.0 -p github.com/chaincode/mycc

  2. Upgrade chaincode to newer version

    peer chaincode upgrade -o localhost:7050 -n myCC -v 2.0 -C mychannel -c '{"Args":[]}'

Artem Barger
  • 40,769
  • 9
  • 59
  • 81