Connecting Truffle to any Infura endpoints via HDWalletProvider is very slow

First of all say I checked the similar topics suggested but I didn’t see anything similar.

My environment is:

  • Ubuntu 20.04 LTS, connected via Ethernet.
  • Node 10, 12, 13 (I’ve tried them all, via nvm)
  • Truffle v5.1.33 (for node 10 and 12), and v5.1.35 (for node 13)
  • @truffle/hdwallet-provider v1.0.39

Using an instance of HDWalletProvider set up with my free tier Infura account, I’m able to:

  • Open a Truffle console to Ropsten.
  • Deploy contracts to Ropsten.

The problem is that it takes at least 20 minutes to connect. I do not get any extra information if I append the --verbose-rpc option. Nonetheless, I can curl successfully:

$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'

Getting back:


Any ideas? To be honest I’m quite lost about what is going on.

Many thanks!

Hi @vnavascues - welcome to the Infura community! Occasionally, the miners on Ropsten stop mining for whatever reason. Have you tried using Rinkeby or Goerli instead? They may be able to help you get your contract deployed more quickly.

Hi @Leiya_Kenney, I really appreciate your help. I delayed my response until ran more tests/try things.
I can confirm it does not matter which testnet (via Infura free tier) I connect to, that I always have to wait 20 minutes using my truffle console. It is really slowing down my development because I’m using Chainlink feed price contracts deployed in Ropsten/Rinkeby/Kovan.

I really have the feeling it must be an issue with any of the packages/frameworks used (kind of a compatibility matrix issue). At some point I could try an alternative to Truffle like Buidler.


Hi @vnavascues, thanks for responding to us and for doing the extra tests! I’d suggest trying the Truffle alternative, and please let us know if that’s still slow and we’ll see if we can help figure out what’s going on.

Hi again @Leiya_Kenney, today I connected my laptop to my 4G phone internet (via tethering) and I just got straight connection. If I switch back to my Ethernet/WiFi, no connection/timeout/wait 20 minutes.
Well, I think I will have to contact my IP XD. Unbelievable. Thanks.

Glad you got it all sorted out!