Files
quorum-test-network/test-rpc-connection.sh

52 lines
1.5 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# Test RPC connection from WSL2 and provide connection info for MetaMask
echo "=========================================="
echo "Quorum RPC Connection Test"
echo "=========================================="
echo ""
# Get WSL2 IP address
WSL_IP=$(hostname -I | awk '{print $1}')
echo "WSL2 IP Address: $WSL_IP"
echo ""
# Test RPC endpoint
echo "Testing RPC endpoint (localhost:8545)..."
RPC_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:8545 2>&1)
if echo "$RPC_RESPONSE" | grep -q "result"; then
echo "✓ RPC endpoint is working!"
echo "Response: $RPC_RESPONSE"
else
echo "✗ RPC endpoint test failed"
echo "Response: $RPC_RESPONSE"
fi
echo ""
echo "=========================================="
echo "MetaMask Configuration"
echo "=========================================="
echo ""
echo "Use these settings in MetaMask:"
echo ""
echo "Network Name: Quorum Test Network"
echo "RPC URL: http://localhost:8545"
echo "Chain ID: 1337"
echo "Currency Symbol: ETH"
echo "Block Explorer: http://localhost:25000/explorer/nodes"
echo ""
echo "Alternative (if localhost doesn't work):"
echo "RPC URL: http://$WSL_IP:8545"
echo ""
echo "=========================================="
echo "Port Status"
echo "=========================================="
docker compose ps --format "table {{.Service}}\t{{.Ports}}" 2>&1 | grep -E "rpcnode|ethsigner|explorer"
echo ""
echo "=========================================="