Deploy hangs on deploying to mainnet

:computer: Environment
Ubuntu 20.04
@openzeppelin/cli”
“version”: “2.8.2”,
“resolved”: “https://registry.npmjs.org/@openzeppelin/cli/-/cli-2.8.2.tgz”,

:memo:Details
When deploying a contract on mainnet it hangs at deploying:

$ npx oz deploy
Nothing to compile, all contracts are up to date.
? Choose the kind of deployment regular
? Pick a network mainnet
? Pick a contract to deploy CONTRACT
⠴ Deploying an instance of CONTRACT

The same code works to deploy on Kovan with no issues

Using the following networks.js (ETH gas station says the current fee is 82 gwei):

      provider: () => new HDWalletProvider(
        mnemonic, `https://mainnet.infura.io/v3/${projectId}`
      ),
      networkId: 1,
      gasPrice: 84e9
    }

The spinner is spinning for a long time. It’s been about 30 minutes

[Edit]
I just got this error:
“Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!”
Looks like after 25 minutes it times out. What happened?

1 Like

Hi @eth_user,

Welcome to the community :wave:

Unfortunately this will be due to network congestion.

I assume that your contract was large, so unfortunately need to wait for it to be mined.

You can manually construct <mainnet>.json using the mainnet address and the information from your testnet deployment.
See: https://docs.openzeppelin.com/cli/2.8/configuration#network.json

Otherwise you can try cancelling (send a zero value transfer to your own account) and send with a higher gas price.

Thank you @abcoathup ,
I raised the gas fee to 140 gwei and it worked!
However, at first, I got a different error (this time with a CLI oddity):

nullploying an instance of CONTRACT
✖ Deploying an instance of CONTRACT
Could not find block

It seems that the word null is added to the word Deploying here when a block cannot be found.

Is there somewhere I can learn more about using the network.json file other than in the link above? Seems like valuable information that I don’t know about yet

Thank you, again

1 Like

Hi @eth_user,

How are you connecting to the network? Are you running your own node or using a service like Infura? I couldn’t see anything apparent in https://status.infura.io/

There isn’t any more documentation on the configuration files beyond:
https://docs.openzeppelin.com/cli/2.8/configuration

Feel free to ask any questions and I can try to assist as best I can. :smile:

How are you connecting to the network?

I’m connecting using Infura - my transaction did eventually go through :slight_smile:

1 Like