Luca Ambrosini
Luca Ambrosini

Reputation: 159

Composer Chaincode containers lifecycle

In Hyperledger fabric each chaincode deployed runs in a separate docker container.

Hyperledger-composer, therefore, creates a new container at each upgrade of the chaincode. From my understanding composer-rest-server or any other way to interact with the composer channel always relies on the last version that has been deployed.

The framework itself does not stop containers running old chaincodes.

Should I do it manually? Is there a good reason to keep them running?

Upvotes: 0

Views: 188

Answers (2)

Melek Boujelbene
Melek Boujelbene

Reputation: 21

Once an information is written on the Blockchain (via Hyperledger Composer or any other mean), you cannot remove it from the ledger.

Keeping the containers running old chaincodes can be considered as a mean to recover your network (for example, if you made a mistake in the ACL and you cannot access to your network anymore).

You can kill and remove old Docker containers using the following commands:

docker kill ID_OF_THE_OLD_CONTAINER

docker rm ID_OF_THE_OLD_CONTAINER

Upvotes: 1

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

see Upgrading Hyperledger Fabric Business Network for the answer - you can stop them, yes. I suggest to read the link for more detail

Upvotes: 2

Related Questions