3

I am trying to deploy the contract in Ropsten network. It fails with the timeout error

The same is deployed in Ganache without any issues. Please advice

truffle-config.js

require('dotenv').config();
const HDWalletProvider = require('truffle-hdwallet-provider');  

const infuraProvider = network => providerWithMnemonic( 
  process.env.MNEMONIC || '',
  `https://${network}.infura.io/${process.env.INFURA_API_KEY}`
);

 const providerWithMnemonic = (mnemonic, rpcEndpoint) =>
 new HDWalletProvider(mnemonic, rpcEndpoint);

module.exports = {

// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!

  networks: {

development: {
  host: '127.0.0.1',  //localhost
  port: 8545,
  network_id: '*', // eslint-disable-line camelcase
} , 

mainnet: {
  provider: infuraProvider('mainnet'), 
  gasPrice: 10000000000,  // 10 Gwei
  gas: 4000000,
  network_id: '1'
}, 
ropsten: {
  provider: infuraProvider('ropsten'), 
  gasPrice: 1000000000,  // 1 Gwei
  gas: 4000000,
  network_id: '3'
 }, 
kovan: {
  provider: infuraProvider('kovan'),
  gasPrice: 1000000000,
  network_id: '42'
}
 },

solc: {
optimizer: {
  enabled: true,
  runs: 200
}
} 

};

Error Info

C:\Program Files\nodejs\node_modules\truffle\build\webpack:\packages\provider\index.js:56
    throw new Error(errorMessage); 

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:\Program Files\nodejs\node_modules\truffle\build\webpack:\packages\provider\index.js:56:1)
at listOnTimeout (node:internal/timers:556:17)
at processTimers (node:internal/timers:499:7) 
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.