ADD_NEW_PROVIDER_CHECKS.md
1 # Adding New RPC Provider Checks 2 3 This guide explains how to add new RPC method checks to the `test_methods.json` file. 4 5 ## Overview 6 7 The `test_methods.json` file contains a list of RPC methods that will be tested against different providers. Each method entry includes: 8 - The RPC method name 9 - Parameters for the method call 10 - Maximum allowed difference in results between providers 11 12 The validation process works as follows: 13 1. For each RPC method, the system makes parallel requests to: 14 - The provider being tested (from `default_providers.json`) 15 - A reference provider (specified in `reference_providers.json`) 16 2. The responses from both providers are compared 17 3. If the difference between results exceeds the specified `maxDifference`: 18 - The provider is temporarily excluded from the list of valid providers 19 - The provider will not be used by the nginx proxy until the next successful validation 20 4. The list of valid providers is continuously updated and used by the nginx proxy for routing requests 21 22 This ensures that only reliable and consistent providers are used for serving RPC requests. 23 24 ## File Structure 25 26 ```json 27 [ 28 { 29 "method": "eth_blockNumber", 30 "params": [], 31 "maxDifference": "4" 32 }, 33 { 34 "method": "eth_getBalance", 35 "params": [ 36 "0x9B27B66D4de4e839326b98108d978526a18E95a3", 37 "latest" 38 ], 39 "maxDifference": "0" 40 } 41 ] 42 ``` 43 44 ## Adding a New Check 45 46 1. Add a new entry to the JSON array with the following structure: 47 ```json 48 { 49 "method": "eth_yourMethod", 50 "params": [ 51 // Your method parameters here 52 ], 53 "maxDifference": "0" 54 } 55 ``` 56 57 2. Required fields: 58 - `method`: The RPC method name (e.g., "eth_getBalance") 59 - `params`: Array of parameters for the method call 60 - `maxDifference`: Maximum allowed difference in results (as a string)