Overview
Chainbench’s discovery tool sends test requests to your endpoint for a comprehensive list of RPC methods and identifies which ones are supported. The tool intelligently handles different error codes and responses to determine method availability.Basic Usage
Discover methods on an endpoint:Specify Client Types
Target specific blockchain clients to test their supported methods:Available Clients
View all supported client options and their versions:Supported Clients
The discovery tool supports multiple blockchain clients:- Ethereum Clients:
geth,erigon,besu,nethermind,reth,eth - EVM-Compatible:
bsc,bor(Polygon),base,optimism,zksync - Other Chains:
avalanchego,solana,juno,pathfinder(Starknet)
Some clients like Avalanche have multiple endpoints that are tested automatically:
/ext/bc/C/rpc(C-Chain RPC)/ext/bc/C/avax(Avalanche specific)/ext/bc/P(Platform Chain)/ext/bc/X(Exchange Chain)
How It Works
The discovery process works by:- Loading Method Database: Reads from
methods.jsonto get the list of methods supported by each client type - Filtering Methods: Only tests methods that match the specified clients
- Parallel Testing: Uses a gevent pool to test up to 20 methods concurrently
- Smart Detection: Analyzes HTTP status codes and JSON-RPC error codes to determine support
Detection Logic
The tool interprets responses as follows:Response Status Codes
Response Status Codes
- 200/400 + Error -32602: Method supported (invalid params)
- 200/400 + Error -32601: Method not supported
- 200/400 + Errors -32600/-32604: Checks error message for “unsupported” keywords
- 429: Too many requests - automatically retries with exponential backoff
- Other errors: Unable to determine
Output Format
The discovery tool outputs results in a simple format:- ✔ indicates the method is supported
- ✖ indicates the method is not supported
- Error messages indicate the test was inconclusive
Advanced Usage
Testing Specific Client Endpoints
For Avalanche nodes with multiple endpoints:Rate Limiting
The discovery tool includes built-in retry logic for rate-limited endpoints:- Waits 2 seconds before the first retry
- Exponentially increases wait time up to 10 seconds
- Continues retrying until successful
Client Configuration
The discovery tool uses two JSON configuration files:clients.json
Defines available clients and their versions:methods.json
Maps RPC methods to the clients that support them. This file determines which methods are tested for each client option.Use Cases
Validate Node Configuration
Validate Node Configuration
After setting up a new node, use discovery to verify all expected methods are enabled and accessible.
Compare Providers
Compare Providers
Test multiple endpoints to compare method availability across different infrastructure providers.
Debug Access Issues
Debug Access Issues
Quickly identify if a method is unsupported or if there’s a configuration issue preventing access.
Profile Compatibility
Profile Compatibility
Before running a benchmark profile, verify that the target endpoint supports all required methods.
Troubleshooting
Timeout Errors
If you see timeout errors:Unable to Determine Results
Some methods may return inconclusive results:- Supported but requires specific parameters
- Behind an authentication wall
- Restricted by the provider
No Output
If the discovery produces no output:- Verify the endpoint URL is correct and accessible
- Check if the endpoint requires authentication headers
- Try with the default
--clients ethoption first
Integration with Benchmarks
Use discovery results to:- Select appropriate profiles: Choose profiles that only use supported methods
- Customize profiles: Remove unsupported methods from custom profiles
- Filter tests: Use
--exclude-tagsto skip methods you know aren’t supported