Metamask: MetaMask not picking Hardhat Accounts from Port 8545

Metamask not choosing hardhat accounts on Port 8545 in Firefox

As a developer using web 3 and solidity contracts, you are probably used to working with Metamask. However, when connecting to local development environments like Hardhat, you may encounter problems that prevent the portfolio from correctly picking up the accounts. Today, we will explore one of these problems: Metamask not selecting the Hardhat accounts on Port 8545 in Firefox.

The problem

When you connect your Hardhat node to a test network (LocalHost: 8545) using the Metamask Localhost Test Network option, it seems that the portfolio should automatically select the correct account in the list. However, this is not always the case. In some cases, the first selected account is entirely different from the real accounts you have listed.

The solution

To solve this problem, we will investigate the possible causes and provide a step -by -step solution to help out and solve the problem.

Cause 1: Incorrect account selection

A potential cause of this problem is that the configuration of the Metamask localhost test network does not correspond to the IP address of your Hardhat node ( If the wallet selects an incorrect account, it will not collect the right one from the list.

To check this:

  • Open Metamask on Firefox and access
    Network

    Metamask: MetaMask not picking Hardhat Accounts from Port 8545

    >
    Advanced settings .

  • Check if “Auto select account” is activated and defined to correspond to the IP address of your Hardhat node (

Cause 2: Incorrect wallet configuration

Another potential cause of this problem is an incorrect portfolio configuration on your hard knot.

To resolve:

  • Make sure you are running a recent version of the Metamask extension.

  • Check if you have updated your Hardhat.config.js' file to include the correct IP address for your local development environment (for example,

Troubleshooting stages

To help out and solve the problem, try the following:

Step 1: Check the wallet configuration

- Make sure Metamask is installed on your browser.

- Check if you have updated your Hardhat node to include the correct IP address.

Step 2: Adjust the Localhost test network

- Return to the configuration of your metamask.

- Change the "test networks" to match the IP address of your Hardhat node (

- Save and restart Metamask.

Step 3: Review the configuration of the Hardhat node

- In your Hardhat.config.js file, check all the incorrect configurations that could cause the problem.

– Make sure you use the network settings and the correct IP address (

Conclusion

If you have tried the above troubleshooting steps and you always encounter problems with Metamask selecting Hardhat accounts on Port 8545, this is probably due to an incorrect portfolio configuration or an unconcival between the IP address From your Hardhat node and the localhost test network setting.

By following these steps, you should be able to solve this problem and make sure that Metamask takes the correct account of the list when connecting to your local development environment using Hardhat.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *