This article applies to:
- Binance Smart Chain
For testing purposes, you can connect to the local Hardhat network in MetaMask. This is especially useful when you are testing with a forked network. See also Forking EVM-compatible mainnet with Hardhat.
Run a Hardhat network fork
Connect to the Hardhat network fork in MetaMask
1. Open your MetaMask and click the network selector:
2. In the network selector, click Custom RPC:
3. Enter the following:
- New RPC URL: http://127.0.0.1:8545/
- ChainID: 31337
4. Click Save.