Skip to main content
Version: 1.25.4

eth namespace

eth_blockNumber

Returns current block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_blockNumber",
"params": []
}'

eth_call

Executes a tx call (does not create a transaction)

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_call",
"params": [transactionCall, blockParameter]
}'

eth_chainId

Returns ChainID

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_chainId",
"params": []
}'

eth_createAccessList

Creates an EIP2930 type AccessList for the given transaction

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_createAccessList",
"params": [transactionCall, blockParameter, optimize]
}'

eth_estimateGas

Executes a tx call and returns gas used (does not create a transaction)

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_estimateGas",
"params": [transactionCall, blockParameter]
}'

eth_feeHistory

Returns block fee history.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_feeHistory",
"params": [blockCount, newestBlock, rewardPercentiles]
}'

eth_getAccount

Retrieves Accounts via Address and Blocknumber

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getAccount",
"params": [accountAddress, blockParameter]
}'

eth_getBalance

Returns account balance

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBalance",
"params": [address, blockParameter]
}'

eth_getBlockByHash

Retrieves a block by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByHash",
"params": [blockHash, returnFullTransactionObjects]
}'

eth_getBlockByNumber

Retrieves a block by number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByNumber",
"params": [blockParameter, returnFullTransactionObjects]
}'

eth_getBlockReceipts

Get receipts from all transactions from particular block, more efficient than fetching the receipts one-by-one.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockReceipts",
"params": [blockParameter]
}'

eth_getBlockTransactionCountByHash

Returns number of transactions in the block block hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByHash",
"params": [blockHash]
}'

eth_getBlockTransactionCountByNumber

Returns number of transactions in the block by block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByNumber",
"params": [blockParameter]
}'

eth_getCode

Returns account code at given address and block

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getCode",
"params": [address, blockParameter]
}'

eth_getFilterChanges

Reads filter changes

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterChanges",
"params": [filterId]
}'

eth_getFilterLogs

Reads filter changes

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterLogs",
"params": [filterId]
}'

eth_getLogs

Reads logs

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getLogs",
"params": [filter]
}'

eth_getProof

https://github.com/ethereum/EIPs/issues/1186

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getProof",
"params": [accountAddress, hashRate, blockParameter]
}'

eth_getStorageAt

Returns storage data at address. storage_index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getStorageAt",
"params": [address, positionIndex, blockParameter]
}'

eth_getTransactionByBlockHashAndIndex

Retrieves a transaction by block hash and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockHashAndIndex",
"params": [blockHash, positionIndex]
}'

eth_getTransactionByBlockNumberAndIndex

Retrieves a transaction by block number and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'

eth_getTransactionByHash

Retrieves a transaction by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByHash",
"params": [transactionHash]
}'

eth_getTransactionCount

Returns account nonce (number of trnsactions from the account since genesis) at the given block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionCount",
"params": [address, blockParameter]
}'

eth_getTransactionReceipt

Retrieves a transaction receipt by tx hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionReceipt",
"params": [txHashData]
}'

eth_getUncleByBlockHashAndIndex

Retrieves an uncle block header by block hash and uncle index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockHashAndIndex",
"params": [blockHashData, positionIndex]
}'

eth_getUncleByBlockNumberAndIndex

Retrieves an uncle block header by block number and uncle index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'

eth_getUncleCountByBlockHash

Returns number of uncles in the block by block hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockHash",
"params": [blockHash]
}'

eth_getUncleCountByBlockNumber

Returns number of uncles in the block by block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockNumber",
"params": [blockParameter]
}'

eth_newBlockFilter

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newBlockFilter",
"params": []
}'

eth_newFilter

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newFilter",
"params": [filter]
}'

eth_newPendingTransactionFilter

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newPendingTransactionFilter",
"params": []
}'

eth_pendingTransactions

Returns the pending transactions list

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_pendingTransactions",
"params": []
}'

eth_protocolVersion

Returns ETH protocol version

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_protocolVersion",
"params": []
}'

eth_sendRawTransaction

Send a raw transaction to the tx pool and broadcasting

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendRawTransaction",
"params": [transaction]
}'

eth_sendTransaction

Send a transaction to the tx pool and broadcasting

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendTransaction",
"params": [rpcTx]
}'

eth_subscribe

Starts a subscription to a particular event over WebSockets. A JSON-RPC notification with event payload and subscription id is sent to a client for every event matching the subscription topic.

info

This method is enabled by adding subscribe to --JsonRpc.EnabledModules.

wscat -c ws://localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_subscribe",
"params": [subscriptionName, args]
}

Subscription topics

newHeads

Subscribes to incoming block headers. Fires a notification each time a new header is appended to the chain, including chain reorganizations.

Notification payload: object

  • author: string (address)
  • baseFeePerGas: string (hex integer)
  • blobGasUsed: string (hex integer)
  • difficulty: string (hex integer)
  • excessBlobGas: string (hex integer)
  • extraData: string (hex data)
  • gasLimit: string (hex integer)
  • gasUsed: string (hex integer)
  • hash: string (hash)
  • logsBloom: string (hex data)
  • miner: string (address)
  • mixHash: string (hash)
  • nonce: string (hex data)
  • number: string (hex integer)
  • parentBeaconBlockRoot: string (hash)
  • parentHash: string (hash)
  • receiptsRoot: string (hash)
  • sha3Uncles: string (hash)
  • signature: string (hex data)
  • size: string (hex integer)
  • stateRoot: string (hash)
  • step: string (hex integer)
  • timestamp: string (hex integer)
  • totalDifficulty: string (hex integer)
  • transactions: array of object
  • transactionsRoot: string (hash)
  • uncles: array of string (hash)
  • withdrawals: array of object
    • address: string (address)
    • amount: string (hex integer)
    • index: string (hex integer)
    • validatorIndex: string (hex integer)
  • withdrawalsRoot: string (hash)

logs

Subscribes to incoming logs filtered by the given options. In case of a chain reorganization, previously sent logs on the old chain will be re-sent with the removed field set to true.

Notification payload: object

  • address: string (address)
  • blockHash: string (hash)
  • blockNumber: string (hex integer)
  • data: string (hex data)
  • logIndex: string (hex integer)
  • removed: boolean
  • topics: array of string (hash)
  • transactionHash: string (hash)
  • transactionIndex: string (hex integer)
  • transactionLogIndex: string (hex integer)

newPendingTransactions

Subscribes to incoming pending transactions. Returns the transaction hash.

Notification payload: string (hash)

droppedPendingTransactions

Subscribes to transactions evicted from the transaction pool. Returns the transaction hash.

Notification payload: string (hash)

syncing

Subscribes to syncing events. Returns false (once) if the node is synced or an object with statistics (once) when the node starts syncing.

Notification payload:

  • if synced: boolean
  • if syncing: object
    • currentBlock: string (hex integer)
    • highestBlock: string (hex integer)
    • isSyncing: boolean
    • startingBlock: string (hex integer)

eth_syncing

Returns syncing status

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_syncing",
"params": []
}'

eth_uninstallFilter

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_uninstallFilter",
"params": [filterId]
}'

eth_unsubscribe

Unsubscribes from a subscription.

info

This method is enabled by adding subscribe to --JsonRpc.EnabledModules.

wscat -c ws://localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_unsubscribe",
"params": [subscriptionId]
}