问题描述
Chaincode已经安装在对等文件系统中.为什么实例化chaincode会启动chaincode容器?链码容器的用途是什么?
Chaincode is already installed in the peer file system. Why does instantiating chaincode start the chaincode container? What is the purpose of the chaincode container?
推荐答案
chaincode容器的目的是确保将智能合约的执行与对等实体隔离开来,以使智能合约(chaincode)不会崩溃甚至无法访问由于错误或恶意代码而导致对等体.实例化链代码时,对等方将用链代码填充容器映像,并调用Docker管理API来部署该映像.如果该容器未运行,它将启动一个新容器.一旦运行,对等方收到的所有交易和建议将被传输到该容器中以执行.
The purpose of the chaincode container is to ensure isolation of the smart contract's execution from the peer itself, so that a smart contract (chaincode) cannot crash or even access the peer because of an error or malicious code. When you instantiate a chaincode, the peer populates a container image with the chaincode and invokes the Docker management API to deploy that image. If the container isn't running, it will start a new one. Once running, all transactions and proposals received by the peer will be transmitted to that container for execution.
这篇关于什么是Hyperledger Fabric中的chaincode容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!