> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Goldsky's indexed data as gRPC cache for eRPC

> Plug Goldsky's indexed chain data into eRPC as a read-only gRPC cache. $5 per million calls.

Goldsky serves its indexed chain data over gRPC at `grpcs://edge.goldsky.com/cache/{chain}`. Add it to [eRPC](https://github.com/erpc/erpc) as a cache connector: eRPC reads history from Goldsky first, and anything Goldsky can't answer goes to your own upstreams as before.

<Note>
  Early access: every Edge API key can call it. Ask your Goldsky contact if you plan high volume.
</Note>

## eRPC config

```yaml erpc.yaml theme={"dark"}
database:
  evmJsonRpcCache:
    connectors:
      - id: goldsky-cache
        driver: grpc
        grpc:
          servers:
            - grpcs://edge.goldsky.com/cache/ethereum
            - grpcs://edge.goldsky.com/cache/base
          headers:
            x-api-key: ${GOLDSKY_API_KEY}
          getTimeout: 200ms
    policies:
      - connector: goldsky-cache
        network: "evm:1|evm:8453"
        method: eth_getBlockByNumber|eth_getBlockByHash|eth_getLogs|eth_getTransactionByHash|eth_getTransactionReceipt|eth_getBlockReceipts
        finality: finalized
        empty: allow
        appliesTo: get
```

* Add one URL per chain. eRPC calls `ChainId` on each one to map it to a network (`evm:1`, `evm:8453`).
* Keep `appliesTo: get`: the connector is read-only.
* `getTimeout: 200ms` keeps the cache from slowing you down: a read it can't answer that fast goes to your upstreams. Block, transaction and receipt reads answer well within it; wide `eth_getLogs` ranges take longer. Raising it keeps those in the cache, but every cache read may then wait that long.
* Keep your `memory` or `redis` connector beside it for writes and recent blocks.

## Methods

Goldsky speaks the open [`bds.evm.RPCQueryService`](https://github.com/blockchain-data-standards/manifesto) gRPC API.

| gRPC method | JSON-RPC equivalent |
| - | - |
| `GetBlockByNumber` | `eth_getBlockByNumber` (a block number, not a tag) |
| `GetBlockByHash` | `eth_getBlockByHash` |
| `GetLogs` | `eth_getLogs` (a numeric block range or `blockHash`) |
| `GetTransactionByHash` | `eth_getTransactionByHash` |
| `GetTransactionReceipt` | `eth_getTransactionReceipt` |
| `GetBlockReceipts` | `eth_getBlockReceipts` |
| `ChainId` | `eth_chainId` |

Data Goldsky hasn't indexed yet, such as blocks at the tip, answers `OUT_OF_RANGE`. eRPC treats that as a miss and asks your upstreams.

`eth_getLogs` covers up to 30,000 blocks per call.

## Call it directly

Any gRPC client works. grpcurl can't add a URL path, so it names the chain in the `x-goldsky-chain` header:

```bash theme={"dark"}
git clone https://github.com/blockchain-data-standards/manifesto
grpcurl -import-path manifesto/evm -import-path manifesto -proto rpc.proto \
  -H "x-api-key: $GOLDSKY_API_KEY" -H "x-goldsky-chain: ethereum" \
  -d '{"blockNumber":"0x18ea234"}' \
  edge.goldsky.com:443 bds.evm.RPCQueryService/GetBlockByNumber
```

## Pricing

\$5 per million successful calls, the same as [Edge RPC](/pricing/summary#edge-rpc). Errors, misses (`OUT_OF_RANGE`) and `ChainId` checks are free.

## Supported chains

abstract, arbitrum, arbitrum-sepolia, arc, avalanche, base, base-sepolia, bsc, celo, ethereum, gnosis, hyperevm, ink, monad, optimism, polygon, robinhood, robinhood-testnet, sei, sepolia, tempo, tron.

Can't find what you're looking for? Reach out to us at [support@goldsky.com](mailto:support@goldsky.com) for help.


## Related topics

- [Boost reference](/boost/reference.md)
- [How Boost routes requests](/boost/how-it-works.md)
- [Cut RPC costs with Boost](/boost.md)
- [Which product do I need?](/which-product.md)
- [Fanout](/edge-rpc/tiers/fanout.md)
