RPC
Robinhood Chain JSON-RPC over HTTP from Blockhash's own node, its limits and its errors.
https://robinhood-mainnet.rpc.blockhash.xyz/<key>| Chain | Robinhood Chain, id 4663 (0x1237) |
| Node | Arbitrum Nitro, a pruned full node |
| Transport | HTTP JSON-RPC: POST with Content-Type: application/json, a single call or a batch |
| Namespaces | eth, net, web3, arb |
| Transactions | eth_sendRawTransaction is forwarded to Robinhood Chain's sequencer. |
| Key | Required, as the last segment of the URL: Get a key |
Examples
The examples read the key from BLOCKHASH_RPC_KEY.
The head block
curl -s "https://robinhood-mainnet.rpc.blockhash.xyz/$BLOCKHASH_RPC_KEY" \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'{"jsonrpc":"2.0","id":1,"result":"0x6ea44eb"}result is the block number in hex: 0x6ea44eb is block 116,016,363.
Logs over 2,000 blocks
The USDG contract's Transfer events from block 116,000,000 (0x6ea0500) to block 116,001,999 (0x6ea0ccf), the widest range one call may ask:
curl -s "https://robinhood-mainnet.rpc.blockhash.xyz/$BLOCKHASH_RPC_KEY" \
-H 'content-type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [{
"fromBlock": "0x6ea0500",
"toBlock": "0x6ea0ccf",
"address": "0x5fc5360d0400a0fd4f2af552add042d716f1d168",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}]
}'result is an array of log objects as the Ethereum JSON-RPC specification defines them: address, topics, data, blockNumber, blockHash, transactionHash, transactionIndex, logIndex and removed.
Name both fromBlock and toBlock.
A tag such as latest counts as the head block, and earliest counts as block 0.
To read a longer span, walk it in ranges of 2,000 blocks.
Limits
Each key is held to these bounds.
| Bound | Value |
|---|---|
| Requests in flight | 8. A batch is one request. |
| Calls in a batch | 20 |
eth_getLogs range | 2,000 blocks, fromBlock to toBlock inclusive. A filter by blockHash is one block. |
| Time a request may take | 10 seconds, a whole batch included |
| Request body | 1 MB (1,000,000 bytes) |
All keys together also share one bound on the node. Past it, a request is refused like a key over its own bound.
Errors
A request over a bound is refused at once with a JSON-RPC error.
| Case | HTTP status | JSON-RPC error |
|---|---|---|
| 8 requests of this key already in flight | 429, with Retry-After: 1 | -32005: "8 calls in flight for this key, the bound is 8; wait for them" |
| The node's shared bound reached | 429, with Retry-After: 1 | -32005 |
| A batch of more than 20 calls | 400 | -32600: "batch of 21 calls is over this key's bound of 20" |
An eth_getLogs range over 2,000 blocks | 200: the error is that call's answer, and a batch's other calls are answered | -32602: "eth_getLogs range of 2001 blocks is over this key's bound of 2000; ask in narrower ranges" |
| A request that runs past 10 seconds | 504 | -32000: "the call held the node past 10000 ms and was cut; ask for less" |
| A body over 1 MB | 413 | -32600: "request body over 1000000 bytes" |
| A body that is not JSON | 400 | -32700: "parse error" |
| The node cannot be reached | 502 | -32603: "upstream unreachable" |
| The node is behind the chain's head | 503 | None |
| A key that does not exist or was revoked | 404 | None |
A 429 looks like this:
HTTP/2 429
content-type: application/json
retry-after: 1
{"jsonrpc":"2.0","id":null,"error":{"code":-32005,"message":"8 calls in flight for this key, the bound is 8; wait for them"}}On a 429, wait the Retry-After seconds and send the request again.
On a 504, ask for less: a narrower log range, or a smaller batch.
On a 503, retry with backoff: the node answers again once it has caught up with the chain.
What it is not
- It is not an archive node. Blocks, transactions, receipts and logs are kept, and state (balances, storage, code,
eth_call) is kept for recent blocks only. A state read at an older block answers an error. - It serves no
debugortracemethods. - It serves no WebSocket, so
eth_subscribeis not available. Poll over HTTP. - It serves Robinhood Chain alone.