Remove Older Versions Chaincode Containers


How to Remove Older Versions Chaincode Containers after the chaincode instance is upgraded?



After a chaincode instance is upgraded, chaincode containers of the old version are still running on the Docker Engine. You can follow this tutorial to remove them.

1. List all chaincode containers:

$ docker ps --all | grep chaincode

2. Stop version 1.0 chaincode containers:

$ docker stop
$ docker stop

3. Remove version 1.0 chaincode container images:

$ docker rm
$ docker rm

4. List all chaincode containers again:

$ docker ps -all | grep chaincode

5. Verify the chaincode instance:

$ docker exec -it cli bash

bash-4.4# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'

Now only 2 containers are running for the version 2.0 of the chaincode instance. One for each participating peer.


⇒ "peer chaincode invoke" on BYFN

⇐ Upgrade Chaincode Instance on BYFN

⇑ BYFN (Build Your First Network)

⇑⇑ Hyperledger Tutorials

2020-08-13, 823👍, 0💬