Search code examples
timeoutethereumtrufflemetamasknft

Rinkeby contracts deployment Error: Timeout


I was trying to follow this tutorial:

https://docs.opensea.io/docs/1-structuring-your-smart-contract

And even found this extremely helpful YouTube video to guide me:

https://www.youtube.com/watch?v=lbXcvRx0o3Y&ab_channel=DanViau

But I've encountered a problem after installing and setting up everything I needed. The problem occured when I tried to deploy the contracts using this bash command:

truffle deploy --network rinkeby

The error message I got is:

Error: There was a timeout while attempting to connect to the network.
   Check to see that your provider is valid.
   If you have a slow internet connection, try configuring a longer timeout in your Truffle config. Use the networks[networkName].networkCheckTimeout property to do this.
at Timeout._onTimeout (C:\Users\alonb\.nvm\versions\node\v12.22.5\bin\node_modules\truffle\build\webpack:\packages\provider\index.js:56:1)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)

It's not caused by slow internet connection - I know that because I have tried executing this command on 3 different WiFi connections, one at 200 Mb/s rate.

I have tried to change the truffle-config.js file and add a longer timeout threshold (like suggested here), but the only thing that changed was that the error message took much longer to appear.

Technical info - I'm using Git Bash, npm version 6.14.14, nvm version 0.38.0, node version 12.22.5.

Any suggestions? I'm lost.

Alon


Solution

  • The solution is incredibly easy -

    Instead of using just the relevant part of the Alchemy key:

    40Oo3XScVabXXXX8sePUEp9tb90gXXXX

    I used the whole URL:

    https://eth-rinkeby.alchemyapi.io/v2/40Oo3XScVabXXXX8sePUEp9tb90gXXXX