Overview
Thediscover command tests a blockchain endpoint to determine which RPC methods it supports. This is useful for:
- Identifying available methods on a new endpoint
- Validating endpoint capabilities before load testing
- Comparing method support across different providers or node clients
- Troubleshooting method availability issues
Basic Usage
Arguments
The blockchain endpoint URL to test.
Options
Comma-separated list of client types to test. The discovery will check methods specific to these clients.If not specified, defaults to
eth (Ethereum JSON-RPC specification).Use
chainbench list clients to see all available client options and their reference versions.How It Works
-
Method Selection: Based on the
--clientsparameter, Chainbench compiles a list of methods to test - Parallel Testing: Sends test requests for each method concurrently (pool of 20)
-
Response Analysis: Analyzes response codes and error messages to determine support:
- HTTP 200 or valid response → Method supported ✔
- Error code -32601 (Method not found) → Not supported ✖
- Error code -32602 (Invalid params) → Supported but needs params ✔
- HTTP 429 → Rate limited, retries with exponential backoff
- Other errors → Unable to determine
- Results Display: Shows each method with its support status
Examples
- Ethereum Endpoint
- Multiple Clients
- BSC Endpoint
Example Output
Understanding Results
The method is available and responded successfully (or indicated it needs parameters).
The method is not available on this endpoint.
The response was ambiguous. This can happen when:
- The endpoint returns non-standard error codes
- There are connectivity issues
- The endpoint has unusual rate limiting
- The method exists but has strict parameter requirements
Available Clients
To see all available client options:eth- Ethereum JSON-RPC specificationgeth- Geth-specific methodserigon- Erigon-specific methodsbsc- Binance Smart Chain methodsnethermind- Nethermind-specific methods
Rate Limiting
The discovery tool includes automatic retry logic for rate-limited endpoints:- Detects HTTP 429 (Too Many Requests) responses
- Uses exponential backoff (2s minimum, 10s maximum)
- Automatically retries rate-limited requests
- Some providers have strict rate limits on discovery
- Consider using
--clientsto limit the scope of discovery - Wait a few minutes and try again
- Use authenticated endpoints if available
Common Use Cases
Before Load Testing
Comparing Providers
Validating Node Configuration
Troubleshooting
Endpoint Not Responding
All Methods Return “Unable to determine”
Possible causes:- The endpoint requires authentication
- CORS or firewall blocking requests
- The endpoint is not a JSON-RPC endpoint
- Network connectivity issues
Timeout Errors
- Testing during off-peak hours
- Using a different endpoint
- Checking endpoint health status
Technical Details
The discovery implementation:- Timeout: 5 seconds per method request
- Concurrency: Pool of 20 concurrent greenlets
- User Agent: Mimics mobile browser to avoid bot detection
- Error Handling: Analyzes error codes -32600, -32601, -32602, -32604
- Retry Logic: Exponential backoff for HTTP 429
chainbench/tools/discovery/rpc.py.
Related Commands
- chainbench list - List available methods, profiles, shapes, and clients
- chainbench start - Start a load test with discovered methods