JSON-RPC Server: Comprehensive Guide to Ethereum-Compatible Methods

·

Since GateChain EVM is largely compatible with Ethereum, most content in this documentation originates from contributions to the Ethereum EVM documentation.

JSON-RPC Methods

MethodNamespaceImplementedNotes
web3_clientVersionWeb3
web3_sha3Web3
net_versionNet
eth_protocolVersionEth
eth_syncingEth
eth_gasPriceEth
eth_accountsEth
eth_blockNumberEth
eth_getBalanceEth
eth_getStorageAtEth
eth_getTransactionCountEth
eth_getBlockTransactionCountByNumberEth
eth_getBlockTransactionCountByHashEth
eth_getCodeEth
eth_signEth
eth_sendTransactionEth
eth_sendRawTransactionEth
eth_callEth
eth_estimateGasEth
eth_getBlockByNumberEth
eth_getBlockByHashEth
eth_getTransactionByHashEth
eth_getTransactionByBlockHashAndIndexEth
eth_getTransactionReceiptEth

web3_clientVersion

Returns the current client version.

Parameters

None

Returns

String - Current client version

Example

// Request
{
  "jsonrpc":"2.0",
  "method":"web3_clientVersion",
  "params":[],
  "id":67
}

// Result
{
  "jsonrpc":"2.0",
  "id":1,
  "result":"gate enhanced-1.0.5-135-gf00ae80"
}

👉 Explore more RPC methods


FAQ Section

What is JSON-RPC?

JSON-RPC is a lightweight remote procedure call protocol using JSON for data encoding. It enables communication between Ethereum-compatible clients and applications.

How do I choose between eth_call and eth_sendTransaction?

Use eth_call for read-only operations that don't modify blockchain state. For state-changing operations requiring gas, use eth_sendTransaction or eth_sendRawTransaction.

Why might eth_estimateGas return values higher than actual usage?

Gas estimation accounts for worst-case scenarios including EVM execution paths and network conditions. Actual usage often proves lower after transaction execution.

What's the difference between eth_getBlockByHash and eth_getBlockByNumber?

eth_getBlockByHash retrieves blocks using their unique hash identifier, while eth_getBlockByNumber uses sequential block numbers. The latter cannot retrieve pending blocks.

How can I verify transaction success?

Check status in the transaction receipt (1 for success, 0 for failure). For pre-Byzantium blocks, verify the root field instead.

👉 Learn advanced blockchain techniques