Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Metamask does not select my Ganache network

I have a local ganache running and I have a select field in my application where a network can be selected. Once a network is selected I'm running this code to switch to that network in metamask:

await ethereum.request({
  method: 'wallet_switchEthereumChain',
  params: [{ chainId: selectedChainId }],
});

I have added my ganache instance as network to metamask with the following information:

  • Name: Ganache Local
  • RPC URL: HTTP://127.0.0.1:7545 (this is what ganache shows me)
  • Chain ID: 1337

Now when I select my ganache network in my application, metamask always tries to switch to the network "Localhost 8545". I think because it has the same chain id. Thats why I have deleted the "Localhost 8545" network to only have one network with the chain id 1337, but if I try it again metamask still chooses the "Localhost 8545" network, even if it does not exist anymore:

enter image description here

And if I confirm then no network switch is applied and I'm getting no error or something else.

Any idea how I can switch to my ganache network programmatically to test my application with ganache?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!