As an implementation of HIP 419, the Hedera JSON RPC Relay provides some Ethereum JSON-RPC APIs which implement the JSON-RPC 2.0 Specification to support Ethereum tools interacting with Hedera nodes e.g. wallets, developer tools.
Requests to the Relay will take the form of HTTP calls to an endpoints method.
A curl example to the eth_chainId
takes the form
Request
curl ${RELAY_ENDPOINT_URL} -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"2","method":"eth_chainId","params":[null]}'
Where
- RELAY_ENDPOINT_URL - HTTP url endpoint, default
http://localhost:7546
Result responses can take the form of success or error.
Success Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x4b7"
}
Error Response
{
"id": 2,
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid params"
}
}
The values can range from regular data types (String, int, array) to defined Ethereum objects such as:
The JSON RPC Relay methods implements a subset of the standard method:
Below is a table of provided methods.
The detailed schema specifications of the current methods offerred by the JSON RPC relay is captured in our Open RPC Specification