- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
63 lines
1.4 KiB
Bash
Executable File
63 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Test RPC endpoints
|
|
# Usage: ./scripts/test-rpc.sh <HTTP_URL> [WS_URL]
|
|
|
|
set -e
|
|
|
|
HTTP_URL="${1:-http://localhost:9545}"
|
|
WS_URL="${2:-ws://localhost:9546}"
|
|
|
|
echo "Testing RPC Translator endpoints..."
|
|
echo "HTTP URL: $HTTP_URL"
|
|
echo "WS URL: $WS_URL"
|
|
echo ""
|
|
|
|
# Test health endpoint
|
|
echo "1. Testing health endpoint..."
|
|
curl -s "$HTTP_URL/health" | jq '.' || echo "Failed"
|
|
echo ""
|
|
|
|
# Test eth_chainId
|
|
echo "2. Testing eth_chainId..."
|
|
curl -s -X POST "$HTTP_URL" \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"jsonrpc": "2.0",
|
|
"method": "eth_chainId",
|
|
"params": [],
|
|
"id": 1
|
|
}' | jq '.' || echo "Failed"
|
|
echo ""
|
|
|
|
# Test eth_blockNumber
|
|
echo "3. Testing eth_blockNumber..."
|
|
curl -s -X POST "$HTTP_URL" \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"jsonrpc": "2.0",
|
|
"method": "eth_blockNumber",
|
|
"params": [],
|
|
"id": 2
|
|
}' | jq '.' || echo "Failed"
|
|
echo ""
|
|
|
|
# Test eth_gasPrice
|
|
echo "4. Testing eth_gasPrice..."
|
|
curl -s -X POST "$HTTP_URL" \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"jsonrpc": "2.0",
|
|
"method": "eth_gasPrice",
|
|
"params": [],
|
|
"id": 3
|
|
}' | jq '.' || echo "Failed"
|
|
echo ""
|
|
|
|
echo "✅ RPC tests complete!"
|
|
echo ""
|
|
echo "Note: To test eth_sendTransaction, you need:"
|
|
echo " - A wallet address in the allowlist"
|
|
echo " - Web3Signer configured with that wallet's key"
|
|
echo " - Proper nonce and gas settings"
|
|
echo ""
|