0

I'm having some issues determining and connecting with the right MetaMask network.

In Ganache, my RPC server is 127.0.0.1.7545 and the network id is 5777. However, when I try to create a custom RPC in MetaMask with this info, I get the following error:

The endpoint returned a different chain ID: 1337

This is my truffle-config.js:

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    },
    develop: {
      port: 8545
    }
  }
};

I'm hoping this would match to any network id as I've specified, but the console shows the following error:

Contract has not been deployed to detected network (network/artifact mismatch)

I've already tried truffle migrate --reset, without success. I've also tried creating an explicit network for testrpc in truffle-config.js - that didn't work either.

Any help would be much appreciated!

1 Answer 1

0

Did you specify --network development? Because the standard network for deploying with the "migrate" command is called "develop" (you can see it in your truffle-config.js, so you need to explicitly specify the network "development"

NOTE: you may also use the "truffle develop" command to get a truffle console and launch a local ganache blockchain. It helps me to fix troubles connecting truffle with ganache

Your Answer

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

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