JSON-RPC
eth_* / net_* / web3_* / debug_trace* methods, CU weights, and error codes.
Overview
Robinhood Chain uses a JSON-RPC 2.0 gateway (rpc-gateway) for paid API access. All requests are metered in Computation Units (CU) and rate-limited per key.
- Endpoint:
/v1/(nginx) → network gateway (direct) or viaPOST /v1/{api_key} - Protocol: HTTP
POST, single call or batch (max 100 calls) - Metering: The request's total CU cost is pre-deducted from the key's rate-limit bucket on arrival; billing against the account's CU balance only happens after the gateway receives the node's response, settled hourly
- Availability: Methods matching
eth_*,net_*,web3_*,debug_trace*(with exceptions; see below)
See the full specification for endpoint details and live examples.
Integration
1. Get an API Key
See Quickstart → Get an API key.
2. Call JSON-RPC
curl -X POST https://dev-api.blockvectra.network/v1/YOUR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'Key passing (priority order):
- URL path:
POST /v1/{api_key} - Header:
x-api-key: {api_key}(overrides Bearer if non-empty) - Header:
Authorization: Bearer {api_key}
3. Handle CU Costs
Every method carries a CU (Computation Unit) weight; the cost of a request is the sum of the weights of all calls it contains. See the CU weight table below for per-method weights and the cache-hit/default values, and the Billed column of the error codes table for which error conditions are billed.
CU Metering Rules
Computation Unit (CU) weight for each JSON-RPC method.
Resolution Strategy
Exact match > Longest prefix pattern (ending in *) > Default
Cache Hit: 1 CU
Default: 10 CU
| Method | Weight (CU) |
|---|---|
eth_blockNumber | 1 |
eth_call | 20 |
eth_chainId | 1 |
eth_createAccessList | 20 |
eth_estimateGas | 20 |
eth_getBlockByNumber | 5 |
eth_getBlockReceipts | 10 |
eth_getLogs | 50 |
eth_getProof | 10 |
eth_sendRawTransaction | 30 |
eth_simulateV1 | 20 |
debug_trace* | 200 |
Method Policy
Only methods matching an allowed pattern are reachable; a handful of methods are explicitly blocked even though they match one (they return -32601 method not available).
Allowed patterns
eth_*net_*web3_*debug_trace*
Blocked methods
eth_newFiltereth_newBlockFiltereth_newPendingTransactionFiltereth_getFilterLogseth_getFilterChangeseth_uninstallFiltereth_subscribeeth_unsubscribe
Limits:
- Batch: max 100 calls per request
- Request body: max 2 MiB
- CU burst: a request's total CU cost must not exceed the key's bucket capacity (
request cost <N> CU exceeds burst capacity <M> CU)
Error Codes
Complete catalog of JSON-RPC error codes and their billing implications.
| Code | Source | HTTP Status | Message | Billed |
|---|---|---|---|---|
| -32700 | gateway | 200 | parse error | No |
| -32600 | gateway | 200 | invalid request | No |
| -32600 | gateway | 200 | batch too large: max <N> calls | No |
| -32600 | gateway | 200 | invalid request: ambiguous member name | No |
| -32601 | gateway | 200 | method not available: <method> | No |
| -32602 | gateway | 200 | eth_getLogs block range too large: max <N> blocks | No |
| -32010 | gateway | 200 | node is syncing; latest-state calls are temporarily unavailable | No |
| -32011 | gateway | 200 | historical state is not available beyond the most recent <N> blocks | No |
| -32000 | gateway | 200 | transaction not found | No |
| -32000 | gateway | 200 | block not found | No |
| -32000 | gateway | 200 | upstream unavailable | No |
| -32000 | gateway | 200 | upstream response too large | No |
| -32005 | gateway | 200 | gateway overloaded, retry later | No |
| -32005 | gateway | 429 | rate limit exceeded | No |
| -32005 | gateway | 429 | request cost <N> CU exceeds burst capacity <M> CU | No |
| -32603 | gateway | 200 | no response from upstream | No |
| -32603 | gateway | 200 | malformed upstream response | No |
| -32603 | gateway | 200 | internal gateway error | No |
| -32020 | gateway | 402 | insufficient balance | No |
| -32021 | gateway | 503 | billing data temporarily unavailable | No |
| -32030 | nginx | 502 | rpc gateway unreachable | No |
| -32030 | nginx | 503 | rpc gateway unavailable | No |
| -32030 | nginx | 504 | rpc gateway timed out | Possible |
| 4444 | node | 200 | pruned history unavailable | No |
| -32000 | node | 200 | historical state ... is not available | No |
| -32002 | node | 200 | <node message> | No |
| -32003 | node | 200 | <node message> | No |
| -32600 | node | 200 | <node message> | No |
| * | node | 200 | <node message> | Yes |
Full Specification
See the complete JSON-RPC reference for all paths, request/response schemas, and live examples.