- 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.
5.4 KiB
API Method Support Update - Complete
Date: 2026-01-05
Status: ✅ COMPLETE
Summary
Updated the RPC Translator to fully support both public network and private network Besu API methods, based on the official Besu documentation:
Changes Made
1. RPC Handler Updates
File: src/handlers/rpc-handler.ts
- Separated private network methods from denied methods
- Added
PRIVATE_NETWORK_METHODSconstant (CLIQUE, IBFT, QBFT, PERM) - Made private network methods configurable (default: enabled)
- Improved error messages for denied methods
Before:
const DENIED_METHODS = [
'admin_',
'debug_',
'txpool_',
'miner_',
'clique_', // ❌ Denied
'ibft_', // ❌ Denied
'qbft_', // ❌ Denied
'perm_', // ❌ Denied
];
After:
const DENIED_METHODS = [
'admin_',
'debug_',
'txpool_',
'miner_',
];
const PRIVATE_NETWORK_METHODS = [
'clique_', // ✅ Allowed (configurable)
'ibft_', // ✅ Allowed (configurable)
'qbft_', // ✅ Allowed (configurable)
'perm_', // ✅ Allowed (configurable)
];
2. Configuration Updates
File: src/config.ts
- Added
allowPrivateNetworkMethodsto Config interface - Default:
true(private network methods enabled) - Configurable via
ALLOW_PRIVATE_NETWORK_METHODSenvironment variable
File: env.template
- Added
ALLOW_PRIVATE_NETWORK_METHODS=trueconfiguration option
3. Main Application Updates
File: src/main.ts
- Updated RPC handler instantiation to pass
allowPrivateNetworkMethodsflag
4. Documentation Updates
Created: API_METHODS_SUPPORT.md
- Complete reference for all supported API methods
- Public network methods documentation
- Private network methods documentation (CLIQUE, IBFT, QBFT, PERM)
- Configuration options
- Examples and testing instructions
Updated: README.md
- Added information about private network method support
- Links to Besu API documentation
- Configuration instructions
Supported Methods
Public Network Methods ✅
All standard Ethereum JSON-RPC methods:
eth_*- All standard Ethereum methodsnet_*- Network methodsweb3_*- Web3 utility methodseth_subscribe/eth_unsubscribe- WebSocket subscriptions
Private Network Methods ✅ (Enabled by Default)
- CLIQUE:
clique_*- Proof of Authority consensus - IBFT 2.0:
ibft_*- IBFT consensus - QBFT:
qbft_*- QBFT consensus - PERM:
perm_*- Permissioning (accounts/nodes allowlist)
Intercepted Methods ✅
eth_sendTransaction- Automatically signed and converted toeth_sendRawTransaction
Denied Methods ❌ (Security)
admin_*- Admin methodsdebug_*- Debug methodstxpool_*- Transaction pool methodsminer_*- Miner control methods
Configuration
Enable Private Network Methods (Default)
ALLOW_PRIVATE_NETWORK_METHODS=true
Disable Private Network Methods
ALLOW_PRIVATE_NETWORK_METHODS=false
Examples
Public Network Method
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": [],
"id": 1
}'
Private Network Method (CLIQUE)
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "clique_getSigners",
"params": ["latest"],
"id": 1
}'
Private Network Method (Permissioning)
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "perm_getAccountsAllowlist",
"params": [],
"id": 1
}'
Testing
Test Private Network Method
# Test CLIQUE method
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"clique_getSigners","params":["latest"],"id":1}'
# Test Permissioning method
curl -X POST http://192.168.11.240:9545 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"perm_getAccountsAllowlist","params":[],"id":1}'
Deployment
The updated code has been:
- ✅ Built successfully
- ✅ Configuration updated in
env.template - ✅ Ready for deployment
To deploy the update:
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/deploy-all-vmids.sh
Or manually:
- Build:
pnpm run build - Copy updated files to VMIDs
- Restart services:
systemctl restart rpc-translator-138.service
References
- Besu Public Networks API
- Besu Private Networks API
API_METHODS_SUPPORT.md- Complete method reference
Summary
✅ Public Network Methods: Fully supported
✅ Private Network Methods: Enabled by default
✅ Configuration: Configurable via environment variable
✅ Documentation: Complete API reference created
✅ Backward Compatible: Existing functionality preserved
The RPC Translator now fully supports both public and private network Besu API methods!