Metamask: MetaMask not picking Hardhat Accounts from Port 8545

MetaMask not picking up headset accounts on port 8545 in Firefox

As a developer using Web3 and Solidity-based contracts, you are probably used to working with MetaMask. However, when connecting to local development environments such as Hardhat, you may encounter issues that prevent the wallet from picking up accounts correctly. Today, we will explore one such issue: MetaMask not picking up headset accounts on Port 8545 in Firefox.

Issue

When you connect your Hardhat node to a test network (localhost:8545) using MetaMask’s Localhost test network option, it seems like the wallet should automatically pick up the correct account from the list. However, this is not always the case. In some cases, the first account selected is completely different from the actual accounts you listed.

Solution

To resolve this issue, we will investigate the possible causes and provide a step-by-step solution to troubleshoot and fix the issue.

Cause 1: Incorrect account selection

A potential cause of this issue is that the configuration of MetaMask’s Localhost test network does not match the IP address of the Hardhat node ( If the wallet selects an incorrect account, it will not pick up the correct one from the list.

To check this:

  • Open MetaMask in Firefox and go to
    Network >
    Advanced Settings.
  • Verify that “Auto Select Account” is enabled and set to match the IP address of your Hardhat node (

Cause 2: Incorrect wallet configuration

Another potential cause of this issue is incorrect wallet configuration on your node. Hardhat.

You solve:

  • Make sure you are running a recent version of the MetaMask extension.
  • Verify that you have updated the hardhat.config.js file to include the correct IP address for your local development environment (e.g.

Troubleshooting Steps

To troubleshoot and resolve the issue, try the following:

Step 1: Check your wallet configuration

– Make sure MetaMask is installed in your browser.

– Verify that you have updated your Hardhat node to include the correct IP address.

Step 2: Adjust the Localhost test network

– Go back to your MetaMask configuration.

– Change the `Test Networks'' to match the IP address of your headset node (

- Save and restart MetaMask.

Step 3: Review your hardhat node configuration

- In yourhardhat.config.js` file, check for any incorrect configurations that could be causing the issue.

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

Conclusion

If you have tried the troubleshooting steps above and are still having issues with MetaMask selecting hardhat accounts on Port 8545, it is likely due to an incorrect wallet configuration or a mismatch between your hardhat node’s IP address and the Localhost test network setting.

By following these steps, you should be able to resolve this issue and ensure that MetaMask is picking up the correct account from the list when you connect to your local development environment using Hardhat.

ethereum nethttp ruby

Leave a Reply

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