Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda