0

I'm trying to deploy the smart contract using ganache-cli local blockchain server. I started the ganache-cli server and this is how my truffle-config.js file looks like...

Truffle-config.js

 module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
    development: {
      host: "localhost",
      port: 9545,
      network_id: "*" // Match any network id
    },
    ganache: {
    //  networkCheckTimeout: 1000000,  // gives error: Something went wrong while attempting to connect to the network. Check your network configuration.
      host: "12.0.0.1",
      port: 8545,
      network_id: "*", // Match any network id
    }
  }
};

After compiling -> truffle compile and then migrating -> truffle migrate --reset --network ganache, I'm getting this error...

Error Info

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.

I've cleared my DNS cache as this post. I restarted the system. Uninstalled ganache-cli then installed it. Nothing workout, Still getting the same error. BTW my internet is not slow.

Anyone, please help. Stuck in this problem for days. I Couldn't find the solution over the internet. So I posted it here.

Versions

Ganache CLI v6.12.2 (ganache-core: 2.13.2) Truffle v5.3.7 (core: 5.3.7) Solidity v0.5.16 (solc-js) Node v12.21.0 Web3.js v1.3.6

0

try changing development port number to 8545.

development: {
      host: "localhost",
      port: 9545,
      network_id: "*" // Match any network id
    },

and put this code to comment try again.It works for me perfectly.

 //ganache: {
    //  networkCheckTimeout: 1000000,  // gives error: Something went wrong while attempting to connect to the network. Check your network configuration.
     // host: "12.0.0.1",
    //  port: 8545,
   //   network_id: "*", // Match any network id
  //  }
1
  • Thanks! It works for me too.
    – aiky k.
    Jul 9 at 10:48

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.