【问题标题】:Gas related error deploying contract on Quorum @ Azure blockchain service在 Quorum @ Azure 区块链服务上部署合约的 Gas 相关错误
【发布时间】:2023-03-25 07:37:01
【问题描述】:

我能够在 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 合约的构造函数,它没有任何会导致异常的东西。

【问题讨论】:

    标签: azure quorum azure-blockchain-service oraclize


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 2020-01-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-07-29
        • 1970-01-01
        • 2018-08-31
        • 2012-09-05
        • 2018-08-29
        相关资源
        最近更新 更多