API Endpoint Configuration
The RPC service is configured through theJsonRpcConfig structure in the validator. Key configuration options include:
HTTP JSON-RPC Endpoint
By default, the HTTP JSON-RPC server listens on:- Mainnet/Devnet: Port 8899
- Testnet: Port 8899
- Local:
http://localhost:8899
WebSocket PubSub Endpoint
The WebSocket server provides real-time subscriptions:- Mainnet/Devnet: Port 8900 (default)
- Local:
ws://localhost:8900
Configuration Options
TheJsonRpcConfig structure provides several configuration parameters:
| Parameter | Type | Description |
|---|---|---|
enable_rpc_transaction_history | bool | Enable transaction history queries |
enable_extended_tx_metadata_storage | bool | Store extended transaction metadata |
faucet_addr | Option<SocketAddr> | Faucet address for airdrop requests |
health_check_slot_distance | u64 | Slot distance threshold for health checks |
skip_preflight_health_check | bool | Skip health check during transaction preflight |
max_multiple_accounts | Option<usize> | Max accounts in getMultipleAccounts (default: 100) |
rpc_threads | usize | Number of RPC worker threads |
rpc_blocking_threads | usize | Number of blocking operation threads |
full_api | bool | Enable full API including historical methods |
max_request_body_size | Option<usize> | Maximum request body size (default: 50KB) |
disable_health_check | bool | Disable health check endpoint |
Request/Response Format
All HTTP requests use JSON-RPC 2.0 specification:Authentication
Public RPC endpoints do not require authentication. However, production applications should:- Use rate-limited endpoints or run your own validator
- Implement retry logic with exponential backoff
- Monitor rate limit headers (if available)
- Consider private RPC providers for production workloads
Rate Limiting
Public Endpoints
Public Solana RPC endpoints implement rate limiting:- HTTP status
429 Too Many Requestswhen limits exceeded Retry-Afterheader indicates retry delay (seconds)- Default retry logic: 5 retries with 500ms delay
Rate Limit Best Practices
-
Implement exponential backoff
- Use WebSocket subscriptions for real-time data instead of polling
-
Batch requests using
getMultipleAccountswhen possible - Cache responses where appropriate
- Run your own RPC node for high-volume applications
API Categories
The Agave RPC API is organized into several modules:Minimal API (rpc_minimal)
Core methods expected on all validators:
getBalance,getBlockHeight,getEpochInfogetHealth,getIdentity,getSlotgetTransactionCount,getVersion
Bank Data API (rpc_bank)
Methods depending on immediate bank data:
getMinimumBalanceForRentExemptiongetInflationGovernor,getInflationRategetEpochSchedule,getSlotLeader
Accounts API (rpc_accounts)
Account data retrieval:
getAccountInfo,getMultipleAccountsgetTokenAccountBalance,getTokenSupply
Accounts Scan API (rpc_accounts_scan)
Methods requiring account scans:
getProgramAccounts,getLargestAccountsgetTokenAccountsByOwner,getTokenAccountsByDelegate
Full API (rpc_full)
Complete historical and transaction methods:
sendTransaction,simulateTransactiongetBlock,getTransactiongetSignaturesForAddress
Context and Commitment
Many methods return aResponse object with context:
processed: Query most recent block (may be skipped)confirmed: Query optimistically confirmed blockfinalized: Query finalized block (cannot be rolled back)
Request Size Limits
- Default max request body: 50 KB (
MAX_REQUEST_BODY_SIZE) - Max accounts in getMultipleAccounts: 100 (configurable)
- Max signature statuses: 256 queries
- Max confirmed blocks range: 500,000 blocks
- Max slot leaders: 5,000
Error Codes
Common JSON-RPC error codes:| Code | Message | Description |
|---|---|---|
| -32600 | Invalid Request | Malformed JSON-RPC request |
| -32601 | Method not found | RPC method does not exist |
| -32602 | Invalid params | Invalid method parameters |
| -32603 | Internal error | Internal RPC server error |
| -32005 | Node unhealthy | Validator is behind or unhealthy |
| -32007 | Slot skipped | The requested slot was skipped |
| -32009 | Block not available | Block data not available |
| -32014 | Min context slot not reached | Request requires higher slot |
Next Steps
- HTTP Methods - Detailed HTTP JSON-RPC method reference
- WebSocket Methods - Real-time subscription methods
- Deprecated Methods - Legacy methods and migration guide