Skip to content

Instantly share code, notes, and snippets.

@felipekm
Last active May 23, 2024 14:36
Show Gist options
  • Save felipekm/f65529251248c764221bf4fcbfc4628d to your computer and use it in GitHub Desktop.
Save felipekm/f65529251248c764221bf4fcbfc4628d to your computer and use it in GitHub Desktop.
EVM RPC Methods

Blockchain Methods

  • eth_blockNumber: Returns the number of the most recent block.
  • eth_getBlockByNumber: Returns information about a block by block number.
  • eth_getBlockByHash: Returns information about a block by block hash.
  • eth_getBlockTransactionCountByNumber: Returns the number of transactions in a block from a block matching the given block number.
  • eth_getBlockTransactionCountByHash: Returns the number of transactions in a block from a block matching the given block hash.
  • eth_getUncleCountByBlockNumber: Returns the number of uncles in a block from a block matching the given block number.
  • eth_getUncleCountByBlockHash: Returns the number of uncles in a block from a block matching the given block hash.

Transaction Methods

  • eth_getTransactionByHash: Returns the information about a transaction requested by transaction hash.
  • eth_getTransactionByBlockHashAndIndex: Returns information about a transaction by block hash and transaction index position.
  • eth_getTransactionByBlockNumberAndIndex: Returns information about a transaction by block number and transaction index position.
  • eth_getTransactionReceipt: Returns the receipt of a transaction by transaction hash.
  • eth_sendTransaction: Creates new message call transaction or a contract creation, if the data field contains code.
  • eth_sendRawTransaction: Creates new message call transaction or a contract creation for signed transactions.
  • eth_getTransactionCount: Returns the number of transactions sent from an address.

Account Methods

  • eth_getBalance: Returns the balance of the account of a given address.
  • eth_getCode: Returns the code at a given address.
  • eth_getStorageAt: Returns the value from a storage position at a given address.
  • eth_call: Executes a new message call immediately without creating a transaction on the blockchain.
  • eth_estimateGas: Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
  • eth_accounts: Returns a list of addresses owned by the client.

Filtering and Event Methods

  • eth_newFilter: Creates a filter object, based on filter options, to notify when the state changes (logs).
  • eth_newBlockFilter: Creates a filter in the node, to notify when a new block arrives.
  • eth_newPendingTransactionFilter: Creates a filter in the node, to notify when new pending transactions arrive.
  • eth_uninstallFilter: Uninstalls a filter with a given filter ID.
  • eth_getFilterChanges: Polls the filter to get changes since the last poll.
  • eth_getFilterLogs: Returns an array of all logs matching filter with given ID.
  • eth_getLogs: Returns an array of all logs matching a given filter object.

Miscellaneous Methods

  • web3_clientVersion: Returns the current client version.
  • web3_sha3: Returns Keccak-256 (not the standardized SHA3-256) of the given data.
  • net_version: Returns the current network ID.
  • net_peerCount: Returns the number of peers currently connected to the client.
  • net_listening: Returns true if the client is actively listening for network connections.

Debugging and Management Methods

  • debug_traceTransaction: Traces a transaction by transaction hash.
  • debug_storageRangeAt: Provides a storage range for a given transaction.

Personal Methods

  • personal_listAccounts: Returns all the Ethereum account addresses of all keys in the key store.
  • personal_newAccount: Generates a new account with a specified password.
  • personal_unlockAccount: Unlocks an account with a specified password for a certain amount of time.
  • personal_lockAccount: Locks an account.
  • personal_sendTransaction: Sends a transaction from the unlocked account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment