如何计算手术的天然气和储存量?
2 个回答
- 投票数
-
- 2019-01-31
没有其他方法,如果您想估算该值,则必须模拟该操作的结果,而这正是空运行的结果.您可以尝试在节点外部重新实现它,但是方法是相同的.
There's no other way, you have to simulate what the operation does if you want to estimate this value, and this is exactly what a dry run does. You could try to reimplement it outside of a node, but the approach would be the same.
-
确实如此.如果在节点外部执行此操作,则必须使用与空运行相同的逻辑.对于不涉及参数或脚本的操作,我想可以在客户端中使用简化的逻辑,以减少到节点的流量.That's true. If doing it outside of the node the same logic must be used as in the dry run. For operations that doesn't involve parameters or script, I guess a simplified logic could be used in the client, in order to reduce the traffic to the node.
- 1
- 2019-02-01
- Klassare
-
- 2019-02-03
根据此处上提供的官方文档,您可以获取通过将参数
,您计划广播到网络的操作的天然气和存储成本--dry-run
传递给客户端节点引用它提到的文档
验证的另一个重要用途是确定气体和储存 限制.节点首先模拟迈克尔逊程序的执行 并跟踪天然气和储存量.然后客户 向交易发送正确的天然气和仓储限制 在节点指示的位置上.这就是为什么我们能够提交 交易未指定此限制,则针对 我们.
因此,正式而言,除了实现自己的验证程序外,确实没有其他选择.
According to the official documentation available here you can get the gas and storage cost of the operation you plan to broadcast to the network by passing the parameter
--dry-run
to the client nodeQuoting the doc it mentions
Another important use of validation is to determine gas and storage limits. The node first simulates the execution of a Michelson program and takes trace of the amount of gas and storage. Then the client sends the transaction with the right limits for gas and storage based on that indicated by the node. This is why we were able to submit transactions without specifying this limits, they were computed for us.
So officially there's indeed no alternative way short of implementing your own validator.
在003_PsddFKi3协议中,如何在不进行节点空运行的情况下计算天然气和存储使用量?