So my issue is when I run the compile and then migrate commands everything goes smooth, then I try to test by running the truffle test command and it gives me an error saying 'Error: The network id specified in the truffle config (4447) does not match the one returned by the network (5777)'. This is what is in my config file at the moment:

module.exports = {
  localGanache: {
    development: {
      host: "",
      port: 7545,
      from: '0xFE50B4F7B2921454E9204596b295d2B3648CF421',
      network_id: "5777",
      gas: 6721975

Do I need to have a separate config file set up for testing? If so what does it look like? Thanks in advance for help and sorry my newbie skills


You can set the ganache-cli network ID by using a flag when running it:

ganache-cli --networkId 4447
| improve this answer | |

As said by @shane you can run the command with the networkId flag or alternatively you can change your config to '*' to match any id provided by ganache.

| 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.