- 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.
4.1 KiB
4.1 KiB
Deploy Smart Interception - Quick Guide
Status: ✅ Code implemented, ready to deploy
🚀 Quick Deploy
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/deploy-smart-interception.sh
📋 What Was Implemented
Code Changes
-
src/clients/web3signer-client.ts- Added
hasKey(address: string): Promise<boolean>method - Queries Web3Signer API to check if address has key
- Added
-
src/handlers/rpc-handler.ts- Added
web3SignerClientparameter to constructor - Modified
handleInterceptedMethod()to check for key before intercepting - If no key: Pass through to Besu (user wallet)
- If key exists: Intercept and sign (service wallet)
- Added
-
src/main.ts- Pass
web3SignerClienttoRpcHandlerconstructor
- Pass
🔄 How It Works
Before (Old Behavior)
eth_sendTransaction → Always intercepted → Try to sign via Web3Signer → ❌ Fails if no key
After (Smart Interception)
eth_sendTransaction
↓
Check: Has key in Web3Signer?
├─→ NO → Pass through to Besu (user wallet) ✅
└─→ YES → Intercept and sign via Web3Signer (service wallet) ✅
✅ Benefits
- MetaMask wallets work automatically - No allowlist needed
- Service wallets still get signed - Web3Signer integration preserved
- Automatic detection - No manual configuration
- Backward compatible - Existing allowlist still works
- Fail-safe - If check fails, defaults to pass-through
🧪 Testing After Deployment
Test User Wallet (MetaMask)
# Should pass through to Besu
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_sendTransaction",
"params": [{
"from": "0x71e81eaec98e507f68bbcf5e2005f179db851603",
"to": "0x0000000000000000000000000000000000000000",
"value": "0x0"
}],
"id": 1
}'
Check logs for: "Address ... has no key in Web3Signer, passing through to Besu"
Test Service Wallet
# Get service wallet address
ADDRESS=$(curl -s http://192.168.11.111:9000/api/v1/eth1/publicKeys | jq -r '.[0]')
# Should be intercepted and signed
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d "{
\"jsonrpc\": \"2.0\",
\"method\": \"eth_sendTransaction\",
\"params\": [{
\"from\": \"$ADDRESS\",
\"to\": \"0x0000000000000000000000000000000000000000\",
\"value\": \"0x0\"
}],
\"id\": 1
}"
Check logs for: "Address ... has key in Web3Signer, intercepting and signing"
📊 Verification
# Check logs for smart interception messages
for IP in 192.168.11.240 192.168.11.241 192.168.11.242; do
echo "=== $IP ==="
ssh -i ~/.ssh/proxmox_translator root@$IP \
"journalctl -u rpc-translator-138.service -n 30 --no-pager | grep -i 'has.*key\|pass.*through\|intercepting' | tail -5"
done
🎯 Integration with Thirdweb
MetaMask Users
No changes needed! Smart interception automatically:
- Detects MetaMask wallet (no key in Web3Signer)
- Passes through
eth_sendTransactionto Besu - OR MetaMask signs locally and uses
eth_sendRawTransaction(already works)
Service Wallets
Works automatically:
- Service wallet has key in Web3Signer
- Translator detects key
- Intercepts and signs via Web3Signer
- Submits to Besu
📝 Configuration Notes
Allowlist (Now Optional for User Wallets)
- Empty allowlist: All addresses can send (not recommended for production)
- Populated allowlist: Additional security layer (only listed addresses)
Recommendation:
- Keep allowlist with service wallet addresses only
- User wallets don't need to be in allowlist (smart interception handles it)
🚀 Deploy Now
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/deploy-smart-interception.sh
This will:
- Build the TypeScript code
- Deploy to all translator VMIDs (2400, 2401, 2402)
- Restart services
- Verify deployment
Status: ✅ Ready to deploy!