4.8 KiB
Using Quorum Network with MetaMask
Overview
Your Quorum test network is running in WSL2, and the RPC endpoints are accessible from Windows. Here's how to configure MetaMask to connect to your local network.
WSL2 Networking
Good News: WSL2 automatically forwards ports to Windows! Services listening on localhost in WSL2 are accessible from Windows via localhost.
No Firewall Configuration Needed: WSL2 handles port forwarding automatically. Docker containers with port mappings like 0.0.0.0:8545->8545/tcp are accessible from Windows.
Available RPC Endpoints
Primary Endpoints (Recommended for MetaMask):
-
JSON-RPC HTTP:
http://localhost:8545- This is the main RPC endpoint (rpcnode)
- Use this for MetaMask
-
EthSigner Proxy:
http://localhost:18545- Alternative endpoint with transaction signing
- Can also be used with MetaMask
Validator Endpoints (Optional):
- Validator 1:
http://localhost:21001 - Validator 2:
http://localhost:21002 - Validator 3:
http://localhost:21003 - Validator 4:
http://localhost:21004
Setting Up MetaMask
Step 1: Add Custom Network
- Open MetaMask in your browser
- Click the network dropdown (top of MetaMask)
- Click "Add Network" or "Add a network manually"
Step 2: Enter Network Details
Fill in the following information:
Network Name: Quorum Test Network
New RPC URL: http://localhost:8545
Chain ID: 1337
Currency Symbol: ETH
Block Explorer URL: http://localhost:25000/explorer/nodes
Important Fields:
- RPC URL:
http://localhost:8545(orhttp://localhost:18545for EthSigner) - Chain ID:
1337(as configured in your network) - Currency Symbol:
ETH(or any name you prefer) - Block Explorer:
http://localhost:25000/explorer/nodes(Quorum Explorer)
Step 3: Save and Connect
- Click "Save"
- MetaMask will switch to your Quorum network
- You should see the network name in the dropdown
Testing the Connection
From Windows Browser/Command Prompt:
-
Test RPC Endpoint (from Windows PowerShell or CMD):
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545 -
Or use a browser:
- Open: http://localhost:25000/explorer/nodes (Quorum Explorer)
- Open: http://localhost:26000 (Blockscout)
- Open: http://localhost:3000 (Grafana)
From WSL2:
# Test RPC endpoint
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:8545
# Should return something like:
# {"jsonrpc":"2.0","id":1,"result":"0x..."}
Troubleshooting
If MetaMask Can't Connect:
-
Verify RPC is Running:
# In WSL2 docker compose ps | grep rpcnode -
Check Port Binding:
# In WSL2 docker ps | grep 8545Should show:
0.0.0.0:8545->8545/tcp -
Test from Windows:
- Open Windows PowerShell
- Run:
Test-NetConnection -ComputerName localhost -Port 8545 - Should show
TcpTestSucceeded : True
-
Windows Firewall (if needed):
- Windows Firewall should allow localhost connections by default
- If blocked, add exception for port 8545
- Or temporarily disable firewall to test
-
WSL2 Port Forwarding:
- WSL2 should forward ports automatically
- If not working, restart WSL:
wsl --shutdown(from Windows PowerShell)
Alternative: Use WSL2 IP Address
If localhost doesn't work, you can use the WSL2 IP address:
-
Find WSL2 IP (from WSL2):
hostname -I # Example output: 192.168.0.3 -
Use in MetaMask:
- RPC URL:
http://192.168.0.3:8545 - Replace
192.168.0.3with your actual WSL2 IP
- RPC URL:
-
Note: This IP may change when WSL2 restarts
Network Information
- Chain ID: 1337
- Network Name: Quorum Dev Quickstart
- Consensus: QBFT (Quorum Byzantine Fault Tolerance)
- Genesis Block: Pre-configured with validators
Getting Test ETH
Since this is a local test network, you'll need to:
-
Import a Pre-funded Account:
- The network has pre-configured accounts with ETH
- Check the
config/nodes/directory for account files - Import the private key into MetaMask
-
Or Mine/Generate ETH:
- Validators are already running
- You can create new accounts in MetaMask
- Use the network's faucet or transfer from validator accounts
Additional Resources
- Quorum Explorer: http://localhost:25000/explorer/nodes
- Blockscout: http://localhost:26000
- Grafana Dashboard: http://localhost:3000
- Prometheus Metrics: http://localhost:9090
Security Note
⚠️ This is a test network - Never use real private keys or real ETH on this network. It's only for development and testing purposes.