gochain / web3

A CLI tool to interact with web3 blockchains - Ethereum, GoChain, etc
https://gochain.io
Apache License 2.0
402 stars 88 forks source link

context deadline exceeded #258

Open devedse opened 2 years ago

devedse commented 2 years ago

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 commented 2 years ago

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.

treeder commented 2 years ago

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

devedse commented 2 years ago

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

devedse commented 2 years ago

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 commented 2 years ago

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

devedse commented 2 years ago

Ok I also added a --timout flag. 😄