微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Quorum @ Azure 区块链服务上部署合约的 Gas 相关错误

如何解决在 Quorum @ Azure 区块链服务上部署合约的 Gas 相关错误

我能够使用迁移在 ganache 和测试网络上部署合约,包括向其中一个合约发送一些 eth

deployer.deploy(Oracle,{from: accounts[0],gas:6721975,value: 0.25e18});

但是,当我将 Oracle 合约部署到 Quorum/Azure 区块链服务时,我得到

Error:  *** Deployment Failed ***

"Oracle" received a generic error from Geth that
can be caused by hitting revert in a contract constructor or running out of gas.
   * gas required exceeds allowance (6721975) or always failing transaction.

对此错误的一些谷歌搜索导致了帖子 (https://ethereum.stackexchange.com/questions/74209/gas-required-exceeds-allowance-truffle-migrate/74211),但我不确定这是原因,我无法弄清楚如何更改 Azure 区块链上的创世纪。任何帮助将不胜感激。

我还检查了 Oracle 合约的构造函数,它没有任何会导致异常的内容

解决方法

我认为 Quorum 支持以 eth 进行交易,因此在 Quorum 上向合约发送 gas 是行不通的。

我最终自己创建了一个不消耗 gas 的 oracle 服务。

,

面对同样的问题,如果您使用 truffle 进行部署,请尝试使用此配置并确保将 gas 和 gasPrice 设置为零。

    azure:{
            provider: new Web3.providers.HttpProvider("<connection string here>"),network_id: "*",gas: 0,gasPrice: 0,from:"<member address here>",}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。