Add Ethereum RPC fallback utility with multiple endpoint support #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a robust fallback utility for Ethereum RPC endpoints to improve reliability when querying blockchain data. The current
walletVerify.jsuses a single RPC endpoint, which creates a single point of failure.What's Changed
New Utility Module (
utils/rpcFallback.js)Updated Integration
walletVerify.js: Now uses the fallback utility instead of a single endpointKey Features
Error handling example:
Benefits
The utility includes 5 example RPC endpoints that can be replaced with actual URLs as needed. All endpoint failures are logged with detailed error information, and the system only fails when all endpoints are unreachable.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
blockchain.googleapis.comnode /tmp/testRpcFallback.js(dns block)node /tmp/testWalletVerify.js(dns block)node /tmp/comprehensiveTest.js(dns block)eth-mainnet.alchemyapi.ionode /tmp/testRpcFallback.js(dns block)node /tmp/testWalletVerify.js(dns block)node /tmp/comprehensiveTest.js(dns block)ethereum.publicnode.comnode /tmp/testRpcFallback.js(dns block)node /tmp/testWalletVerify.js(dns block)node /tmp/comprehensiveTest.js(dns block)mainnet.infura.ionode /tmp/testRpcFallback.js(dns block)node /tmp/testWalletVerify.js(dns block)node /tmp/comprehensiveTest.js(dns block)rpc.ankr.comnode /tmp/testRpcFallback.js(dns block)node /tmp/testWalletVerify.js(dns block)node /tmp/comprehensiveTest.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.