Gas related error deploying contract on Quorum @ Azure blockchain service

151 Views Asked by At

I am able to deploy contracts on ganache and test networks using migrations that includes sending some eth to one of the contracts

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

However, when I deploy the Oracle contract to Quorum/Azure blockchain service, I get

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.

Some googling on this error led to posts (https://ethereum.stackexchange.com/questions/74209/gas-required-exceeds-allowance-truffle-migrate/74211) but I am not sure this is the reason and I can not figure out how to change genesis on Azure blockchain. Any help will be much appreciated.

I also checked the Oracle contract's constructor and it does not have anything that will cause an exception.

2

There are 2 best solutions below

0
On

Faced with the same issue, if you use truffle for deployment, try to use this config and make sure that gas and gasPrice are set to Zero.

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

I think that Quorum supports transacting in eth, so sending gas to a contract on Quoroum does not work.

I ended up creating an oracle service myself that does not consume gas.