0

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

4

2 回答 2

0

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

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

于 2021-04-05T10:00:21.143 回答
0

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

    azure:{
            provider: new Web3.providers.HttpProvider("<connection string here>"),
            network_id: "*",
            gas: 0,
            gasPrice: 0,
            from:"<member address here>",
        }
于 2021-04-20T08:23:54.990 回答