web3 icon indicating copy to clipboard operation
web3 copied to clipboard

context deadline exceeded

Open devedse opened this issue 2 years ago • 6 comments

Hello, I'm currently running into an issue where it seems that deploying a contract takes longer then the time allowed to wait for it:

COMMANDOUTPUT=$(web3 -f json contract deploy TheContract.bin)
ERROR: Cannot get the receipt: context deadline exceeded

Is there a way to increase the max timeout?

Next to that I also haven't been able to find a way to increase the gas-price when deploying a SmartContract. Is there a way to do that?

devedse avatar Apr 16 '22 18:04 devedse

I created a PR that (hopefully) allows providing a higher gas price: https://github.com/gochain/web3/pull/259

It doesn't solve the timeout issue though.

devedse avatar Apr 17 '22 01:04 devedse

For timeouts, probably need to another flag and use it for the WithTimeout calls: https://github.com/gochain/web3/search?q=WithTimeout

treeder avatar Apr 17 '22 22:04 treeder

If that would solve the timeouts it would be very nice if that could be added. Do you have time to implement this?

devedse avatar Apr 18 '22 00:04 devedse

I did just try the new release (with my PR) however now I'm not even seeing the transaction pop up in Etherscan at all:

web3 -f json contract deploy --gas-price-gwei 5 TheContract.bin

Any idea what I could be doing wrong?

Edit: is there a way to display the transactionId when we get this error:

ERROR: Cannot get the receipt: context deadline exceeded

devedse avatar Apr 18 '22 12:04 devedse

I've added a PR with a start on this: https://github.com/gochain/web3/pull/261

devedse avatar Apr 18 '22 13:04 devedse

Ok I also added a --timout flag. 😄

devedse avatar Apr 18 '22 13:04 devedse