Ethereum JSON RPC Methods

The execution engine's RPC interface is identical to the upstream Geth RPC interface. (opens in a new tab) The responses are nearly identical too, except we also include the L1 gas usage and price information.

Ethereum is a decentralized, open-source blockchain network with Turing-complete smart contract functionality. Ether (ETH) is the native cryptocurrency. As of mid-September 2022, Ethereum uses the Proof of Stake consensus mechanism.

RPC Methods

This section provides instructions on how to use JSON-RPC API on the Ethereum (execution layer) network.

Error Codes

The following list contains all possible error codes and associated messages:

CodeMessage Meaning Category
-32700Parse error Invalid JSON standard
-32600Invalid request JSON is not a valid request object standard
-32601Method not found Method does not exist standard
-32602Invalid params Invalid method parameters standard
-32603Internal error Internal JSON-RPC error standard
-32000Invalid input Missing or invalid parameters non-standard
-32001Resource not found Requested resource not found non-standard
-32002Resource unavailable Requested resource not available non-standard
-32003Transaction rejected Transaction creation failed non-standard
-32004Method not supported Method is not implemented non-standard
-32005Limit exceeded Request exceeds defined limit non-standard
-32006JSON-RPC version not supported Version of JSON-RPC protocol is not supported non-standard

Example call eth_blockNumber

shell
curl https://rpc-mainnet.cybria.io	 \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}' | jq

Response

shell
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x65a8db"
}