[Ethereum] Truffle Migrate Rinkeby – Error: PollingBlockTracker – encountered an error while attempting to update latest block: Error: ETIMEDOUT

infurarinkebytruffle-migration

I am facing this error when on running truffle migrate on Rinkeby network with my infura

enter image description here

Best Answer

I found the fix by changing the infura Rinkeby RPC_URL in 'the truffle-config.js' file.

Originally I was using the https://rinkeby_url. On using wss://rinkeby_url - it got fixed. Please see a snapshot of the URL from infura. You can create a account on infura and generate these URL. Example of URL from Infura

Example of my truffle-config.js

    rinkeby: {
      provider: () => {
        return new HDWalletProvider(process.env.MNEMONIC, process.env.RINKEBY_RPC_URL)
      },
      network_id: "4",
      networkCheckTimeout: 1000000,
      timeoutBlocks: 200,
      addressIndex: 2

    },