简体   繁体   中英

Can you kill a smart contract in Hyperledger Fabric

您可以像以太坊中的kill功能一样删除hyperledger fabric智能合约吗?

To kill a chaincode(Smart contract) you need to follow following steps:

  • Kill chaincode containers belonging to respective chaincode version, which you want to kill. You may kill containers using following command:-

    docker rm -f [Chaincode docker container's ids separated by space]

  • Delete chaincode images, using following command:-

    docker rmi [Chaincode images ids]

  • Delete the chaincode from the file system of each peer under /var/hyperledger/production/chaincodes

Right now this is the procedure to uninstall a chaincode, in future there will be stop and start command to stop and resume a smart contract respectively. You may checkout the same in official documentation:-

Hyperledger fabric chaincode lifecycle

You can remove the containers and images for your smartcontract, but if you go to the peer container the foulder /var/hyperledger/production/chaincodes is empty.

If you run hyperledger explorer you will see that the contract remains and if you want install again with same name obtains an error, so the question is where and how you can remove this link in hyperledger 2.3?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM