nearprotocol - 交易/操作的气体限制是多少?
问题描述
交易的gas限制是多少?通过检查一些交易,看起来汽油价格的限制是300Tgas
每笔交易。
functionCall
每个动作也有气体限制吗?如果是这样,限制是多少。
第三个问题。例如,我们functionCall
在一笔交易中有两个 action,结果是Exceeded the prepaid gas
error,实际上是在告诉我们 gas 不足——是否可以断定哪个 action 的 gas 不足?
解决方案
每笔交易的 Gas 限制为 300Tgas。每个 functionCall 的 Gas 限制也是 300Tgas。
例如near-cli
,有一个标志--gas
可以让您指定可以将多少气体附加到函数调用。
% near call
near call <contractName> <methodName> [args]
schedule smart contract call which can modify state
Options:
--gas Max amount of gas this call can use (in gas units)
第三个问题:考虑增加附气。顺便说一句,未使用的 gas 将退还给您。要判断哪个函数调用的 gas 不足,您可以在 explorer.near.org(或 explorer.testnet.near.org)检查您的交易,并仔细阅读生成的收据及其结果。
推荐阅读
- xpath - XPATH 在未找到时选择所有非空子项加上默认值
- flutter - Flutter:设置按钮高度以填充容器
- docker - 如何将我的应用程序与运行 Docker 容器的 Kubernetes 集群集成?
- reactjs - 通过 ref 设置焦点仅适用于 React 的 setTimeout?
- vlc - 如何观看 RTSP 对话?
- php - 正确隐藏 index.php 和问号
- ios - 通过短信推荐朋友得到白屏
- amazon-s3 - AWS 组件中如何处理巨大的 REST API 响应?
- linux - 如何在 apt-get url 中仅显示“package_name.deb”?
- python - 使用 Python 创建具有时间范围数据的等距数据框