I am getting the following error:

Error: PollingBlockTracker - encountered an error while attempting to update latest block:

Error: project ID is required

at C:\Users\myuser\Code Projects\sdfsd\node_modules@trufflesuite\web3-provider-engine\subproviders\provider.js:18:36

ropsten: {
  provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/2d26d6e3bafb42bfa4fa8cc248350d00"),
  network_id: 3,
  gas: 4000000
  • Make up your mind, is it ropsten or mainnet??? – goodvibration Jun 30 at 15:32
  • And what is "myropstenidhere"? Infura requires an Infura project ID! – goodvibration Jun 30 at 15:32
  • Sorry it's Ropsten made the corrections and put in the Infura Project ID. – Ted Jun 30 at 15:46

A couple of things you have to fix

  • Provider should be a function that returns the provider, and not the provider directly. Check truffle's documentation.
ropsten: {
  provider: function () {
    return new HDWalletProvider(mnemonic, "URL");
  network_id: 3,
  gas: 4000000
  • Once you have registered with Infura they will provide an URL for your project. For ropsten the URL starts with https://ropsten.infura.io/v3/, for example https://ropsten.infura.io/v3/123456789. Sea Infura docs for others networks or protocols supported.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.