查询上究竟发生了什么

查询上究竟发生了什么

本文介绍了在Hyperledger中,在链码部署和调用,查询上究竟发生了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Hyperledger中链代码部署和调用,查询到底发生了什么?

What happened exactly on chaincode deploy and invoke , query, in Hyperledger?

需要确认Chaincode部署,调用和查询系统的成本.如果它们相同,则使Chaincode超过一个,甚至成百上千个似乎更好.

Need to confirm the cost of system on Chaincode deploy, invoke and query.If they are the same, seems better to make Chaincode more than one, even hundreds, thousands.

推荐答案

在"部署"期间,链代码以事务形式提交到分类帐,并分发给网络中的所有节点.每个节点都会创建一个新的Docker容器,并嵌入此链代码.之后,将启动该容器并执行Init方法.

During "Deploy" the chain code is submitted to the ledger in a form of transaction and distributed to all nodes in the network. Each node creates new Docker container with this chaincode embedded. After that container will be started and Init method will be executed.

在"查询"期间-链代码将读取当前状态并将其发送回用户.该交易未保存在区块链中.

During "Query" - chain code will read the current state and send it back to user. This transaction is not saved in blockchain.

在"调用"期间-链码可以修改分类帐中变量的状态.每个调用"交易都将添加到分类账的块"中.

During "Invoke" - chaincode can modify the state of the variables in ledger. Each "Invoke" transaction will be added to the "block" in the ledger.

这篇关于在Hyperledger中,在链码部署和调用,查询上究竟发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 02:07