This Ethereum API Reference provides everything you need to interact with Ethereum nodes using GetBlock’s infrastructure.
GetBlock provides RPC endpoints that implement the Ethereum JSON-RPC API standard. These methods are core functionalities for interacting with Ethereum nodes. Many Ethereum-compatible blockchains (EVM chains) – such as BNB Chain, Polygon, Linea, Base, Optimism, and Arbitrum – also adopt this standard, making it applicable across various ecosystems.
Overview of Ethereum Network Methods
The Ethereum network offers a comprehensive suite of methods that enable developers to interact seamlessly with its blockchain infrastructure. This overview provides an in-depth examination of these methods, categorizing them into key functional areas for better understanding and implementation.
Compatibility with the Ethereum mainnet and testnets
Purpose, functionality, and use cases of each Ethereum method
Required input parameters
Sample requests and responses
Code examples in multiple programming languages (Python, JavaScript)
Query real-time blockchain data
Manage and monitor accounts and balances.
Interact with smart contracts
Submit and track transactions
Monitor network activity in real-time
To effectively use the Ethereum methods listed above, you'll need a reliable tool to send requests to the network. One such tool is Axios, a lightweight and widely used HTTP client. With Axios, you can easily interact with Ethereum's JSON-RPC API to execute transactions, retrieve blockchain data, and much more.
Axios is a powerful HTTP client that streamlines communication with APIs, including Ethereum's JSON-RPC interface. By using Axios, developers can effortlessly send requests and process responses, making blockchain integration straightforward and efficient. Below, we provide a detailed guide to help you get started:
Developers new to Ethereum can efficiently interact with the Ethereum API by leveraging Axios, a well-regarded HTTP client. It simplifies API integration, making it user-friendly and effective. Here’s how you can get started:
1. Set Up Your Project
Choose a package manager and initialize your project:
Or, using Yarn:
2. Install Axios
Install Axios to make API requests:
Or, using Yarn:
3. Make Your First Request
Set up a new file named index.js and insert the code snippet provided below:
Replace <ACCESS-TOKEN> with your actual API key from the GetBlock. You can also use other networks by replacing the URL with those of Sepolia or Holesky testnets.
4. Run Your Script
Execute your script with:
node index.js
You should see the latest block number logged to your console.
requests is a powerful and easy-to-use HTTP library for Python that simplifies API interactions, including Ethereum’s JSON-RPC API. With requests, developers can send requests, handle responses, and easily integrate blockchain functionality into their projects. Here’s a step-by-step guide to get started:
1. Set Up Your Project
Create a new directory for your project and navigate into it:
Set up a virtual environment to isolate dependencies:
Install the requests library:
2. Write Your First Script
Create a new file called main.py and insert the following code:
3. Run Your Script
Execute the script with:
You should see the latest block number retrieved from the Ethereum network printed to your console.
1. Account and Balance Management
These methods allow users to retrieve information about Ethereum accounts and their balances.
eth_getBalance: Allows developers to query the Ether balance of any account at a precise blockchain height for better transaction tracking and financial auditing.
Parameters: Address, Block Identifier
Response: Balance in Wei
eth_accounts: Lists all accounts managed by the connected Ethereum node.
Response: Array of account addresses
2. Block and Transaction Retrieval
Key methods to fetch block and transaction data from the blockchain.
eth_blockNumber: Retrieves the latest block number.
Response: Block number
eth_getBlockByNumber: Fetches a block by its number.
Parameters: Block Number, Boolean (for full transaction objects)
Response: Block data
eth_getBlockByHash: Retrieves a block using its hash.
Parameters: Block Hash, Boolean (for full transaction objects)
Response: Block data
eth_getTransactionByHash: Fetches details of a specific transaction.
Parameters: Transaction Hash
Response: Transaction object
eth_getTransactionReceipt: Provides the receipt of a processed transaction.
Parameters: Transaction Hash
Response: Receipt object
eth_getBlockReceipts: Retrieves all transaction receipts for a specific block.
Parameters: Block Identifier (hash or number)
Response: Array of transaction receipts
eth_getBlockTransactionCountByHash: Retrieves the number of transactions in a block identified by its hash.
Parameters: Block Hash
Response: Integer
eth_getBlockTransactionCountByNumber: Retrieves the number of transactions in a block identified by its number.
Parameters: Block Number
Response: Integer
eth_getTransactionByBlockHashAndIndex: Retrieves a transaction by block hash and index.
Parameters: Block Hash, Index
Response: Transaction object
eth_getTransactionByBlockNumberAndIndex: Retrieves a transaction by block number and index.
Parameters: Block Number, Index
Response: Transaction object
3. Smart Contract Interaction
Methods to interact with deployed smart contracts on the Ethereum network.
eth_call: Executes a read-only call to a smart contract.
Parameters: Transaction object, Block Identifier
Response: Returned data from the contract
eth_estimateGas: Estimates the gas required to execute a transaction.
Parameters: Transaction object
Response: Estimated gas value
eth_getCode: Retrieves the bytecode of a smart contract.
Parameters: Address, Block Identifier
Response: Contract bytecode
eth_getStorageAt: Retrieves the value of a specific storage slot at an address.
Parameters: Address, Storage Slot, Block Identifier
Response: Data
eth_getProof: Retrieves the Merkle proof for a storage slot.
Parameters: Address, Storage Slots, Block Identifier
Response: Proof object
4. Debug and Trace Utilities
Advanced methods for developers requiring detailed blockchain insights.
debug_accountRange: Fetches a specified range of accounts based on a particular block height for detailed analysis.
Parameters: Block Identifier, Start Account, Limit
Response: List of accounts
debug_batchSendRawTransaction: Sends a batch of raw transactions to the network.
Parameters: Array of raw transactions
Response: Array of transaction hashes
debug_getBadBlocks: Lists blocks considered invalid by the node.
Response: Array of block details
debug_storageRangeAt: Retrieves a range of storage keys from a specific address.
Parameters: Block Identifier, Address, Start Key, Limit
Response: Storage range details
debug_traceBlock: Traces all transactions in a block by number.
Parameters: Block Number
Response: Array of traces
debug_traceBlockByHash: Traces all transactions in a block by hash.
Parameters: Block Hash
Response: Array of traces
debug_traceBlockByNumber: Traces all transactions in a block by number.
Parameters: Block Number
Response: Array of traces
debug_traceCall: Simulates a contract call for debugging.
Parameters: Transaction object, Block Identifier, Options
Response: Trace details
debug_traceTransaction: Provides an execution trace of a transaction.
Parameters: Transaction Hash
Response: Trace details
5. Mining and Node Management
Methods to manage and monitor the Ethereum node itself.
eth_mining: Indicates if the node is currently mining.
Response: Boolean
eth_hashrate: Provides the current hash rate of the node.
Response: Hash rate in hashes per second
eth_syncing: Provides information about the node's syncing status, indicating whether it is fully synchronized with the network.
Response: Syncing object or false
eth_submitWork: Submits a proof-of-work solution.
Parameters: Nonce, PowHash, MixDigest
Response: Boolean
eth_submitHashrate: Submits the hash rate of a mining node.
Parameters: Hashrate, ID
Response: Boolean
eth_getWork: Provides the data a miner needs to produce the proof-of-work.
Response: Work data
eth_coinbase: Retrieves the current coinbase address (the address to which mining rewards are directed).
Response: Address
6. Event and Log Management
Facilitate tracking of specific events on the blockchain.
eth_getLogs: Retrieves logs matching filter criteria.
Parameters: Filter object (addresses, topics, block range)
Response: Array of logs
eth_newFilter: Creates a new filter object for events.
Parameters: Filter object
Response: Filter ID
eth_uninstallFilter: Removes a filter object.
Parameters: Filter ID
Response: Boolean
eth_newBlockFilter: Creates a filter for new block notifications.
Response: Filter ID
eth_newPendingTransactionFilter: Creates a filter for pending transaction notifications.
Response: Filter ID
eth_getFilterChanges: Retrieves changes for a given filter.
Parameters: Filter ID
Response: Array of changes
eth_getFilterLogs: Retrieves all logs for a filter.
Parameters: Filter ID
Response: Array of logs
7. Miscellaneous Utility Methods
These methods provide various utilities to aid Ethereum developers.
eth_gasPrice: Retrieves the current gas price in the network.
Response: Gas price in Wei
eth_chainId: Returns the ID of the current blockchain.
Response: Chain ID
eth_maxPriorityFeePerGas: Retrieves the maximum priority fee per gas.
Response: Gas fee in Wei
eth_feeHistory: Provides historical data on gas fees.
Parameters: Block Count, Newest Block, Reward Percentiles
Response: Fee history object
eth_sendRawTransaction: Sends a raw transaction to the network.
Parameters: Signed transaction data
Response: Transaction hash
web3_clientVersion: Provides the client software version.
Response: String
web3_sha3: Returns the Keccak-256 hash of input data.
Parameters: Data (hex string)
Response: Hash (hex string)
rpc_modules: Lists available RPC modules.
Response: Object of module names and versions
net_listening: Indicates if the node is accepting connections.
Response: Boolean
net_peerCount: Returns the number of connected peers.
Response: Integer
net_version: Provides the network ID.
Response: String
eth_subscribe: Subscribes to a particular event stream, such as new blocks or logs.
Parameters: Subscription type, Options
Response: Subscription ID
eth_unsubscribe: Unsubscribes from a previously created subscription.
Parameters: Subscription ID
Response: Boolean
The Ethereum network methods are versatile and cater to diverse use cases, from simple account balance queries to advanced transaction tracing. The added quickstart guide demonstrates how to leverage Axios for making efficient API requests, enabling developers to start building on Ethereum seamlessly. By categorizing and simplifying these concepts, this overview aims to enhance productivity for both new and experienced Ethereum developers.
Invoke smart contract functions locally using eth_call for read-only queries without altering blockchain state. Essential for dApps to fetch data like balances or contract states via JSON-RPC.
The eth_call method is used to invoke a smart contract function locally, without altering the blockchain's state.
The eth_call method is essential in the Ethereum JSON-RPC interface, enabling read-only interaction with smart contracts on the Ethereum blockchain. It allows for querying data, such as balances and contract states, without modifying the blockchain, unlike state-changing methods like eth_sendTransaction. As part of the Core API, eth_call is critical for building Web3 dApps.
In Web3 apps, metamask eth_accounts is commonly used to fetch a user's Ethereum accounts. If not connected, eth_requestAccounts prompts users to connect their wallet. The difference between eth_accounts vs eth_requestAccounts is that the former retrieves the connected accounts, while the latter requests permission to access them. These methods ensure smooth wallet integration for dApps.
The eth_call
RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
The eth_call method requires two primary parameters:
Transaction Call Object:
from: (Optional) Ethereum address of the sender. Can be any address, used primarily for authorization purposes.
to: (Required) Ethereum address of the smart contract being called.
gas: (Optional) Gas limit for the call. If omitted, defaults to the Ethereum node's set limit.
gasPrice: (Optional) Price per unit of gas, used to calculate the transaction cost.
value: (Optional) Amount of Ether to send (usually 0x0
for read-only calls).
data: (Required) Encoded data containing the function signature and parameters to call on the smart contract.
Block Parameter:
Specifies the block context for the call. Can be set to:
latest: Latest block.
earliest: The genesis block.
pending: Pending block (before it's mined).
Specific block number or hash.
State Override Set (Optional): Allows temporary state modifications for the call without affecting the blockchain. It is an address-to-state mapping with the following fields:
balance
: Override the balance of the specified address.
nonce
: Override the transaction count of the specified address.
state
: Override specific storage key-value pairs for the address.
code
: Override the contract bytecode at the specified address.
Here’s a sample cURL request using eth_call to interact with a smart contract
A successful eth_call response provides the requested data in hexadecimal format
The body parameters in a eth_call request include:
jsonrpc: Defines the JSON-RPC version (usually "2.0"
).
method: The method being called ("eth_call"
).
params: Array of parameters for the eth_call method:
Transaction Call Object: Contains all details of the transaction being called.
Block Parameter: Specifies the block context in which to execute the call.
The eth_call method is commonly used in Web3 development to query data from Ethereum smart contracts. For example, it’s used to:
Fetch Token Balances: By calling the balanceOf(address)
function on ERC-20 tokens.
Read Contract States: For instance, retrieving ownership information or any other state variable within the contract.
Simulate Transactions: Developers use eth_call to simulate function executions and check conditions before performing any state-changing operations like sending a transaction. This avoids unnecessary gas usage for failed transactions.
Below is a Python eth_call
example using the requests library to send a JSON-RPC request for the eth_call
method
This Python example demonstrates eth_call usage to retrieve contract data in real-time, without altering Ethereum’s state. By using the eth_call method with Web3 APIs, developers can access essential blockchain data seamlessly, integrating decentralized data access into applications while retaining control over transaction-free interactions.
Retrieve the latest Ethereum block number using eth_blockNumber. Ideal for tracking blockchain progress and keeping dApps synchronized with the current chain height via JSON-RPC.
The eth_blockNumber method in Ethereum retrieves the latest block number from the current chain head, offering real-time insight into the blockchain's progress.
This method is essential for applications that need to stay updated with the latest state of the blockchain without diving into detailed block data. By using this RPC method, Web3 developers can maintain synchronized blockchain data with minimal overhead, and it provides a straightforward way to gauge the chain’s current height. This method is available through specific API endpoints that are part of the Core API, making it easy for developers to access blockchain data. The eth_blockNumber method is particularly useful for monitoring the state of the transaction chain and ensuring that applications remain synchronized with the latest block height.
The eth_blockNumber RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
To request the chain ID using the eth_blockNumber RPC Ethereum method via JSON-RPC, use the following curl command:
A successful response provides the latest block number as a hexadecimal value
id
: A unique request identifier, matching the id
sent in the request body.
jsonrpc
: Specifies the use of JSON-RPC version 2.0.
result
: The method result:
A string representing the latest block number in the Ethereum blockchain, provided in HEX format.
For example, "0x109238e"
in decimal equals 10923886
.
The eth_blockNumber method is ideal for applications needing to check the latest Ethereum block number quickly. For instance, Web3 applications can use it to verify the synchronization state with the Ethereum network, monitor blockchain progression, or trigger actions based on block height conditions. By contrast, other methods like eth_call are used for data retrieval within contracts rather than simply identifying the current block number.
Here’s a Python example using the eth_blockNumber method to get the current chain head in Web3
This Python example utilizes eth_blockNumber to retrieve the latest block index in decimal format, making it easy to incorporate into applications that need to monitor Ethereum’s current block. With this method, developers can programmatically stay updated on chain status, enabling features like block synchronization and blockchain-based triggers in Web3 projects. If an eth_blockNumber error occurs, it could indicate issues with the connection to the blockchain, improper request formatting, or network-related problems, and should be handled appropriately to ensure smooth operation.
Retrieve a list of Ethereum account addresses owned by the client using eth_accounts. Useful for displaying available accounts in dApps without requesting wallet access.
The eth_accounts method in the Ethereum JSON-RPC protocol retrieves a list of Ethereum account addresses owned by the client.
This method is particularly useful in Web3 applications that need to access and display the available accounts for actions such as signing transactions or interacting with smart contracts. Unlike eth_requestAccounts, which is used to request access to accounts in a MetaMask-enabled Web3 environment, eth_accounts simply returns accounts already available to the client.
The eth_accounts RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
To retrieve the list of accounts, use the following eth_accounts request with the JSON-RPC API
Here’s a sample response for the eth_accounts method, providing an array of Ethereum addresses
The eth_accounts method is commonly used in dApps and Web3 applications to retrieve a list of Ethereum accounts already accessible to the client. It allows applications to display accounts for actions like sending transactions, signing data, or interacting with Ethereum smart contracts without requiring additional user permissions each time.
In contrast, eth_requestAccounts requests explicit user permission to access accounts, typically used when the app first needs access or when permissions are revoked. The main difference is that eth_accounts returns already available accounts, while eth_requestAccounts prompts the user for approval.
Understanding this distinction is important for creating secure Web3 applications, as eth_accounts offers a seamless user experience, whereas eth_requestAccounts ensures user control over wallet access.\
Here is an example of how to use the eth_accounts method in Python to retrieve a list of client-owned addresses
In this Python example, we use eth_accounts to retrieve the list of accounts currently accessible to the client. This functionality can be essential in dApps or Web3 projects that need to interact with user wallets seamlessly without repeatedly requesting permissions from MetaMask or similar wallet extensions.In case of an error, such as when the eth_accounts request fails, the response may contain an error code or message, which can help troubleshoot the issue. For example, a 405 Method Not Allowed error indicates that the requested method is not allowed on the server. Handling eth_accounts errors properly ensures the smooth functioning of Web3 applications that depend on client accounts for interaction.
Retrieve the primary Ethereum client address using eth_coinbase. Useful for verifying the main configured account on the node for tasks like fee management or administrative purposes.
The eth_coinbase method returns the primary address (coinbase) of the connected Ethereum client.
In the context of modern Ethereum nodes, this method can be used to retrieve the configured primary address, which is often set in the client configuration for administrative or service tasks. While this address was previously used to receive mining rewards in the Proof-of-Work (PoW) era, in the current Proof-of-Stake (PoS) network, it can be useful for verifying the main configured account on the node, such as for obtaining information about the wallet in use or the address designated for fees or other purposes.
The eth_coinbase method is often used to verify the served eth_coinbase address, ensuring that the correct Ethereum address is set for the node’s tasks, such as fee management.
The eth_chainId
RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
The following example demonstrates how to make a JSON RPC request to fetch the coinbase address using the eth_coinbase method. This is especially useful in Ethereum setups with active mining to verify the designated mining address.
In this request:
method: Specifies eth_coinbase, the RPC method used to fetch the client’s mining address.
params: An empty array, as no parameters are needed for this method.
id: Identifies the request source, here set as "getblock.io".
If the node is not configured with a coinbase address, an error response similar to the following may be returned
Explanation: The error message "etherbase must be explicitly specified" indicates that the coinbase address is not set on the Ethereum client. To resolve this, configure the client with the --miner-coinbase option when starting the node, specifying a valid Ethereum address (e.g., an address from MetaMask or Etherscan).
In cases where the eth_coinbase method is correctly configured, the response will include the Ethereum coinbase address in hexadecimal format:
The eth_coinbase method in the Core API can now be used to verify the reward address settings for a staker managing a node (validator). This is particularly useful for checking the node configuration to ensure that rewards for block validation are correctly directed to the designated address. The method is typically used alongside eth_chainId and eth_syncing for verifying the current network and synchronization status, helping to confirm that the node is properly configured within the Ethereum network.
Below is a Python script that demonstrates how to call the eth_coinbase method using the JSON-RPC protocol
API Call Setup: The script sends a JSON-RPC request using the eth_coinbase method to retrieve the mining address.Error Handling: It checks for a successful response (status code 200) and handles potential errors, such as the coinbase address not being specified.Output: The coinbase address is printed if available. If an error occurs (e.g., "etherbase must be explicitly specified"), the error message is displayed instead.
Estimate the gas required for a transaction using eth_estimateGas. Crucial for predicting gas costs and preventing out-of-gas errors in Web3 applications.
The eth_estimateGas method is an essential part of the JSON RPC Ethereum protocol. It provides an estimate of the gas required for a transaction to execute successfully on the Ethereum network.
This estimation allows developers to predict gas costs before submitting a transaction, preventing potential out-of-gas errors. Importantly, this process does not consume gas, and the transaction is not added to the blockchain during estimation.
Using the eth_estimateGas method is a crucial practice for optimizing transaction costs in Web3 applications and ensuring that enough gas is provided to avoid failures. This is particularly important when interacting with Ethereum's eth_estimateGas API and its Endpoints.
The eth_estimateGas RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
The eth_estimateGas method requires a Transaction Call Object to estimate the necessary gas. The key fields of the transaction call object include:
from (optional): The address the transaction is sent from.
to: The destination address where the transaction is directed.
value (optional): The amount of Ether to be sent, represented in hexadecimal.
If the Ethereum node is started with --revert-reason-enabled, the eth_estimateGas error response may include the reason for the transaction reversion (execution reverted).
Below is an example of a JSON-RPC request using the eth_estimateGas method to estimate the gas required for a specific transaction.
In this request:
method: Specifies eth_estimateGas, the RPC method used to estimate gas.
params: Contains the transaction call object with from, to, and value fields.
id: Identifies the request, set as "getblock.io".
If the Ethereum node is started with --revert-reason-enabled, the eth_estimateGas error response may include the reason for transaction reversion (execution reverted).
The response contains the estimated gas amount in hexadecimal format
The result field ("0x5208") represents the estimated gas required for the transaction, which is 21000 in decimal. This is the standard gas amount for a simple Ether transfer.
If the Ethereum node is started with --revert-reason-enabled, the eth_estimateGas error response may include the reason for the transaction reversion (execution reverted).
This error response indicates that the transaction execution was reverted due to a problem in the transaction call, which is often seen when interacting with smart contracts.
The eth_estimateGas RPC method is widely used in Ethereum Web3 Core API applications to calculate the gas cost for transactions before they are sent. It helps ensure that the sender has enough Ether to cover the gas fees, preventing transaction failures due to insufficient gas.
For example, if a user interacts with a decentralized application (dApp) using MetaMask and attempts a transaction, the eth_estimateGas method can be used to verify that the necessary gas is available before sending the transaction. If the dApp detects that the transaction will fail due to insufficient gas, it can alert the user to add more gas to the transaction.
Below is a Python script to demonstrate how to use the eth_estimateGas method with JSON-RPC protocol.
API Call Setup: This script sends a JSON-RPC request to estimate the gas for a transaction using the eth_estimateGas method.
Transaction Object: Defines the transaction parameters such as the from, to, and value.
Error Handling: Checks for successful responses and handles errors, including execution reverted.
Output: Displays the estimated gas required or prints an error message if the estimation fails.
This Python script helps developers efficiently integrate gas estimation into their Ethereum-based applications, leveraging the eth_estimateGas method to optimize gas usage and prevent transaction failures.
\
Retrieve historical gas fee data using eth_feeHistory. Useful for transaction analysis, optimization, and planning by providing gas fees and usage ratios for a specified block range.
The eth_feeHistory method is part of the Ethereum JSON-RPC API and allows you to retrieve historical gas information for Ethereum transactions
This method returns data on gas fees and usage ratios for a specified range of blocks, which can be used for transaction analysis, optimization, and other blockchain-related tasks. This method is part of the Core API for Ethereum and uses JSON RPC to communicate with the blockchain. It provides useful data for gas optimization and transaction planning.
The eth_feeHistory RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesk
DATA, 8 Bytes — Number of blocks in the requested range.
DATA, 32 Bytes — The latest block in the requested range.
DATA, 32 Bytes — An optional monotonically increasing list of percentile values to sample from each block’s effective priority fees per gas in ascending order, weighted by gas used.
To make a request, you need to send a JSON object with the jsonrpc, method, and params fields. Here is an example of how to make a request using curl:
The server responds with a JSON object containing the requested gas fee history and related information. Here is an example of a typical response:
baseFeePerGas: An array of base fees per gas for each block in the requested range.
gasUsedRatio: An array representing the gas usage ratio for each block.
oldestBlock: The number of the oldest block in the requested range.
reward: An array containing reward information for each block for the specified percentiles.
Let's say you're a decentralized application (DApp) developer who wants to optimize the gas fees for users interacting with your smart contract. By using the eth_feeHistory method, you can retrieve historical gas data to predict the future gas prices and set a more efficient transaction fee for your users.
You can also make requests to the eth_feeHistory method programmatically using Python. Below is an example using the requests library:
This script sends a request to the eth_feeHistory method and prints the returned historical gas information. Make sure to replace <ACCESS-TOKEN> with your actual API token.
Common Errors:
eth_feeHistory error: You might encounter errors if the provided parameters are incorrect, or if the network is unreachable. Also, ensure that the block range you are querying is valid, and that your access token is correctly provided.\
Retrieve the current gas price using eth_gasPrice. Provides the median gas price based on the last 100 blocks, optimizing transaction fees and user experience on the Ethereum network
The eth_gasPrice method is part of the Ethereum JSON-RPC API, which is the standard Core API for interacting with Ethereum nodes.
This method returns a percentile gas unit price for the most recent blocks in the Ethereum blockchain, which can be used to estimate transaction fees. By default, the gas price is calculated from the last 100 blocks, returning the 50th percentile (median) value. If no blocks are available, the value for --min-gas-price is returned, with the gas price being restricted between --min-gas-price and --api-gas-price-max. The method is designed to provide dynamic, up-to-date gas prices to optimize Ethereum transactions and improve overall user experience.
The eth_gasPrice RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, you need to send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the current gas price in Wei. Below is an example of a typical response
result: The gas price in Wei, represented as a hexadecimal string. This value corresponds to the current estimated gas price for the Ethereum network based on the last blocks.
For DApp developers and users transacting on the Ethereum network, the eth_gasPrice method provides a reliable estimate of the current transaction fees. By retrieving this gas price, developers can set the right gas limits and transaction fees for their smart contracts, ensuring faster and more cost-effective transactions.
You can also make requests to the eth_gasPrice method programmatically using Python. Below is an example using the requests library
This Python script sends a request to the eth_gasPrice method and prints the returned gas price information. Make sure to replace with your actual API token.
Check the balance of a specified Ethereum address with the balance method. Query account balance at specific blocks or transaction states, supporting various time points like latest or pending
The eth_getBalance method is part of the Ethereum JSON-RPC API and is used to retrieve the balance of a specified Ethereum address.
This method allows you to check the account balance at a specific block or transaction state, making it useful for various DApps and Ethereum-based applications. The method can be queried with the latest, earliest, or pending block tags to get the balance at different points in time. It provides a convenient API method to access the account balance, supporting both request and parameters such as the account address and block tag.
The eth_getBalance RPC Ethereum method works on the following Ethereum network types
Mainnet
Testnet: Sepolia, Holesky
DATA: A 20-byte Ethereum account address to retrieve the balance for. The address must be in hexadecimal format, prefixed with 0x. QUANTITY|TAG: A string representing the block number or one of the following tags:
latest (default): Retrieves the balance of the account at the latest block.
earliest: Retrieves the balance at the first block (genesis block).
pending: Retrieves the balance of the account in the pending block.
URL
To make a request to the eth_getBalance method, you can use the following curl command. The request sends a JSON-RPC query to the Ethereum network via the GetBlock API
The response will contain the balance of the specified Ethereum address, represented as a hexadecimal string in Wei. Below is an example response
result: The balance of the Ethereum address in Wei, given as a hexadecimal string. In the example, the balance is 0x36ea, which is the equivalent of 14006 Wei.
The eth_getBalance method is often used in decentralized applications (DApps), including those integrated with MetaMask, to check the balance of Ethereum accounts before performing transactions. For example, DApps may need to verify that a user has sufficient funds to complete a transaction or make a purchase. By using the eth_getBalance method, developers can easily retrieve the balance of an account at any given block or the latest state of the Ethereum blockchain. When interacting with MetaMask, this method can be called to display the user's wallet balance in real-time, providing a seamless experience for users during transactions.
To retrieve the balance of an address using axios, you can use the eth_getBalance method as follows
This code will retrieve the balance of the specified address on the Ethereum mainnet and print it in ETH.
eth_getBalance error: Common issues when using the eth_getBalance method include incorrect address format, network connectivity problems, or invalid block/tag parameters. Ensure that the address is valid, and the network you are querying is correct.
Retrieve detailed or basic block information using a block hash. Fetch full block data or key details like transaction hashes, ideal for blockchain analysis or lightweight data retrieval.
The eth_getBlockByHash method is part of the Core API in the Ethereum JSON-RPC retrieves information about a specific block using its block hash.
This method allows users to fetch either the full block data, including detailed transaction details, or just the basic block information with transaction hashes. This flexibility is beneficial for applications that require either comprehensive blockchain analysis or a lighter response focused on key block data.
The eth_getBlockByHash method supports the following Ethereum networks
Mainnet
Testnet: Sepolia, Holesky
DATA, string (32-byte hash): The hash of the block to retrieve (required).
Boolean, true | false:
true: Returns full transaction objects with complete transaction details.
false: Returns only the transaction hashes.
URL
To make a request to the eth_getBlockByHash method, you can use the following curl command. The request sends a JSON-RPC query to the Ethereum network via the GetBlock API
The server responds with a JSON object containing the block information. Below is an example response when full transaction objects are requested
id (string
): The identifier of the request, as sent by the client. In this case, "getblock.io"
.
jsonrpc (string
): The version of JSON-RPC, here "2.0"
.
result (object
): An object containing information about the block, with the following fields:
difficulty (string
): The current difficulty of the block, in hexadecimal format.
extraData (string
): Additional data related to the block, in hexadecimal format.
gasLimit (string
): The gas limit for the block, in hexadecimal format.
gasUsed (string
): The amount of gas used in the block, in hexadecimal format.
hash (string
): The hash of the current block, in hexadecimal format.
logsBloom (string
): The logs bloom filter for transactions in the block, in hexadecimal format.
miner (string
): The address of the miner who mined the block.
mixHash (string
): The hash used in the mining process of the block, in hexadecimal format.
nonce (string
): A random value used by the miner to find the block hash.
number (string
): The block number, in hexadecimal format.
parentHash (string
): The hash of the parent block, in hexadecimal format.
receiptsRoot (string
): The root hash of all receipts of transactions in the block, in hexadecimal format.
sha3Uncles (string
): The hash of the list of all uncle blocks in the block, in hexadecimal format.
size (string
): The size of the block in bytes, in hexadecimal format.
stateRoot (string
): The root hash of the state after processing the block, in hexadecimal format.
timestamp (string
): The timestamp of the block, in hexadecimal format.
totalDifficulty (string
): The total difficulty up to and including the current block, in hexadecimal format.
transactions (array of strings
): A list of transaction hashes included in the block.
transactionsRoot (string
): The root hash of all transactions in the block, in hexadecimal format.
uncles (array of strings
): A list of uncle block hashes associated with this block.
For developers and blockchain explorers, the eth_getBlockByHash method is crucial for obtaining detailed information about specific blocks in the Ethereum blockchain. This method can be used for:
Verifying transactions within a particular block using the transaction hash.
Retrieving comprehensive block data for in-depth blockchain analysis.
Debugging and investigating specific events on the Ethereum network by examining block data.
You can also make requests to the eth_getBlockByHash method programmatically using Python. Below is an example using the requests library
This Python script sends a request to the eth_getBlockByHash method and prints the returned block information. Make sure to replace with your actual API token. This method provides access to both Ethereum Mainnet and test networks like Sepolia and Goerli, enabling comprehensive blockchain analysis across multiple environments.
Retrieve detailed information about a specific Ethereum block by its block number using eth_getBlockByNumber. Essential for interacting with the Ethereum blockchain via JSON-RPC.
The eth_getBlockByNumber method is a part of the eth_getBlockByNumber RPC Ethereum protocol and allows users to retrieve detailed information about a specific Ethereum block, identified by its block number.
This method works by connecting to the Ethereum network via JSON-RPC, a remote procedure call (RPC) protocol used for communication between clients and servers. Core API endpoints provide the functionality to interact with the blockchain, and eth_getBlockByNumber is one of the most commonly used methods within these endpoints.
The eth_getBlockByNumber RPC Ethereum method works on the following Ethereum network types
Mainnet
Testnet: Sepolia, Holesky
QUANTITY | TAG (required): An integer representing a block number or one of the following string tags:
latest: The most recent block.
earliest: The first block of the blockchain.
pending: The block currently being mined.
Boolean (required): If set to true, the method returns full transaction objects with complete details. If set to false, only the transaction hashes are returned.
URL
To request a block by its number using the eth_getBlockByNumber method, the following JSON object is sent in a POST request via the Ethereum Web3 API
The server will respond with a JSON object containing block information. An example response when full transaction objects are requested looks like this
The response includes various details about the block:
difficulty: The mining difficulty of the block.
extraData: Additional data related to the block.
gasLimit: The maximum amount of gas allowed for the block.
gasUsed: The total gas used by all transactions in the block.
hash: The block's hash.
logsBloom: A bloom filter for the logs of the block.
miner: The address of the miner who mined the block.
mixHash: The hash used for the mining process.
nonce: The proof-of-work nonce.
number: The block number.
parentHash: The hash of the previous block.
receiptsRoot: The root hash of the receipts.
sha3Uncles: A hash representing the uncles (if any).
size: The size of the block.
stateRoot: The root hash of the state trie.
timestamp: The block's timestamp.
totalDifficulty: The cumulative difficulty of the chain up to and including the block.
transactions: A list of transaction objects (if true was passed for full transaction details).
uncles: A list of uncles associated with the block.
The eth_getBlockByNumber method is primarily used to query a block in the Ethereum blockchain by its block number or one of the predefined tags such as latest or pending. This can be useful for blockchain explorers, wallet apps, or anyone who needs to retrieve detailed block data, including transaction information or general block metrics. It’s part of the Ethereum API that allows developers to interact with the blockchain programmatically.
Below is an example Python code snippet to make a request to the eth_getBlockByNumber method using the requests library
Invalid Block Number or Tag: If an invalid block number or tag (e.g., latest, earliest, or pending) is provided, the API will return an error.
Error Message: "eth_getBlockByNumber error": "Invalid block number or tag"
Transaction Data Retrieval Failure: If the requested block does not contain transaction data, an empty array will be returned for the transactions field.
Error Message: "eth_getBlockByNumber error": "No transaction data available"
API Rate Limiting: If too many requests are made in a short period, you may encounter rate-limiting errors.
Error Message: "eth_getBlockByNumber error": "Rate limit exceeded"
Retrieve the number of transactions in a specific Ethereum block by its block hash using eth_getBlockTransactionCountByHash.Essential for tracking transaction data and building blockchain explorers.
This method allows developers to retrieve the number of transactions that are included in a specific block, identified by its block hash
The eth_getBlockTransactionCountByHash method is part of the Ethereum Core API and works by connecting to the Ethereum network via the JSON RPC protocol. The eth_getBlockTransactionCountByHash RPC Ethereum method is a critical tool for applications that need to monitor the number of transactions in a given Ethereum block or build advanced blockchain explorers that track transaction data in a more granular way.
The eth_getBlockTransactionCountByHash RPC Ethereum method works on the following Ethereum network types:
Mainnet
Testnet: Sepolia, Holesky
These networks allow you to request the number of transactions within a block, given its block hash, on both the main Ethereum network and various test networks.
This method takes the following parameter:
data - None A 32-byte block hash that uniquely identifies the block for which the transaction count is to be retrieved.
URL
To invoke the eth_getBlockTransactionCountByHash method, use the following request format
This request sends the block hash to the server, asking it to return the number of transactions for the block with the corresponding hash.
The response from the eth_getBlockTransactionCountByHash method will look like this
In this example, the block identified by the provided hash contains 0x85 (133 in decimal) transactions.
The eth_getBlockTransactionCountByHash method returns the value of the transaction count in hexadecimal format. This response includes the following fields:
id: The unique identifier for the request.
jsonrpc: The JSON RPC version used.
result: The transaction count for the block, represented as a hexadecimal string.
For instance, a response of "result": "0x85" indicates that there are 133 transactions in the block corresponding to the given block hash.
The eth_getBlockTransactionCountByHash method is useful when you need to retrieve the number of transactions in a specific Ethereum block by providing its hash. This is often used in blockchain explorers, transaction analyzers, and applications that track the number of transactions in each block for indexing or statistical purposes. By querying this method, developers can easily retrieve block-level transaction data without needing to fetch the entire block's transaction details.
Here’s how you can use the Web3 eth_getBlockTransactionCountByHash method in a JavaScript environment to retrieve the transaction count of a block by its hash:
This Web3 eth_getBlockTransactionCountByHash example demonstrates how to retrieve the transaction count for a given block hash. It can be used in a variety of decentralized applications (dApps) that need to interact with the Ethereum blockchain.
eth_getBlockTransactionCountByHash error - This error may occur if the provided block hash is invalid or if the block does not exist in the network.
Invalid block hash - If the block hash is improperly formatted or incorrect, the Ethereum network will not be able to find the corresponding block.
Network issues - If there are issues with connecting to the Core API or the JSON RPC server, you may receive a timeout or connectivity error.
Retrieve the number of transactions in a specific Ethereum block by its block number using eth_getBlockTransactionCountByNumber. Useful for real-time data and historical block activity analysis.
The eth_getBlockTransactionCountByNumber method is a part of the Ethereum Core API that allows users to retrieve the number of transactions in a specific block using its block number.
By leveraging the JSON RPC protocol, this method facilitates requests to query the Ethereum blockchain, providing insights into the volume of transactions within a given block. This is especially useful for applications requiring real-time data or historical analysis of block activity.
The eth_getBlockTransactionCountByNumber RPC Ethereum method works on the following Ethereum network types:
Mainnet
Testnet: Sepolia, Holesky
This method is compatible across multiple Ethereum networks, ensuring that developers can request transaction counts on both the mainnet and various testnets.
The eth_getBlockTransactionCountByNumber method accepts a single parameter:
QUANTITY | TAG: This parameter can be an integer representing the block number or a string representing one of the special tags (latest, earliest, or pending). It specifies which block to query:
latest: The most recent mined block.
earliest: The first block in the chain (genesis block).
pending: The next block expected to be mined.
This flexibility allows users to request the transaction count for a specific block number or a dynamic block based on its state in the chain.
URL (API Endpoint)
Here is an example request using JSON RPC to fetch the number of transactions in a specific block
In this example, we are querying the block with the hexadecimal number "0x52A8CA". This request asks for the total number of transactions in the specified block.
The response from the eth_getBlockTransactionCountByNumber method will look like this:
The eth_getBlockTransactionCountByNumber method returns the value of the transaction count in hexadecimal format. The response fields include:
id: The unique identifier for the request.
jsonrpc: The version of the JSON RPC protocol used.
result: The number of transactions in the block, represented as a hexadecimal value.
For example, "result": "0x49" signifies that there are 73 transactions within the specified block.
The eth_getBlockTransactionCountByNumber method is commonly used in scenarios where an application needs to determine the transaction volume of a particular block. It is useful for building analytics tools, blockchain explorers, and monitoring systems that need to provide real-time or historical data on the number of transactions per block.
For instance, a blockchain explorer might use this method to display the transaction count for each block on its overview page, or a monitoring system could use it to identify blocks with unusually high transaction counts.
Here’s how you can use Web3 eth_getBlockTransactionCountByNumber in a JavaScript environment to retrieve the transaction count of a specific block number:
This Web3 eth_getBlockTransactionCountByNumber example demonstrates how to fetch the transaction count for a given block number using the Web3 library. The code handles errors gracefully by logging them, including cases where the eth_getBlockTransactionCountByNumber error might occur if the block number is invalid.
eth_getBlockTransactionCountByNumber error - This error may occur if the provided block number is invalid or out of range.
Invalid block number - If the block number is not a valid hexadecimal or integer, or it refers to a block that has not been mined yet, the JSON RPC server will return an error.
Network issues - If there are connectivity problems with the Core API or the JSON RPC endpoint, you may experience timeouts or other errors during the request.
Retrieve the compiled bytecode of a smart contract at a specific address using eth_getCode. Essential for verifying contract deployment and analyzing bytecode in Web3 development.
The eth_getCode RPC Ethereum method is part of the Ethereum JSON RPC protocol. It retrieves the compiled code of a smart contract located at a specific address.
The response is returned as a hexadecimal value, representing the contract's bytecode.
This method is commonly used by developers working with Web3 and smart contract platforms to verify if a contract is deployed at a specific address or to fetch the bytecode for analysis. Ethereum eth_getCode is an essential part of the Ethereum endpoints for blockchain interaction via JSON-RPC.
The eth_getCode RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
DATA: A 20-byte address of the contract whose code you want to retrieve.
QUANTITY or TAG:
latest
: Retrieves data from the most recently mined block.
earliest
: Retrieves data from the genesis block.
pending
: Retrieves data from the block currently being mined.
URL (API Endpoint)
Here is an eth_getCode example of how to use the method in a JSON-RPC request
method: Specifies the API method (eth_getCode).
params: Contains:
The 20-byte contract address.
The block parameter indicating the block to reference (latest).
id: A unique identifier for the request.
The response from the eth_getBlockTransactionCountByNumber method will look like this:
id: Matches the id from the request to help correlate responses.
jsonrpc: Confirms the JSON-RPC protocol version ("2.0").
result:
A hexadecimal string containing the smart contract’s compiled bytecode if the contract exists.
"0x" if no smart contract is present at the queried address.
Developers may encounter common issues such as an eth_getCode error, which typically occurs due to invalid parameters or an inaccessible block. Always ensure your request includes a valid contract address and block parameter.
Checking for the presence of a smart contract Use eth_getCode to verify whether a smart contract is deployed at a given address. If the result is "0x", no contract exists at the address.
Fetching contract bytecode Retrieve the bytecode of a deployed smart contract for further analysis, such as reverse engineering or debugging.
Integrating with Web3 This method is commonly used by developers working with Web3 eth_getCode to interact with Ethereum smart contracts programmatically.
Here is an example request for getting contract code using different programming languages
Request Setup:The API method eth_getCode is invoked with the necessary parameters (address and block). Error Handling:Handles HTTP errors (e.g., server not reachable) and JSON-RPC-specific errors (e.g., invalid parameters or method issues). Result Usage:If a contract is present, logs its bytecode value for further processing.
Poll a specific filter for changes since the last check using eth_getFilterChanges. Vital for real-time monitoring of logs, transactions, and blocks in dApps and Ethereum applications.
The eth_getFilterChanges method is part of the JSON-RPC Ethereum API, designed to poll a specific filter and retrieve an array of changes since the last poll
This core API endpoint is vital for tracking updates to logs, pending transactions, or new blocks in real-time. If the filter is invalid or expired, the method returns an eth_getFilterChanges error.
As a critical feature in Ethereum eth_getFilterChanges, this method is commonly used in decentralized applications (dApps) to monitor and react to on-chain events efficiently.The eth_getFilterChanges endpoints allows developers to integrate real-time blockchain monitoring into their applications seamlessly.
The eth_getFilterChanges RPC Ethereum method is supported on the following network types
Mainnet
Testnet: Sepolia, Holesky
Filter ID (DATA):
A unique identifier for the filter being polled. This identifier must be obtained through prior methods like eth_newFilter, eth_newPendingTransactionFilter, or eth_newBlockFilter.
URL (API Endpoint)
Here is an eth_getFilterChanges example of how to use the method in a JSON-RPC request
When the filter returns changes, they are provided as an array of data, such as logs or pending transactions
If the filter is not found or has expired
Tracking Log Events: The eth_getFilterChanges API method enables developers to monitor log updates for specific smart contracts. This is particularly valuable for applications that need to stay updated on events triggered by smart contracts.
Monitoring Pending Transactions: By polling a pending transaction filter, you can track newly added transactions to the mempool in real-time, improving insights into transaction flow.
Listening for New Blocks: Using block filters with eth_getFilterChanges RPC Ethereum, developers can identify new blocks as they are mined, ensuring accurate synchronization with the blockchain.
Here’s how you can implement eth_getFilterChanges using different programming languages
This eth_getFilterChanges example demonstrates how to use the method :
Setup:Replace <ACCESS-TOKEN> with your GetBlock API key.Use FILTER_ID from a filter creation method such as eth_newFilter.
Request:The method sends a POST request to the JSON RPC endpoint, specifying the eth_getFilterChanges method and the filter ID as parameters.
Response Handling:If no changes occur, the method returns an empty array.Logs an error, such as "filter not found", if the filter has expired or is invalid.
Value Handling: The value of the filter changes is extracted from the response and logged.
Usage:The Web3 eth_getFilterChanges method is essential for applications requiring real-time updates on Ethereum network activity, including logs, transactions, and new blocks.
\
Retrieve logs for a specified filter using eth_getFilterLogs. Essential for tracking block events, transaction logs, or smart contract interactions in real-time within Ethereum dApps.
The eth_getFilterLogs method is a JSON-RPC Ethereum API call that returns an array of logs for the specified filter
This eth_getFilterLogs RPC Ethereum method is crucial for developers seeking to track block events, transaction logs, or smart contract interactions in real-time. To enhance log retrieval performance, it’s recommended to leave the --auto-log-bloom-caching-enabled option set to the default value of true.
eth_getFilterLogs is a core API endpoint in Ethereum development, providing an easy way to retrieve logs based on filters created by previous methods like eth_newFilter, eth_newPendingTransactionFilter, or eth_newBlockFilter. If a filter is invalid or expired, eth_getFilterLogs error responses are returned.
Filter ID (DATA):
A unique identifier for the filter whose logs are being requested. This Filter ID must be obtained from prior methods like eth_newFilter, eth_newPendingTransactionFilter, or eth_newBlockFilter. The eth_getlogs limit can be set to manage the number of logs returned, which is useful when filtering large amounts of data.
URL (API Endpoint)
eth_getFilterLogs example: In this example, a JSON-RPC request is made to fetch the logs related to the specified filter ID.
If the filter is not found, the response will include an error
If logs are available for the filter, they will be returned as an array of log entries, which can be processed to monitor block or transaction events.
Tracking Contract Events:The Web3 eth_getFilterLogs method allows developers to monitor smart contract events. By filtering for specific contract logs, you can track interactions with your decentralized application (dApp) in real time.
Monitoring Block Events:This method is essential for applications that need to monitor block data or events on the Ethereum blockchain, such as when new blocks are mined or specific state changes occur.
Transaction Logs:Developers can use Ethereum eth_getFilterLogs to collect logs associated with transactions, including transaction receipts and their associated data.
Here’s how you can implement the eth_getFilterLogs method using different programming languages
Setup:Replace <ACCESS-TOKEN> with your GetBlock API key.Use FILTER_ID from a prior filter creation method (e.g., eth_newFilter).
Request:Sends a POST request to the JSON-RPC endpoint, calling the eth_getFilterLogs method and passing the FILTER_ID as a parameter.
Response Handling:Logs any errors, such as the eth_getFilterLogs error like "filter not found," if the filter is expired or invalid.Outputs an array of log entries if successful.
Usage:The eth_getFilterLogs method is part of the Core API for Ethereum, enabling developers to efficiently query logs for specific filters. This method is especially helpful for applications that need to track changes to block or transaction data in real-time.
Retrieve logs matching a specified filter using eth_getLogs. Essential for monitoring blockchain events, smart contract interactions, and building event-driven functionality in Ethereum dApps.
This method returns an array of logs that match a specified filter object, making it a powerful tool for retrieving on-chain event information related to specific addresses or topics.
Ethereum eth_getLogs JSON-RPC Core API, used to interact with Ethereum nodes. Logs are often used to monitor the blockchain for events emitted by smart contracts, which is crucial for DApp developers building event-driven functionality.
To optimize the retrieval of logs, it's recommended to leave the --auto-log-bloom-caching-enabled command line option at its default value of true. This enhances log retrieval performance and ensures efficient blockchain data access. Note that the eth_getLogs limit may apply depending on the node configuration.
The eth_getLogs RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
Object: A filter options object, which includes the following fields:
fromBlock (optional): Block number from which to start looking for logs.
toBlock (optional): Block number to stop looking for logs.
address (optional): The contract address from which to get logs.
topics (optional): Array of topic filters.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the array of logs that match the given filter. Below is an example of a typical response
result: An array of logs that match the specified filter, represented as objects. If no logs are found, the result will be an empty array.
The eth_getLogs method is particularly useful for DApp developers who need to monitor the blockchain for specific events related to their smart contracts. By specifying parameters such as block range and contract address, developers can efficiently retrieve log data for their applications. This is often needed for building functionalities such as notifications, analytics, or data-driven user interfaces. In case of an eth_getLogs error, developers can adjust the filter parameters to ensure they are not exceeding any limits set by the node.
You can also make requests to the eth_getLogs method programmatically using different programming languages.Below is an example :
This is a Web3 eth_getLogs example for using the method in , providing an interface to access blockchain data for various use cases, including transaction tracking and event monitoring.
Retrieve account and storage values, including Merkle proof, using eth_getProof. Essential for verifying on-chain data integrity and enabling trusted responses in IoT and mobile applications.
This method returns the account and storage values of a specified account, including the Merkle proof.
The eth_getProof method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_getProof method is particularly useful for scenarios where IoT devices or mobile apps, which are unable to run light clients, need to verify responses from untrusted sources using a trusted block hash.
The eth_getProof RPC Ethereum method is an essential tool for verifying on-chain data integrity, enabling the retrieval of account details and storage proof data. This allows developers to create applications that can validate the state of specific accounts and their corresponding storage slots, ensuring accurate and trustworthy information. The method also facilitates the retrieval of proof data via different API endpoints, making it highly versatile.
Ethereum eth_getProof RPC method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 20-byte address of the account or contract for which to retrieve proof data.
ARRAY: An array of 32-byte storage keys to generate proofs for.
QUANTITY | TAG: An integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the proof details of the specified account and storage keys. Below is an example of a typical response:
accountProof: The Merkle proof for the account, represented as an array of strings.
address: The address of the account or contract for which the proof was requested.
balance: The current balance of the account in Wei.
codeHash: The hash of the code of the account.
nonce: The nonce of the account, representing the number of transactions sent.
storageHash: The storage root hash of the account.
storageProof: An array of storage proofs for the specified storage keys, including the key, proof, and value.
The eth_getProof method is particularly useful for verifying on-chain data, especially in cases where applications need to validate the state of a specific account or storage slot. This is crucial for IoT devices, mobile apps, and other lightweight clients that cannot run full or light nodes. By using the eth_getProof RPC method, these clients can verify the integrity of data received from untrusted sources. In case of an eth_getProof error, developers should check the provided parameters and ensure that the block hash or address is correct. Additionally, by using different endpoints, developers can access the method across various environments.
The eth_getProof method is also useful for transaction tracking. Developers can verify specific transactions associated with an account by retrieving the proof and cross-checking the values.
Below is an eth_getProof example demonstrating how to make a request programmatically using Python.You can also make requests to the eth_getProof method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getProof method and prints the returned proof information. Make sure to replace <ACCESS-TOKEN> with your actual API token.
The Web3 eth_getProof method can also be used in Web3 libraries for Ethereum, providing an interface to access and verify blockchain data for various use cases, including transaction tracking, account verification, and data validation.
Retrieve the value of a storage position at a specified address using eth_getStorageAt. Essential for accessing specific data stored within smart contracts on the Ethereum blockchain
This method returns the value of a storage position at a specified address, allowing developers to access specific data stored within smart contracts.
The Ethereum eth_getStorageAt method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_getStorageAt RPC Ethereum method is essential for retrieving on-chain data directly from the storage of a contract.
The eth_getStorageAt RPC Ethereum method supports the following network types
Mainnet
Testnet: Sepolia, Holesky
DATA: The 20-byte address of the storage (account or contract) for which to retrieve the storage value.
DATA: The integer index of the storage position to access.
QUANTITY | TAG: An integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl, eth_getStorageAt example:
The server responds with a JSON object containing the value at the specified storage position. Below is an example of a typical response
result: The value at the specified storage position, represented as a hexadecimal string.
The eth_getStorageAt method is particularly useful for developers who need to retrieve specific storage values from smart contracts on the Ethereum blockchain. This can be used for debugging or for accessing critical data stored within a contract. In case of an eth_getStorageAt error, developers should ensure that the provided address, storage index, and block tag are correct.
You can also make requests to the eth_getStorageAt method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getStorageAt method and prints the returned storage value. Make sure to replace <ACCESS-TOKEN> with your actual API token.
Web3 eth_getStorageAt libraries , providing an interface to access contract storage data for various use cases, including contract interaction, debugging, and data analysis.
Retrieve transaction information by block hash and index using eth_getTransactionByBlockHashAndIndex. Essential for tracking transactions within specific blocks on the Ethereum blockchain.
This method returns transaction information for the specified block hash and transaction index position, making it an essential tool for developers needing detailed data about transactions within specific blocks
Ethereum eth_getTransactionByBlockHashAndIndex JSON-RPC Core API, used to interact with Ethereum nodes. The eth_getTransactionByBlockHashAndIndex RPC Ethereum method helps in tracking transactions based on their order within a block.
The eth_getTransactionByBlockHashAndIndex RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 32-byte hash of the block for which to retrieve the transaction.
QUANTITY: An integer representing the transaction index position within the block.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the transaction details at the specified block hash and index. Below is an example of a typical response:
id: The identifier of the request sent by the client. In this case, it is "getblock.io"
.
jsonrpc: The version of the JSON-RPC protocol, used to ensure compatibility. The value is "2.0"
.
blockHash: The hash of the block that contains this transaction.
blockNumber: The number of the block that contains this transaction, in hexadecimal format.
chainId: The ID of the chain on which the transaction was executed, in hexadecimal format.
from: The address of the sender of the transaction.
gas: The amount of gas provided by the sender, in hexadecimal format.
gasPrice: The price of each unit of gas, in hexadecimal format.
hash: The hash of the transaction.
input: The data sent along with the transaction.
nonce: The number of transactions sent from the sender's address before this one, in hexadecimal format.
r: The first part of the cryptographic signature for the transaction.
s: The second part of the cryptographic signature for the transaction.
to: The address of the recipient of the transaction.
transactionIndex: The index of the transaction within the block, in hexadecimal format.
type: The type of the transaction, in hexadecimal format.
v: The recovery id of the cryptographic signature for the transaction.
value: The value transferred in the transaction, in Wei, in hexadecimal format.
The eth_getTransactionByBlockHashAndIndex method is useful for tracking and verifying transactions within specific blocks. By using the block hash and transaction index, developers can easily access detailed information about individual transactions. In case of an eth_getTransactionByBlockHashAndIndex error, developers should verify that the provided block hash and index are correct and correspond to an existing transaction within the block. An eth_getTransactionByBlockHashAndIndex example can help developers understand the correct usage of this method.
You can also make requests to the eth_getTransactionByBlockHashAndIndex method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getTransactionByBlockHashAndIndex method and prints the returned transaction information. Make sure to replace <ACCESS-TOKEN> with your actual API token. This script serves as an eth_getTransactionByBlockHashAndIndex example for developers to understand the implementation in Python.
The Web3 eth_getTransactionByBlockHashAndIndex method can also be used in Web3 libraries for Ethereum, providing an interface to retrieve detailed transaction data by referencing a specific block and index.
Retrieve transaction information by block number and index using eth_getTransactionByBlockNumberAndIndex. Essential for tracking and validating transactions within specific blocks on the Ethereum.
This method returns transaction information for the specified block number and transaction index position. It is an essential tool for developers needing detailed transaction data from specific blocks.
The Ethereum eth_getTransactionByBlockNumberAndIndex method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_getTransactionByBlockNumberAndIndex RPC Ethereum method is especially helpful for tracking and validating transactions within particular blocks.
The eth_getTransactionByBlockNumberAndIndex RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
QUANTITY | TAG: An integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
QUANTITY: An integer representing the transaction index position within the block.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the transaction details at the specified block number and index. Below is an example of a typical response:
blockHash: The hash of the block containing the transaction.
blockNumber: The number of the block containing the transaction.
chainId: The chain ID of the Ethereum network.
from: The address of the sender.
gas: The gas provided by the sender.
gasPrice: The gas price provided by the sender in Wei.
hash: The hash of the transaction.
input: The input data for the transaction.
nonce: The number of transactions made by the sender prior to this one.
r, s, v: Components of the transaction signature.
to: The address of the receiver.
transactionIndex: The index position of the transaction within the block.
type: The transaction type.
value: The value transferred in Wei.
The eth_getTransactionByBlockNumberAndIndex method is useful for tracking and verifying transactions within specific blocks. By using the block number and transaction index, developers can easily access detailed information about individual transactions. In case of an eth_getTransactionByBlockNumberAndIndex error, developers should verify that the provided block number and index are correct and correspond to an existing transaction within the block. An eth_getTransactionByBlockNumberAndIndex example can help developers understand the correct usage of this method.
You can also make requests to the eth_getTransactionByBlockNumberAndIndex method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getTransactionByBlockNumberAndIndex method and prints the returned transaction information. Make sure to replace <ACCESS-TOKEN> with your actual API token. This script serves as an eth_getTransactionByBlockNumberAndIndex example for developers to understand the implementation in Python.
The Web3 eth_getTransactionByBlockNumberAndIndex method can also be used in Web3 libraries for Ethereum, providing an interface to retrieve detailed transaction data by referencing a specific block and index.
Retrieve transaction details by transaction hash using eth_getTransactionByHash. Essential for tracking and verifying individual transactions on the Ethereum blockchain.
This method returns transaction information for the specified transaction hash, allowing developers to retrieve detailed data about specific transactions
The Ethereum eth_getTransactionByHash method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_getTransactionByHash RPC Ethereum method is crucial for tracking and verifying individual transactions.
The eth_getTransactionByHash RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 32-byte hash transaction.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the transaction details for the specified hash. Below is an example of a typical response:
accessList: A list of addresses and storage keys the transaction accesses (EIP-2930).
blockHash: The hash of the block containing the transaction.
blockNumber: The number of the block containing the transaction.
chainId: The chain ID of the Ethereum network.
from: The address of the sender.
gas: The gas provided by the sender.
gasPrice: The gas price provided by the sender in Wei.
hash: The hash of the transaction.
input: The input data for the transaction.
maxFeePerGas: Maximum fee per gas that the sender is willing to pay.
maxPriorityFeePerGas: Maximum priority fee per gas.
nonce: The number of transactions made by the sender prior to this one.
r, s, v: Components of the transaction signature.
to: The address of the receiver.
transactionIndex: The index position of the transaction within the block.
type: The transaction type.
value: The value transferred in Wei.
The eth_getTransactionByHash method is particularly useful for retrieving detailed information about a specific transaction, which can be critical for verifying and tracking transactions on the Ethereum blockchain. In case of an eth_getTransactionByHash error, developers should verify that the provided transaction hash is correct and corresponds to an existing transaction. An eth_getTransactionByHash example can help developers understand the correct usage of this method.
You can also make requests to the eth_getTransactionByHash method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getTransactionByHash method and prints the returned transaction information. Make sure to replace <ACCESS-TOKEN> with your actual API token. This script serves as an eth_getTransactionByHash example for developers to understand the implementation in Python.
The Web3 eth_getTransactionByHash method can also be used in Web3 libraries for Ethereum, providing an interface to access detailed transaction data based on a specific transaction hash.
Retrieve the number of transactions sent from a specified address using eth_getTransactionCount. Essential for tracking account activity and determining the next nonce for transactions on the Ethereum
This method returns the number of transactions sent from a specified address.
The eth_getTransactionCount method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes.By using the pending tag, developers can get the next account nonce that has not been used by any pending transactions. The eth_getTransactionCount RPC Ethereum method is essential for tracking account activity and determining the next available nonce for new transactions.
The eth_getTransactionCount RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 20-byte account address.
QUANTITY | TAG: An integer representing a block number or one of the string tags latest, earliest, or pending as described in the Block Parameter.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the number of transactions sent from the specified address. Below is an example of a typical response:
result: The number of transactions value sent from the specified address, represented as a hexadecimal string.
The eth_getTransactionCount method is particularly useful for developers who need to determine the next available nonce for a given account. This is important when constructing new transactions, as the nonce must be unique for each transaction sent by an address. Using the eth_gettransactioncount pending tag allows developers to retrieve the nonce that will be used for the next transaction that has not yet been mined. In case of an eth_getTransactionCount error, developers should verify that the provided account address and block tag are correct. An eth_getTransactionCount example can help illustrate how to properly use this method.
You can also make requests to the eth_getTransactionCount method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getTransactionCount method and prints the returned transaction count. Make sure to replace <ACCESS-TOKEN> with your actual API token. The eth_gettransactioncount pending tag is useful for retrieving the next available nonce that has not been used by any pending transactions.
The Web3 eth_getTransactionCount method can also be used in Web3 libraries for Ethereum, providing an interface to access transaction count data for various use cases, including constructing new transactions and debugging account activity.
The Ethereum eth_getTransactionCount method provides a reliable way to query the number of transactions for a given account address across different network types, making it a versatile tool for developers working with Ethereum's JSON RPC API and Core API Endpoints.
Retrieve transaction receipt details using eth_getTransactionReceipt. Essential for obtaining information about transaction execution, including gas usage, status, and logs on the Ethereum blockchain.
This method returns the receipt of a transaction by its transaction hash.
The eth_getTransactionReceipt method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. Receipts for pending transactions are not available. If revert reasons are enabled, the receipt includes available revert reasons in the response. The eth_getTransactionReceipt RPC Ethereum method is essential for obtaining details about transaction execution, such as gas usage, status, and logs.
The eth_getTransactionReceipt RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 32-byte hash of the transaction.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the transaction receipt details. Below is an example of a typical response:
blockHash: The hash of the block containing the transaction.
blockNumber: The number of the block containing the transaction.
contractAddress: The contract address created, if the transaction was a contract creation, otherwise null.
cumulativeGasUsed: The total amount of gas used when this transaction was executed in the block.
effectiveGasPrice: The actual price per unit of gas paid.
from: The address of the sender.
gasUsed: The amount of gas used by this specific transaction alone.
logs: An array of log objects generated by this transaction.
logsBloom: Bloom filter for light clients to quickly retrieve related logs.
status: The status of the transaction (0x1 indicates success, 0x0 indicates failure).
to: The address of the receiver.
transactionHash: The hash of the transaction.
transactionIndex: The index position of the transaction within the block.
type: The transaction type.
value: The value transferred in Wei.
The eth_getTransactionReceipt method is particularly useful for developers who need detailed information about a transaction, such as its status, gas usage, and generated logs. This is crucial for debugging, auditing, and understanding the effects of contract executions. By using the eth_getTransactionReceipt RPC Ethereum method, developers can retrieve all necessary details about a transaction's execution. In case of an eth_getTransactionReceipt error, developers should verify that the provided transaction hash is correct and corresponds to an existing transaction. An eth_getTransactionReceipt example can help illustrate how to properly use this method.
You can also make requests to the eth_getTransactionReceipt method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getTransactionReceipt method and prints the returned transaction receipt information. Make sure to replace <ACCESS-TOKEN> with your actual API token.
The eth_getTransactionReceipt method can also be used in Web3 libraries for Ethereum, providing an interface to access transaction receipt data for various use cases, including auditing, debugging, and verifying contract behavior.
The Ethereum eth_getTransactionReceipt method provides detailed insights into transaction execution, making it an essential tool for developers working with Ethereum's JSON RPC API and Core API Endpoints.
Access Ethereum block, transaction, and event data via JSON-RPC methods.Easily retrieve block details, transaction information, and gas prices for efficient dApp development and blockchain interaction
This method returns an uncle block specified by the block hash and index.
The eth_getUncleByBlockHashAndIndex method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_getUncleByBlockHashAndIndexRPC Ethereum method allows developers to retrieve detailed information about uncle blocks, which can be useful for understanding network activity and consensus. The value of the uncle block's information can be crucial for various analysis purposes.
The eth_getUncleByBlockHashAndIndexRPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 32-byte block hash.
QUANTITY: The index of the uncle.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the uncle block details. Below is an example of a typical response:
difficulty: The difficulty of the uncle block.
extraData: Any extra data included in the uncle block.
gasLimit: The gas limit of the uncle block.
gasUsed: The gas used by the uncle block.
hash: The hash of the uncle block.
logsBloom: Bloom filter for light clients to quickly retrieve related logs.
miner: The address of the miner that mined the uncle block.
mixHash: A hash used in the mining process.
nonce: The hash that proves the work done by the miner.
number: The block number of the uncle.
parentHash: The hash of the parent block.
receiptsRoot: The root of the receipts trie of the uncle block.
sha3Uncles: The SHA3 hash of the uncles data in the block.
size: The size of the uncle block in bytes.
stateRoot: The root of the state trie.
timestamp: The timestamp of when the uncle was mined.
transactionsRoot: The root of the transaction trie of the uncle block.
uncles: Array of uncle hashes.
The response to this method can also include important information for analyzing specific transaction that might be related to the uncle blocks.The eth_getUncleByBlockHashAndIndex method is useful for developers who need to analyze the structure of uncle blocks in Ethereum. This method helps to gain insights into the consensus mechanism and understand the process of including uncles in the blockchain. By using the eth_getUncleByBlockHashAndIndexRPC Ethereum method, developers can easily access all necessary details about an uncle block. In case of an eth_getUncleByBlockHashAndIndex error, developers should verify that the provided block hash and index are correct. An eth_getUncleByBlockHashAndIndex example can illustrate the correct usage of this method.
You can also make requests to the eth_getUncleByBlockHashAndIndex method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getUncleByBlockHashAndIndex method and prints the returned uncle block information. Make sure to replace <ACCESS-TOKEN> with your actual API token.
The eth_getUncleByBlockHashAndIndex method can also be used in Web3 libraries for Ethereum, providing an interface to access uncle block data for various use cases, including network analysis and blockchain research.
The Ethereum eth_getUncleByBlockHashAndIndex method is an important tool for understanding the structure of uncle blocks, making it a valuable feature of the Ethereum JSON RPC API and Core API Endpoints.
The eth_getUncleByBlockNumberAndIndex method retrieves an uncle block by its block number and index, helping developers analyze network performance and consensus behavior using Ethereum's API
This method returns an uncle block specified by the block number and index
The eth_getUncleByBlockNumberAndIndex method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. This method returns an uncle block specified by the block number and index. The eth_getUncleByBlockNumberAndIndex RPC Ethereum method helps developers to retrieve information about uncle blocks, which can be useful for analyzing network performance and consensus behavior.
The eth_getUncleByBlockNumberAndIndex RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
QUANTITY | TAG: The block number, or one of the string tags latest, earliest, or pending.
QUANTITY: The index of the uncle within the block.
value: Placeholder for any additional data.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the uncle block details. Below is an example of a typical response:
value: A placeholder for any additional value information that might be associated with the uncle block.
difficulty: The difficulty of the uncle block.
extraData: Any extra data included in the uncle block.
gasLimit: The gas limit of the uncle block.
gasUsed: The gas used by the uncle block.
hash: The hash of the uncle block.
logsBloom: Bloom filter for light clients to quickly retrieve related logs.
miner: The address of the miner that mined the uncle block.
mixHash: A hash used in the mining process.
nonce: The hash that proves the work done by the miner.
number: The block number of the uncle.
parentHash: The hash of the parent block.
receiptsRoot: The root of the receipts trie of the uncle block.
sha3Uncles: The SHA3 hash of the uncles data in the block.
size: The size of the uncle block in bytes.
stateRoot: The root of the state trie.
timestamp: The timestamp of when the uncle was mined.
transactionsRoot: The root of the transaction trie of the uncle block.
uncles: Array of uncle hashes.
The eth_getUncleByBlockNumberAndIndex method is useful for developers who need to analyze the structure of uncle blocks in Ethereum. This method helps to gain insights into the consensus mechanism and understand the process of including uncles in the blockchain. By using the eth_getUncleByBlockNumberAndIndex RPC Ethereum method, developers can easily access all necessary details about an uncle block. In case of an eth_getUncleByBlockNumberAndIndex error, developers should verify that the provided block number and index are correct. An eth_getUncleByBlockNumberAndIndex example can illustrate the correct usage of this method.
You can also make requests to the eth_getUncleByBlockNumberAndIndex method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getUncleByBlockNumberAndIndex method and prints the returned uncle block information. Make sure to replace <ACCESS-TOKEN> with your actual API token. The eth_getUncleByBlockNumberAndIndex method can also be used in Web3 libraries for Ethereum, providing an interface to access uncle block data for various use cases, including network analysis and blockchain research.
The Web3 eth_getUncleByBlockNumberAndIndex method is also available in Web3 libraries, allowing developers to interact with uncle block data programmatically. The Ethereum eth_getUncleByBlockNumberAndIndex method is an important tool for understanding the structure of uncle blocks, making it a valuable feature of the Ethereum JSON RPC API and Core API Endpoints.
The eth_getUncleCountByBlockHash method returns the number of uncle blocks in a block by its hash, aiding developers in analyzing network consensus and performance through Ethereum's JSON-RPC Core API
This method returns the number of uncle blocks in a block that matches the given block hash
The eth_getUncleCountByBlockHash method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. This method returns the number of uncle blocks in a block that matches the given block hash. The eth_getUncleCountByBlockHash RPC Ethereum method is used to retrieve information about uncle blocks, which helps in understanding network consensus and performance.
The eth_getUncleCountByBlockHash RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The 32-byte block hash.
parameters: Additional information or data that might be needed to refine the query.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the number of uncle blocks for the specified block hash. Below is an example of a typical response:
result: The result contains the number of uncle blocks that were included in the given block.
The eth_getUncleCountByBlockHash method is particularly useful for developers and researchers interested in the consensus mechanism of Ethereum. By using the eth_getUncleCountByBlockHash method, they can determine how often uncles are included and understand the impact on the blockchain. In case of an eth_getUncleCountByBlockHash error, developers should check the provided block hash for accuracy. An eth_getUncleCountByBlockHash example can be found in this documentation to illustrate correct usage.
You can also make requests to the eth_getUncleCountByBlockHash method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getUncleCountByBlockHash method and prints the returned uncle block value. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_getUncleCountByBlockHash method can also be used in Web3 libraries for Ethereum, providing an interface to access uncle block data for various use cases, including blockchain research and network performance analysis.
The Ethereum eth_getUncleCountByBlockHash method provides a valuable tool for querying uncle counts, making it an essential part of the Ethereum JSON RPC API and Core API Endpoints.
The eth_getUncleCountByBlockNumber method returns the number of uncles in a block by its block number, providing developers with insights into network consensus and block performance via Ethereum's
This method returns the number of uncles in a block that matches the specified block number.
The eth_getUncleCountByBlockNumber method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. This method returns the number of uncles in a block that matches the specified block number. The eth_getUncleCountByBlockNumber RPC Ethereum method provides an efficient way to retrieve uncle counts, which is useful for analyzing network consensus and block performance. The value returned can be used to better understand network conditions.
The eth_getUncleCountByBlockNumber RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
QUANTITY | TAG: An integer representing the block index within the blockchain, or one of the string tags: latest, earliest, or pending, as described in the Block Parameter.
parameters: Additional information or data that might be needed to refine the query.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the number of uncle blocks for the specified block number. Below is an example of a typical response:
result: The result contains the number of uncle blocks that were included in the given block.
The eth_getUncleCountByBlockNumber method is particularly useful for developers and researchers interested in the consensus mechanism of Ethereum. By using the eth_getUncleCountByBlockNumber method, they can determine how often uncles are included in blocks and analyze the impact on the blockchain. In case of an eth_getUncleCountByBlockNumber error, developers should verify that the provided block number is valid. An eth_getUncleCountByBlockNumber example can be found in this documentation to illustrate correct usage.
You can also make requests to the eth_getUncleCountByBlockNumber method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getUncleCountByBlockNumber method and prints the returned uncle block count. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_getUncleCountByBlockNumber method can also be used in Web3 libraries for Ethereum, providing an interface to access uncle block data for various use cases, including blockchain research and network performance analysis.
The Ethereum eth_getUncleCountByBlockNumber method provides a valuable tool for querying uncle counts, making it an essential part of the Ethereum JSON RPC API and Core API Endpoints.
The value of uncle counts can provide insights into network stability and miner behavior, which are crucial for maintaining a healthy blockchain ecosystem.
The eth_getWork method returns the current block hash, seed hash, and target boundary condition, essential for mining software to find valid blocks. It's part of Ethereum's JSON-RPC Core API
This method returns the hash of the current block, the seed hash, and the required target boundary condition
The eth_getWork method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. This method returns the hash of the current block, the seed hash, and the required target boundary condition. The eth_getWork RPC Ethereum method is particularly useful for mining software that needs to obtain the necessary data for hashing in order to find valid blocks. If there is no mining work available, an eth_getWork error will be returned.
The eth_getWork RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with either the mining work data or an error message if no mining work is available. Below is an example of a typical error response:
error: If there is no mining work available, an error object will be returned with details, including the error code and message.
value: Represents the data or response values returned by the method.
The eth_getWork method is primarily used by mining software to receive the current block's information and the hashing parameters needed to attempt finding a valid hash. This method provides miners with the block hash, the seed hash, and the required boundary target, which they use to find a valid nonce. In case of an eth_getWork error, developers should verify the mining state and availability of work on the node. An eth_getWork example is provided in the request section for reference.
You can also make requests to the eth_getWork method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_getWork method and prints the returned work information or error. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_getWork method can also be used in Web3 libraries for Ethereum, providing an interface to interact with mining work for the network.
The Ethereum eth_getWork method provides miners with the necessary information to start mining, making it an essential part of the Ethereum JSON RPC API and Core API Endpoints. It is useful for retrieving information about the block value, transaction, and parameters involved in mining operations.
The eth_hashrate method returns the mining hashrate in hashes per second, reflecting the mining performance of the node. It is part of Ethereum's JSON-RPC Core API and helps monitor network security
This method returns the number of hashes per second with which the node is mining
The eth_hashrate method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. This method returns the number of hashes per second with which the node is mining. When the stratum server is enabled, the eth_hashrate RPC Ethereum method returns the cumulative hashrate of all sealers reporting their hashrate. This information is crucial for monitoring the mining performance and overall network security.
The eth_hashrate RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the mining hashrate. Below is an example of a typical response:
result: The result contains the current mining hashrate, represented as a hexadecimal string value
The eth_hashrate method is particularly useful for developers and miners who need to monitor the hashrate of their node. By using the eth_hashrate method, developers can determine how effectively their mining hardware is performing. In case of an eth_hashrate error, developers should check if the mining process is properly set up and that the node is connected to the network. An eth_hashrate example is provided in this documentation to illustrate the correct usage.
You can also make requests to the eth_hashrate method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_hashrate method and prints the returned hashrate value. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_hashrate method can also be used in Web3 libraries for Ethereum, providing an interface to access the mining hashrate data for various use cases, including monitoring mining performance and optimizing mining operations.
The Ethereum eth_hashrate method is an important part of the Ethereum JSON RPC API and Core API Endpoints, providing real-time information about the mining capabilities of a node. This method can be useful in scenarios where monitoring mining efficiency or determining overall network participation is needed. Additionally, developers can use this method to collect metrics on block production and transaction processing efficiency, making it a valuable tool in the Ethereum development ecosystem.
The eth_maxPriorityFeePerGas method returns the hex value of the priority fee needed for a transaction to be included in a block. It helps estimate transaction costs in Ethereum-based applications
Returns the hex value of the priority fee necessary to be included in ablock.
The eth_maxPriorityFeePerGas method is part of the Ethereum JSON RPC API and is designed to return the hexadecimal value of the priority fee required to be included in a block. This method is critical for estimating transaction costs in Ethereum-based applications and is widely used in Web3 integrations.
The eth_maxPriorityFeePerGas RPC Ethereum method works across various Ethereum network types, including
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To interact with the Ethereum eth_maxPriorityFeePerGas endpoint using JSON-RPC, use the following examples
The response contains the priority fee in hexadecimal format, indicating the minimum fee necessary for a transaction to be included in a block.
result: The hexadecimal representation of the priority fee. In the example above, 0x5f5e100 translates to 100,000,000 Wei in decimal.
The eth_maxPriorityFeePerGas method is used in Ethereum-based decentralized applications (DApps) to determine the appropriate priority fee for transactions. By querying the eth_maxPriorityFeePerGas RPC Ethereum method, developers can ensure their transactions are processed efficiently without overpaying for gas fees. This is particularly useful for applications integrating Web3, where transaction cost estimation is crucial.
For instance, a wallet application may call the Ethereum eth_maxPriorityFeePerGas method to calculate a competitive transaction fee in real time, enhancing the user experience.
Here is an eth_maxPriorityFeePerGas example of how to query the method using Python and JavaScript:
Common Errors
While querying the eth_maxPriorityFeePerGas RPC Ethereum method, developers may encounter some common issues:
Invalid URL or ACCESS-TOKEN: Ensure that the URL and token are correct and active.
Network Connectivity Problems: Verify that the network being queried is reachable and the correct endpoint is being used.
eth_maxPriorityFeePerGas error: This could occur if the method is not supported on the selected network. Check the supported network types and ensure compatibility.
By integrating the Web3 eth_maxPriorityFeePerGas method into your applications, you can provide precise and efficient transaction fee estimations, enhancing your DApp's functionality and user experience. Use this core API method to ensure your transactions are included in the block seamlessly.
The eth_mining method checks if the client is actively mining new blocks. It is useful for monitoring mining status in Ethereum systems and indicates that Besu pauses mining during synchronization
Whether the client is actively mining new blocks. Besu pauses miningwhile the client synchronizes with the network regardless of command settings or methods called.
The eth_mining method is part of the Ethereum JSON RPC API and determines whether the client is actively mining new blocks. This method is useful for understanding the status of mining operations in Ethereum-based systems. It also highlights that Besu pauses mining while the client synchronizes with the network, regardless of command settings or methods called.
The eth_mining RPC Ethereum method works on various Ethereum network types, including:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To interact with the Ethereum eth_mining endpoint using JSON-RPC, use the following examples
The response indicates whether the client is currently mining new blocks.
result: A boolean value indicating the mining status:
true: The client is actively mining.
false: The client is not mining (e.g., paused due to synchronization).
The eth_mining method is used in Ethereum-based decentralized applications (DApps) and monitoring tools to verify whether mining is active on the client. By querying the eth_mining RPC Ethereum method, developers and administrators can:
Monitor mining activity in real time.
Debug issues related to mining pauses during network synchronization.
Provide insights for mining pools or standalone miners.
For instance, a Web3 application may call the Ethereum eth_mining method to check the mining status before initiating block-dependent operations.
Here is an eth_mining example of how to query the method using Python and JavaScript:
When using the eth_mining RPC Ethereum method, the following errors may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
Network Connectivity Problems: Verify the network is reachable and the correct endpoint is being used.
eth_mining error: This may occur if the method is not supported on the selected network or if there are synchronization issues with the client.
By integrating the Web3 eth_mining method into your applications, you can monitor mining activity efficiently and ensure seamless operation in Ethereum-based systems. Use this core API method to retrieve the mining status of the client and adapt your DApp’s behavior accordingly.
\
The eth_newBlockFilter method is part of the Ethereum JSON RPC API and is used to create a filter in the node that notifies when a new block is added to the blockchain.
Creates a filter in the node, to notify when a new block arrives. Tocheck if the state has changed, call eth_getFilterChanges.
The eth_newBlockFilter method is part of the Ethereum JSON RPC API and is used to create a filter in the node that notifies when a new block is added to the blockchain. This method is essential for monitoring block updates and is frequently utilized in Web3 applications to track real-time blockchain activity. To check for changes, the filter can be queried using the eth_getFilterChanges method.
The eth_newBlockFilter RPC Ethereum method works on various Ethereum network types, including:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To interact with the Ethereum eth_newBlockFilter endpoint using JSON-RPC, use the following examples
The response contains the ID of the newly created filter, which can be used to query for changes.
result: A string containing the filter ID in hexadecimal format. This ID is used with the eth_getFilterChanges or eth_uninstallFilter methods.
The value returned by the eth_newBlockFilter method, which is the filter ID, is a crucial part of real-time blockchain monitoring. Applications can use this value to retrieve updates and check for changes effectively.
The eth_newBlockFilter RPC Ethereum method is commonly used in decentralized applications (DApps) and monitoring tools to:
Track new block arrivals in real time.
Trigger specific actions when a block is added.
Monitor blockchain activity for events that rely on new blocks.
For example, a Web3 application may use the Ethereum eth_newBlockFilter method to notify users of incoming transactions or to update the application state with the latest block data
Here is an eth_newBlockFilter example of how to query the method using Python and JavaScript:
When using the eth_newBlockFilter RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure that the URL and token are correct and active.
Network Connectivity Problems: Verify that the network being queried is reachable and the correct endpoint is being used.
eth_newBlockFilter error: This error may occur if the node does not support filters or if the request is malformed.
By integrating the Web3 eth_newBlockFilter method into your application, you can monitor blockchain activity efficiently. Use this core API method to create filters and track new blocks in real time, enhancing the responsiveness of your DApp or monitoring tools.
The eth_newFilter method creates a filter object based on specified options to notify the client when the state changes, such as new logs. It is part of the Ethereum JSON RPC API
Creates a filter object, based on filter options, to notify when thestate changes (logs)
The eth_newFilter method is part of the Ethereum JSON RPC API and is used to create a filter object based on specified filter options. This method notifies the client when the state changes (logs). To check if the state has changed, the eth_getFilterChanges method can be used.
The eth_newFilter RPC Ethereum method is supported on the following network types:
Mainnet
Testnet: Sepolia, Holesky
The method accepts a filter object with the following keys and their values:
address (optional): A contract address or a list of addresses from which logs should originate.
fromBlock (optional, default is latest): A hexadecimal block number or one of the strings latest, earliest, or pending.
toBlock (optional, default is latest): A hexadecimal block number or one of the strings latest, earliest, or pending.
topics (optional): An array of 32-byte DATA topics. Topics are order-dependent.
Specifying Topic Filters
Topics are order-dependent. A transaction log with topics A, B will match the following topic filters:
[]: Matches anything.
[A]: Matches A in the first position, and anything after.
[null, B]: Matches anything in the first position AND B in the second position, and anything after.
[A, B]: Matches A in the first position AND B in the second position, and anything after.
[[A, B], [A, B]]: Matches (A OR B) in the first position AND (A OR B) in the second position, and anything after.
URL (API Endpoint)
To interact with the Ethereum eth_newFilter endpoint using JSON-RPC, use the following examples:
The response contains the ID of the newly created filter, which can be used to query changes.
result: A string containing the filter ID in hexadecimal format. This ID is used with methods such as eth_getFilterChanges or eth_uninstallFilter to manage and query the filter.
The eth_newFilter RPC Ethereum method is commonly used in decentralized applications (DApps) and monitoring tools to:
Track specific events or transactions in real time.
Monitor logs emitted by a smart contract.
Create dynamic notifications based on blockchain state changes.
For instance, a Web3 application may call the Ethereumeth_newFilter method to track specific events emitted by a smart contract and update the UI or trigger custom workflows when those events occur.
Here is an eth_newFilter example of how to query the method using Python and JavaScript:
When using the eth_newFilter RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure that the URL and token are correct and active.
Incorrect Parameters: Verify that the filter object is formatted correctly.
eth_newFilter error: This error may occur if the node does not support filtering or if the request is malformed.
By integrating the Web3 eth_newFilter method into your application, you can efficiently monitor blockchain logs and events. Use this core API method to create filters and track specific transactions or state changes in real time, enhancing the responsiveness of your DApp or monitoring tools.
The eth_newPendingTransactionFilter method creates a filter in the node to notify when new pending transactions arrive.
Creates a filter in the node, to notify when new pending transactionsarrive. To check if the state has changed, call eth_getFilterChanges.
The eth_newPendingTransactionFilter method is part of the Ethereum JSON-RPC API and is used to create a filter in the node to notify when new pending transactions arrive. This method is essential for monitoring transaction activity in real time. To check for updates, the eth_getFilterChanges method can be called.
The eth_newPendingTransactionFilter RPC Ethereum method works across various Ethereum network types, including:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To interact with the Ethereum eth_newPendingTransactionFilter endpoints using JSON-RPC, use the following examples
The response contains the ID of the newly created filter, which can be used to query changes.
result: A string containing the filter ID in hexadecimal format. This value can be used with methods such as eth_getFilterChanges or eth_uninstallFilter to manage and query the filter.
The eth_newPendingTransactionFilter RPC Ethereum method is widely used in decentralized applications (DApps) and monitoring tools to:
Track pending transactions in real time.
Monitor network activity for transaction patterns or anomalies.
Provide dynamic notifications to users about transactions in progress.
For instance, a Web3 application may use the Ethereum eth_newPendingTransactionFilter method to notify users about their pending transactions and update the application state based on transaction status.
Here is an eth_newPendingTransactionFilter example of how to query the method using Python and JavaScript:
When using the eth_newPendingTransactionFilter RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
Network Connectivity Problems: Verify that the network being queried is reachable and the correct endpoint is being used.
eth_newPendingTransactionFilter error: This error may occur if the node does not support filtering or if the request is malformed.
By integrating the Web3 eth_newPendingTransactionFilter method into your application, you can efficiently track transaction activity. Use this core API method to monitor pending transactions and provide a responsive user experience in real time.
The eth_sendRawTransaction method is part of the Ethereum JSON RPC API and is used to send a signed transaction to the network. It can transfer Ether, deploy a smart contract, or interact .
Sends a signed transaction. A transaction can send ether, deploy acontract, or interact with a contract
The eth_sendRawTransaction method is part of the Ethereum JSON RPC API and is used to send a signed transaction to the network. Transactions sent using this method can transfer Ether, deploy a smart contract, or interact with an existing contract. This method is widely used in Web3 applications to execute blockchain transactions securely.
To avoid exposing your private key, it is recommended to create signed transactions offline and use the eth_sendRawTransaction RPC Ethereum method to send the serialized transaction data.
The eth_sendRawTransaction RPC Ethereum method works across various Ethereum network types, including:
Mainnet
Testnet: Sepolia, Holesky
The method accepts a single parameter:
data: The signed transaction serialized into hexadecimal format.
URL (API Endpoint)
To interact with the Ethereum eth_sendRawTransaction endpoint using JSON-RPC, use the following examples
The response may indicate success or an error, depending on the validity of the transaction.
Example Response (Error)
error: Contains the error details if the transaction was invalid. For example, "only replay-protected (EIP-155) transactions allowed over RPC".
result: The transaction hash if the transaction is successfully broadcast to the network.
value: Not directly included in the response, but the value sent in the transaction is specified in the serialized data.
The eth_sendRawTransaction RPC Ethereum method is commonly used in decentralized applications (DApps) and wallet solutions to:
Deploy new smart contracts.
Interact with existing contracts by sending signed transactions.
Execute secure Ether transfers without exposing private keys.
For instance, a Web3 application may use the Ethereum eth_sendRawTransaction method to enable users to send transactions directly from their wallets.
Here is an eth_sendRawTransaction example of how to query the method using Python and JavaScript:
When using the eth_sendRawTransaction RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
eth_sendRawTransaction error: This could happen if the transaction is improperly signed or formatted.
eth_sendrawtransaction invalid sender: Indicates that the sender's address is invalid or does not match the signature.
Replay Protection: Only replay-protected (EIP-155) transactions are allowed over RPC.
By integrating the Web3 eth_sendRawTransaction method into your application, you can securely send transactions and interact with the Ethereum blockchain. Use this core API method to enable seamless user experiences while maintaining high security.
\
The eth_submitHashrate method is part of the Ethereum JSON-RPC API and is used to submit the mining hashrate. It is commonly used by mining software, such as Ethminer, to report hash rates.
Submits the mining hashrate.Used by mining software such as Ethminer.
The eth_submitHashrate method is part of the Ethereum JSON-RPC API and is used to submit the mining hashrate. This method is commonly used by mining software, such as Ethminer, to report their hash rates to the Ethereum network.
The eth_submitHashrate RPC Ethereum method is supported on the following network types:
Mainnet
Testnet: Sepolia, Holesky
The method accepts two parameters:
DATA (32 Bytes): A hexadecimal string representation of the hash rate.
DATA (32 Bytes): A random hexadecimal ID identifying the client submitting the hashrate.
URL (API Endpoint)
To interact with the Ethereum eth_submitHashrate endpoint using JSON-RPC, use the following examples:
The response indicates whether the hashrate submission was successful.
result: A boolean value indicating the success (true) or failure (false) of the hashrate submission.
value: Not directly included in the response, but the value of the submitted hashrate is specified in the parameters.
The eth_submitHashrate RPC Ethereum method is widely used by mining software and monitoring tools to:
Report mining hashrate to the Ethereum network.
Provide visibility into the computational power contributed by individual miners or mining pools.
Ensure accurate representation of mining activity on the blockchain.
For instance, a Web3 application that integrates mining functionalities may use the Ethereum eth_submitHashrate method to send hashrate data for analytics or reporting.
Here is an eth_submitHashrate example of how to query the method using Python and JavaScript:
Common Errors
When using the eth_submitHashrate RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
eth_submitHashrate error: This could happen if the parameters are improperly formatted.
Incorrect Hashrate or Client ID: Verify that the submitted hexadecimal strings are valid and meet the 32-byte requirement.
By integrating the Web3 eth_submitHashrate method into your application, you can provide accurate hashrate reporting and ensure proper representation of mining contributions. Use this core API method to monitor and report mining activity seamlessly.
The eth_submitWork method is part of the Ethereum JSON-RPC API and is used to submit a Proof of Work (Ethash) solution.
This method is commonly utilized by mining software, such as Ethminer, to validate block mining efforts and contribute to the Ethereum blockchain.
The eth_submitWork method is part of the Ethereum JSON-RPC API and is used to submit a Proof of Work (Ethash) solution.
The eth_submitWork RPC Ethereum method is supported on the following network types
Mainnet
Testnet: Sepolia, Holesky
The method accepts the following parameters:
DATA (8 Bytes): The retrieved nonce in hexadecimal format.
DATA (32 Bytes): The hash of the block header (PoW-hash) in hexadecimal format.
DATA (32 Bytes): The mix digest in hexadecimal format.
URL (API Endpoint)
To interact with the Ethereum eth_submitWork endpoint using JSON-RPC, use the following examples:
The response indicates whether the Proof of Work submission was successful.
result: A boolean value indicating the success (true) or failure (false) of the Proof of Work submission.
value: Not directly included in the response, but represents the outcome of the Proof of Work validation attempt.
The eth_submitWork RPC Ethereum method is widely used in mining software and tools to:
Submit valid Proof of Work solutions.
Participate in the Ethereum blockchain mining process.
Validate computational contributions to the network.
For instance, a Web3 mining application may use the Ethereum eth_submitWork method to send PoW solutions and earn mining rewards based on successful validations.
Here is an eth_submitWork example of how to query the method using Python and JavaScript:
When using the eth_submitWork RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
eth_submitWork error: This could happen if the Proof of Work solution is invalid or improperly formatted.
Incorrect Nonce, Hash, or Mix Digest: Verify that all parameters are valid hexadecimal strings with the correct length.
By integrating the Web3 eth_submitWork method into your mining software, you can ensure efficient submission and validation of Proof of Work solutions. Use this core API method to contribute to the Ethereum blockchain and participate in its decentralized consensus process.
The eth_subscribe method is part of the Ethereum JSON-RPC API and is used to subscribe to specified event types. Available only via WebSocket
Subscribes to a specified event type, optionally restricted to one ormany objects. This method is available via websocket only.
The eth_subscribe method is part of the Ethereum JSON-RPC API and is used to subscribe to specified event types. This method is available only via WebSocket connections and allows clients to receive real-time updates about blockchain events.
The eth_subscribe RPC Ethereum method is supported on:
Mainnet
Testnet: Sepolia, Holesky
The method accepts the following parameters:
type (string): A subscription type. Possible values include:
newHeads: Subscribes to new headers appended to the chain, including chain reorganizations.
logs: Subscribes to logs included in new imported blocks that match the specified filter criteria.
newPendingTransactions: Subscribes to transaction hashes for all transactions added to the pending state and signed with a key available in the node.
objects (optional, hex string): Additional arguments such as an address, multiple addresses, or topics for filtering logs or events.
URL (API Endpoint)
To interact with the Ethereum eth_subscribe endpoint using WebSocket, use the following example:
The response may indicate success or an error, depending on the availability of WebSocket notifications.
Response
result: On success, returns the subscription ID for the requested event type.
eth_subscribe error: On failure, provides error details, such as "notifications not supported."
value: The details of subscribed event updates, depending on the subscription type, such as block headers, logs, or transaction hashes.
The eth_subscribe RPC Ethereum method is commonly used in Web3 applications and monitoring tools to:
Track new block headers for real-time blockchain synchronization.
Monitor specific contract logs using eth_subscribe logs to capture events emitted by smart contracts.
Observe new pending transactions for analytics or operational insights.
For example, a Web3 application can use the Ethereum eth_subscribe method to provide live updates about blockchain activity, enhancing user interaction and real-time feedback.
Here is an eth_subscribe example of how to query the method using JavaScript:
When using the eth_subscribe RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the WebSocket URL and token are correct and active.
eth_subscribe error: This could happen if the requested event type or parameters are invalid.
Unsupported Notifications: If WebSocket notifications are not enabled on the node, the error "notifications not supported" may be returned.
By integrating the Web3 eth_subscribe method into your application, you can provide real-time updates for blockchain events. Use this core API method to enhance user experiences and enable live monitoring of Ethereum network activities.
The eth_syncing method is part of the Ethereum JSON-RPC API and is used to check the synchronization status of an Ethereum node. It returns detailed synchronization data if the node is syncing
Returns an object with data about the synchronization status, or falseif not synchronizing.
The eth_syncing method is part of the Ethereum JSON-RPC API and is used to check the synchronization status of an Ethereum node. This method returns detailed synchronization data if the node is syncing, or false if the node is fully synchronized.
The eth_syncing RPC Ethereum method works on the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To interact with the Ethereum eth_syncing endpoint using JSON-RPC, use the following examples:
The response indicates whether the node is synchronizing. If the node is synchronizing, an object with detailed synchronization status is returned. If the node is fully synchronized, false is returned.
Example Response
Example Response (Node Synchronizing)
Response Description
result: The synchronization status:
false: The node is fully synchronized.
Object: Detailed data about synchronization status, including:
startingBlock: The block at which the node started syncing.
currentBlock: The block number the node has currently synced to.
highestBlock: The highest block the node is aware of.
value: Represents the synchronization progress, implicitly indicated by the currentBlock and highestBlock values.
The eth_syncing RPC Ethereum method is widely used in monitoring and analytics tools to:
Determine the synchronization status of a node.
Track progress during node setup or recovery.
Provide insights into blockchain synchronization behavior.
For example, a Web3 monitoring application may use the Ethereum eth_syncing method to notify users when their node has completed synchronization or to display real-time sync progress.
Here is an eth_syncing example of how to query the method using Python and JavaScript:
When using the eth_syncing RPC Ethereum method, the following issues may occur:
Invalid URL or ACCESS-TOKEN: Ensure the URL and token are correct and active.
eth_syncing error: This could happen if the node is unreachable or the request format is incorrect.
Unexpected Response: Verify that the node supports synchronization queries and is actively syncing if expected.
By integrating the Web3 eth_syncing method into your application, you can monitor synchronization status efficiently. Use this core API method to ensure your node is up-to-date and ready for blockchain operations.
The eth_uninstallFilter method is part of the Ethereum JSON-RPC Core API and is used to uninstall a filter with a specified filter ID. It is crucial for managing filters that are no longer required.
This method uninstalls a filter with the specified filter ID
The eth_uninstallFilter method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_uninstallFilter RPC Ethereum method is crucial for managing filters that are no longer required. Filters are automatically timed out if they are not queried using eth_getFilterChanges or eth_getFilterLogs for 10 minutes.
The eth_uninstallFilter RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: The filter ID to uninstall.
parameters: Additional context or metadata related to the request, if applicable.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object indicating whether the filter was successfully uninstalled. Below is an example of a typical response:
Response Description
result: A boolean value indicating whether the filter was successfully uninstalled. false typically means that the filter ID provided does not exist or has already been removed.
The eth_uninstallFilter method is particularly useful for applications that manage Ethereum logs or events using filters. Once a filter is no longer needed, calling this method ensures optimal resource usage by uninstalling unnecessary filters. In case of an eth_uninstallFilter error, developers should verify that the filter ID provided is valid and that the filter has not already timed out. An eth_uninstallFilter example is provided in this documentation to illustrate proper usage.
You can also make requests to the eth_uninstallFilter method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_uninstallFilter method and prints the result indicating whether the filter was successfully uninstalled. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_uninstallFilter method can also be used in Web3 libraries for Ethereum to manage filters programmatically.
The Ethereum eth_uninstallFilter method provides developers with an efficient way to clean up unused filters. This is particularly important for applications that frequently interact with Ethereum filters and events, ensuring optimal use of resources within the Ethereum JSON RPC API and Core API Endpoints. Transaction management is also essential for optimizing resource usage and API performance.
The eth_unsubscribe method is part of the Ethereum JSON-RPC Core API and is used to cancel a specified subscription by its ID. It helps developers manage active subscriptions, optimizing resource.
This method cancels a specified subscription by its ID
The eth_unsubscribe method is part of the Ethereum JSON RPC Core API, used to interact with Ethereum nodes. The eth_unsubscribe RPC Ethereum method is particularly useful for managing active subscriptions and ensuring resource efficiency by removing unnecessary subscriptions.The method provides value to developers by optimizing resource usage.
The eth_unsubscribe RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
DATA: A hex string representing the subscription ID that was previously generated with the eth_subscribe method.
parameters: Additional input data used to specify the subscription ID for cancellation.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object indicating the success or failure of the unsubscription. Below is an example response:
Response Description
result: Returns true if the subscription was successfully canceled or false otherwise.
error: Provides an error message, such as "subscription not found," if the subscription ID is invalid or does not exist.Each response helps track block states or errors that might occur during the cancellation process.
The eth_unsubscribe method is essential for developers who need to manage active subscriptions created using the eth_subscribe method. By unsubscribing from unneeded events, developers can optimize resource usage and maintain efficient connections with the Ethereum node. In case of an eth_unsubscribe error, ensure that the subscription ID provided in the parameters matches an existing subscription.
An eth_unsubscribe example demonstrates how to properly use this method to cancel subscriptions effectively.This approach ensures fewer unnecessary transactions being sent to the node, improving overall efficiency.
You can also make requests to the eth_unsubscribe method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the eth_unsubscribe method and prints the returned status of the unsubscription. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 eth_unsubscribe method can also be used in Web3 libraries for Ethereum, providing an interface to manage subscriptions in decentralized applications.
The Ethereum eth_unsubscribe method provides a reliable way to cancel subscriptions, making it a critical part of the Ethereum JSON RPC API and Core API Endpoints.
The net_listening method is part of the Ethereum JSON-RPC Core API and checks whether the Ethereum client is actively listening for network connections. It returns a boolean value.
The net_listening method checks if the Ethereum client is actively listening for network connections.
The net_listening method is part of the Ethereum JSON RPC Core API, used to determine whether the Ethereum client is actively listening for network connections. This method provides a simple boolean response, which is particularly useful for diagnosing network connectivity issues or verifying that the client is configured to accept connections
The net_listening RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing a boolean value indicating whether the client is listening for network connections. Below is an example of a typical response:
Response Description
result: A boolean value that indicates whether the client is actively listening for network connections. true means the client is listening, and false means it is not.
The net_listening method is particularly useful for developers and system administrators who need to verify the network status of their Ethereum node. For example, this method can help diagnose network connectivity issues or confirm that the client is ready to accept incoming connections. In case of a net_listening error, verify that the Ethereum client is running and properly configured to listen for connections. An example of correct usage is included in this documentation under the net_listening example.
You can also make requests to the net_listening method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the net_listening method and prints the returned boolean status. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 net_listening method is also available in Web3 libraries for Ethereum, providing developers with a convenient interface to check the network status.
The Ethereum net_listening method is an essential tool for diagnosing network issues and ensuring that the Ethereum client is actively accepting connections. This method is a key part of the Ethereum JSON RPC API and Core API Endpoints.
The net_peerCount method is part of the Ethereum JSON-RPC Core API and returns the number of peers connected to the Ethereum client. It provides a hexadecimal response.
The net_peerCount method returns the number of peers currently connected to the Ethereum client.
The net_peerCount method is part of the Ethereum JSON RPC Core API, used to retrieve the number of peers currently connected to the Ethereum client. This method provides a hexadecimal response representing the peer count, which is essential for monitoring the health and connectivity of the client.
The net_peerCount RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the current peer count. Below is an example of a typical response:
Response Description
result: A hexadecimal value representing the number of peers currently connected to the client.
The net_peerCount method is particularly useful for developers and system administrators who need to monitor the network connectivity of their Ethereum node. A high peer count indicates good connectivity, while a low or zero count may suggest issues with the node’s network configuration. In case of a net_peerCount error, ensure that the client is properly configured to connect to peers. An example of correct usage is provided in this documentation under the net_peerCount example.A low peer count may also delay transaction propagation, affecting performance.
You can also make requests to the net_peerCount method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the net_peerCount method and prints the returned peer count. Make sure to replace <ACCESS-TOKEN> with your actual API token. The Web3 net_peerCount method is also available in Web3 libraries for Ethereum, providing a convenient interface for developers to monitor peer connectivity.
The Ethereum net_peerCount method is a key tool for assessing the network connectivity of an Ethereum client. By providing the number of connected peers, this method helps ensure that the client is fully operational and well-connected. This functionality is a vital part of the Ethereum JSON RPC API and Core API Endpoints.
The net_version method is part of the Ethereum JSON-RPC Core API and returns the network ID of the Ethereum client. It helps identify the current network the client is connected to, such as Mainnet.
The net_version method returns the network ID of the Ethereum client, identifying the current network (e.g., Mainnet, Sepolia, or a test network) it is connected to.
The net_version method is part of the Ethereum JSON RPC Core API, used to retrieve the network ID of the Ethereum client. This network ID is crucial for identifying the current Ethereum network that the client is connected to, such as Mainnet, Sepolia, or other test networks.
The net_version RPC Ethereum method supports the following network types:
Mainnet
Testnet: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the network ID. Below is an example of a typical response:
Response Description
result: A string representing the network ID. For example:
"1": Mainnet
"11155111": Sepolia
"3": Ropsten (deprecated)
"4": Rinkeby (deprecated)
The net_version method is essential for developers who need to verify the network their Ethereum client is connected to. This is particularly useful in multi-network applications where the client must dynamically switch between networks. In case of a net_version error, ensure the client is correctly configured and connected to the desired network. An example of proper usage is included under the net_version example in this documentation.
You can also make requests to the net_version method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the net_version method and prints the returned network ID. Replace <ACCESS-TOKEN> with your actual API token. The Web3 net_version method can also be accessed via Web3 libraries for Ethereum, providing a simplified way to query network information.
The Ethereum net_version method is a key tool for developers working with the Ethereum JSON RPC API. By identifying the current network through its ID, this method ensures that transactions and operations are executed on the intended blockchain. As part of the Core API Endpoints, it plays a critical role in maintaining network integrity and compatibility.As part of the Core API Endpoints, it plays a critical role in maintaining network integrity and compatibility, while ensuring accurate block and transaction management.
The rpc_modules method is part of the Ethereum JSON-RPC Core API and lists all enabled APIs and their versions on the Ethereum node. It helps developers verify module availability .
The rpc_modules method lists all enabled JSON-RPC APIs and their versions on the Ethereum node, helping developers verify module availability and compatibility.
The rpc_modules method is part of the Ethereum JSON RPC Core API, used to list all enabled APIs and their corresponding versions on the Ethereum node. This method is particularly relevant when developers are working with specific modules, such as block or transaction, to ensure compatibility with Ethereum node configurations. Understanding the versioning and availability of these modules simplifies integration and reduces errors during implementation. The response includes all relevant module details, which can be used to validate the value of specific module interactions.
The rpc_modules RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing a list of enabled APIs and their respective versions. Below is an example of a typical response:
result: An object containing the names of the enabled APIs as keys and their corresponding versions as values.
The rpc_modules method is essential for developers who need to verify which APIs are enabled on an Ethereum node. This can be useful for debugging, setting up environments, or ensuring compatibility with specific features. In case of an rpc_modules error, developers should confirm that the node supports this method and is configured correctly. An rpc_modules example is included in this documentation to demonstrate the correct usage of this method.
You can also make requests to the rpc_modules method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the rpc_modules method and prints the returned list of enabled APIs and their versions. Replace <ACCESS-TOKEN> with your actual API token. The Web3 rpc_modules method can also be accessed through Web3 libraries for Ethereum, offering a convenient way to retrieve module information programmatically.
The Ethereum rpc_modules method is a key tool for developers working with the Ethereum JSON RPC API, enabling them to identify available APIs and their versions quickly. As part of the Core API Endpoints, this method enhances compatibility and debugging workflows by providing transparent module information.
\
The web3_clientVersion method is part of the Ethereum JSON RPC Core API and retrieves the current version of the Ethereum client. It helps developers ensure compatibility.
The web3_clientVersion method retrieves the current version of the Ethereum client, providing developers with essential information for compatibility and debugging.
The web3_clientVersion method is part of the Ethereum JSON RPC Core API and is used to retrieve the current version of the Ethereum client. This method holds significant value for developers as it allows them to verify client and version information, ensuring compatibility with required features and functionalities. As part of the Core API Endpoints, it provides transparency about the client environment and includes detailed client version data. This simplifies monitoring, debugging, and integration with Ethereum nodes, offering quick and accurate client version verification and streamlining the development process.
The web3_clientVersion RPC Ethereum method is supported across all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the version of the Ethereum client. Below is an example of a typical response:
result: A string indicating the version of the Ethereum client, including details such as the client name, version, operating system, and compiler version.
The web3_clientVersion method is particularly useful for:
Debugging: Identifying the client version to diagnose compatibility issues.
Monitoring: Verifying that the client is running the expected version.
Integration: Ensuring that the node supports the required features for application development.
In case of a web3_clientVersion error, developers should check the node configuration and ensure that the node supports the JSON RPC API. A web3_clientVersion example is included to demonstrate proper usage.
You can also make requests to the web3_clientVersion method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the web3_clientVersion method and prints the returned client version. Replace with your actual API token. The Web3 web3_clientVersion method is also accessible through Web3 libraries for Ethereum, enabling developers to query client information efficiently.
The web3_sha3 method is part of the Ethereum JSON RPC Core API and computes the Keccak-256 hash of the provided input data, returning a hexadecimal-encoded hash string.
The web3_sha3 method computes the Keccak-256 hash of the given input data, returning a hexadecimal-encoded hash string.
The web3_sha3 method is part of the Ethereum JSON RPC Core API, designed to return a SHA3 hash of the specified data. Note that the result value is a Keccak-256 hash, not the standardized SHA3-256, which is important for Ethereum-specific cryptographic operations.
The web3_sha3 RPC Ethereum method is universally supported across all Ethereum networks, including:
Mainnet
Testnets: Sepolia, Holesky
DATA: Data to convert to a SHA3 hash.
parameters: None.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing the Keccak-256 hash of the input data. Below is an example of a typical response:
result: The Keccak-256 hash of the provided data, represented as a hexadecimal string.
The web3_sha3 method is crucial for developers working with Ethereum-based cryptographic operations, such as validating signatures or creating unique identifiers. It can be used to hash arbitrary data to ensure data integrity or to generate unique keys. In case of a web3_sha3 error, developers should verify that the input data is properly formatted as a hexadecimal string.
An illustrative web3_sha3 example is provided in this documentation to demonstrate the method's correct usage.
You can also make requests to the web3_sha3 method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the web3_sha3 method and prints the returned hash value. Replace <ACCESS-TOKEN> with your actual API token. The Web3 web3_sha3 method can also be utilized through Web3 libraries for Ethereum to integrate hashing capabilities directly into decentralized applications.
The Ethereum web3_sha3 method is an integral part of the Ethereum JSON RPC API, allowing developers to leverage Keccak-256 hashing in their projects. As a Core API Endpoint, it ensures secure and reliable hashing operations while maintaining compatibility across different Ethereum environments.
The debug_accountRange method is part of the Ethereum JSON RPC Core API and retrieves a range of accounts stored in the state trie of the Ethereum node for debugging purposes.
The debug_accountRange method retrieves a range of accounts stored in the state trie of the Ethereum node, along with their details, for debugging purposes.
The debug_accountRange method is part of the Ethereum JSON RPC Core API. It is used to enumerate all accounts at a given block with paging capability. The method allows developers to retrieve a specified number of accounts (maxResults) starting from a particular hashed address (start key). If the incompletes parameter is set to false, accounts lacking a key preimage (the actual address) in the database are skipped. Note that Geth, by default, does not store preimages, which may affect the results.
The debug_accountRange RPC Ethereum method supports the following Ethereum network types:
Mainnet
Testnets: Sepolia, Holesky
The debug_accountRange method accepts the following parameters:
blockNrOrHash (DATA): The block number or hash.
start (DATA): The hashed address from which to start the enumeration.
maxResults (DATA): The maximum number of accounts to return per page.
incompletes (DATA): A boolean value. If set to false, accounts without a key preimage are skipped.
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object indicating whether the method was allowed or denied. Below is an example of a typical response when the method is not allowed:
result: The result of the method call. In this case, null is returned when the method is not allowed.
status_code: The HTTP status code. A 405 status indicates that the method is not allowed.
message: A descriptive message about the status of the request.
The debug_accountRange method can be used for detailed account enumeration in specific blockchain scenarios where paging capabilities are needed. Developers can use this method to retrieve accounts starting from a particular hashed address and define how many results should be returned per request. The debug_accountRange error message, such as "Method not allowed," indicates that the node does not support the method or the request parameters are incorrect. An illustrative debug_accountRange example is included in this documentation to demonstrate proper usage.
Below is an example of how to call the debug_accountRange method programmatically using Python:
This Python script sends a request to the debug_accountRange method and prints the response. Replace <ACCESS-TOKEN> with your actual API token. The Web3 debug_accountRange method can also be accessed through Web3 libraries for Ethereum, providing developers with flexibility and programmatic access.
The Ethereum debug_accountRange method is part of the Core API and provides critical functionality for enumerating accounts at specific blocks with paging capabilities. As one of the Core API Endpoints, this method is instrumental for developers needing detailed account data on the Ethereum blockchain.
The debug_batchSendRawTransaction method is part of the Ethereum JSON RPC Core API and enables the submission of multiple raw transactions in a single batch.
The debug_batchSendRawTransaction method allows sending multiple raw transactions in a single batch, enabling efficient submission of transactions to the Ethereum network.
The debug_batchSendRawTransaction method is part of the Ethereum JSON RPC Core API, designed to send a list of signed transactions in a single request. This method allows developers to efficiently load a network with multiple transactions simultaneously, offering the same functionality as calling eth_sendRawTransaction multiple times. However, this method is not allowed by default and may return an error if invoked.
The debug_batchSendRawTransaction RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
URL (API Endpoint)
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with an error message, as this method is not allowed by default. Below is an example of a typical response:
result: Null, indicating the method is not allowed.
status_code: HTTP status code 405, which means the method is not allowed.
message: A description of the error, "Method not allowed."
The debug_batchSendRawTransaction method is useful for developers aiming to test or stress-load the Ethereum network by sending multiple transactions at once. However, due to its restricted nature, it is commonly disabled in production environments. In case of a debug_batchSendRawTransaction error, developers should confirm the method is enabled and ensure proper signed transaction data is provided. A debug_batchSendRawTransaction example is included in this documentation for reference.
You can also make requests to the debug_batchSendRawTransaction method programmatically using Python. Below is an example using the requests library:
This Python script demonstrates how to call the debug_batchSendRawTransaction method. Ensure that <ACCESS-TOKEN> is replaced with a valid API token. The Web3 debug_batchSendRawTransaction method can also be utilized via Web3 libraries for Ethereum, providing a streamlined way to send bulk transactions programmatically.
The Ethereum debug_batchSendRawTransaction method is a specialized tool for sending multiple transactions in one request, offering efficiency and reduced overhead for bulk transaction scenarios. As part of the Ethereum JSON RPC API and Core API Endpoints, this method is ideal for testing and development environments, where bulk transaction operations are required. The method accepts transaction parameters and returns a value indicating the success or failure of the operation.
The debug_getBadBlocks method is part of the Ethereum JSON RPC Core API and returns a list of invalid blocks observed by the Ethereum client.
Returns a list of invalid blocks. This is used to detect and analyzeconsensus flaws.
The debug_getBadBlocks method is part of the Ethereum JSON RPC Core API, designed to return a list of invalid blocks observed by the Ethereum client. This method is particularly useful for developers and network operators to detect and analyze consensus flaws.
The debug_getBadBlocks RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
URL (API Endpoints) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object containing information about invalid blocks. Below is an example of a typical response:
The response contains details about invalid blocks, including:
result: A list of bad blocks or null if none are found.
status_code: The HTTP status code of the response.
message: An explanatory message, such as "Method not allowed."
Each invalid block object in the response includes the following fields:
hash: The hash of the block.
block: A detailed block object or null if not found.
baseFeePerGas: The base fee per gas in the block.
difficulty: The difficulty level of the block.
extraData: Additional data included in the block.
gasLimit: The maximum gas allowed in the block.
gasUsed: The total gas used by all transactions in the block.
miner: The address of the miner who mined the block.
transactions: An array of transaction objects, including fields like transaction, blockHash, blockNumber, from, to, value, and gas.
The debug_getBadBlocks method is critical for monitoring and debugging the Ethereum network. By identifying invalid blocks, developers can analyze potential consensus issues and ensure the robustness of their node setups. If a debug_getBadBlocks error is encountered, ensure that the Ethereum client supports this method and is correctly configured. An included debug_getBadBlocks example demonstrates the proper usage of this method.
You can also make requests to the debug_getBadBlocks method programmatically using Python. Below is an example using the requests library:
This Python script sends a request to the debug_getBadBlocks method and prints the returned information. Replace <ACCESS-TOKEN> with your actual API token. The Web3 debug_getBadBlocks method can also be accessed via Web3 libraries for Ethereum, offering a convenient way to retrieve invalid block information programmatically.
The Ethereum debug_getBadBlocks method serves as a vital tool for identifying and analyzing invalid blocks in the Ethereum network. As part of the Core API Endpoints, this method provides transparency and insights necessary for maintaining network integrity and resolving consensus issues.
\
The debug_storageRangeAt method is part of the Ethereum JSON RPC Core API, used for debugging purposes. It allows developers to retrieve contract storage data within a specified range.
Remix uses debug_storageRangeAt to implement debugging. Use the Debuggertab in Remix instead of calling debug_storageRangeAt directly.Returns the contract storage for the specified range.
The debug_storageRangeAt method is part of the Ethereum JSON RPC Core API, designed for debugging purposes. This method allows developers to retrieve contract storage data within a specified range. While primarily used by tools like Remix, developers can call it directly to inspect and analyze on-chain storage data.
The debug_storageRangeAt RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_storageRangeAt method accepts the following parameters:
blockHash: (data) The block hash to fetch storage from.
txIndex: (integer) Transaction index within the block to start from.
address: (data) Contract address whose storage is to be retrieved.
startKey: (hash) The starting key for the storage range.
limit: (integer) Number of storage entries to return.
URL (API Endpoints) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_storageRangeAt method:
result: Contains the contract storage data for the specified range, or null if unavailable.
status_code: The HTTP status code for the request.
message: An explanatory message, e.g., "Method not allowed."
storage: An object containing key-value pairs of the storage.
hash: The hash value of the storage entry.
key: The storage key associated with the hash.
value: The storage value associated with the hash.
nextKey: The hash of the next key if additional storage entries are present within the range. Otherwise, not included.
The debug_storageRangeAt method is invaluable for debugging smart contracts by allowing developers to inspect storage within a specified range. This is particularly useful when analyzing contract behavior or diagnosing issues related to on-chain storage. If a debug_storageRangeAt error occurs, ensure that the parameters, such as blockHash and address, are correct. The provided debug_storageRangeAt example demonstrates how to construct a proper request.
You can make requests to the debug_storageRangeAt method programmatically using Python. Below is an example using the requests library:
This script sends a request to the debug_storageRangeAt method and prints the result. Replace <ACCESS-TOKEN> with your actual API token. The Web3 debug_storageRangeAt method can also be used through Web3 libraries for Ethereum.
The Ethereum debug_storageRangeAt method provides structured insights into contract storage. As part of the Core API Endpoints, it ensures developers have access to essential debugging tools. Each storage entry includes its key, value, and optional nextKey for further exploration. By supporting detailed storage data retrieval, this method integrates seamlessly with Ethereum's JSON RPC API for advanced debugging capabilities.
\
The debug_traceBlock method is part of the Ethereum JSON RPC Core API, designed for advanced debugging.
Returns full trace of all invoked opcodes of all transactions includedin the block.
The debug_traceBlock method is part of the Ethereum JSON RPC Core API and is designed for advanced debugging purposes. This method provides a full trace of all invoked opcodes of all transactions included in the specified block. It is particularly useful for developers analyzing the low-level execution of Ethereum transactions within a block.
The debug_traceBlock RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_traceBlock method accepts the following parameters:
Block: (data) The RLP-encoded representation of the block to be traced.
Object: (None) Request options. These are optional and default to false.
URL (API Endpoint) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_traceBlock method:
result: null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
If successful, the method provides a detailed trace of all transactions in the block, including the following information:
block: The block details, including its hash and transactions.
transaction: A detailed trace of each transaction in the block.
parameters: Opcode-level execution details and associated data.
value: The values used or modified during the transaction execution.
The debug_traceBlock method is valuable for developers who need to debug Ethereum transactions at the opcode level. This includes analyzing gas consumption, investigating failed transactions, and diagnosing issues in smart contract execution. If a debug_traceBlock error occurs, ensure the provided Block data is correct and that your node supports this method. The provided debug_traceBlock example demonstrates how to construct a proper request.
Here is an example of how to call the debug_traceBlock method programmatically using Python:
This Python script demonstrates how to interact with the debug_traceBlock method programmatically. Replace <ACCESS-TOKEN> with your actual API key. The Web3 debug_traceBlock method can also be used through Web3 libraries for Ethereum.
\
The debug_traceBlockByHash method is part of the Ethereum JSON RPC Core API, designed for advanced debugging.
Returns full trace of all invoked opcodes of all transactions includedin the block.
The debug_traceBlockByHash method is part of the Ethereum JSON RPC Core API and is intended for advanced debugging purposes. This method provides a full trace of all invoked opcodes of all transactions included in a specified block by its hash. It is particularly useful for developers analyzing low-level transaction execution details within a block.
The debug_traceBlockByHash RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_traceBlockByHash method accepts the following parameters:
Block hash: (data) The hash of the block to be traced.
Object: (None) Request options. These are optional and default to false.
URL (API Endpoints) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_traceBlockByHash method:
result: null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
If successful, the method provides a detailed trace of all transactions in the block, including:
block: The block details, including its hash and transactions.
transaction: A detailed trace of each transaction in the block.
parameters: Opcode-level execution details and associated data.
value: The values used or modified during the transaction execution.
The debug_traceBlockByHash method is valuable for developers needing detailed debugging of Ethereum transactions at the opcode level. This includes analyzing gas consumption, investigating failed transactions, and diagnosing issues in smart contract execution. If a debug_traceBlockByHash error occurs, ensure the provided block hash is correct and that your node supports this method. The provided debug_traceBlockByHash example demonstrates how to construct a proper request. The Web3 debug_traceBlockByHash method can also be used through Web3 libraries for Ethereum, supporting complex debugging scenarios and transaction analysis.
Here is an example of how to call the debug_traceBlockByHash method programmatically using Python:
This Python script demonstrates how to interact with the debug_traceBlockByHash method programmatically. Replace <ACCESS-TOKEN> with your actual API key.
\
The debug_traceBlockByNumber method is part of the Ethereum JSON RPC Core API and is used for advanced debugging. This method provides a full trace of all invoked opcodes for all transactions.
Returns full trace of all invoked opcodes of all transactions includedin the block.
The debug_traceBlockByNumber method is part of the Ethereum JSON RPC Core API and is designed for advanced debugging purposes. This method provides a full trace of all invoked opcodes of all transactions included in a specified block by its number. It is particularly valuable for developers seeking detailed insights into transaction execution at the opcode level.
The debug_traceBlockByNumber RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_traceBlockByNumber method accepts the following parameters:
quantity|tag: (None) Integer representing a block number or one of the string tags latest, earliest, or pending as described in Block Parameter.
Object: (Object) Request options, all of which are optional and default to false.
URL (API Endpoint) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_traceBlockByNumber method:
result: null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
If successful, the method provides a detailed trace of all transactions in the block, including:
block: The block details, including its number and transactions.
transaction: A detailed trace of each transaction in the block.
parameters: Opcode-level execution details and associated data.
value: The values used or modified during the transaction execution.
The debug_traceBlockByNumber method is critical for developers needing detailed debugging of Ethereum transactions at the opcode level. It aids in analyzing gas consumption, investigating failed transactions, and diagnosing issues in smart contract execution. If a debug_traceBlockByNumber error occurs, ensure the provided block number or tag is correct and that your node supports this method. The provided debug_traceBlockByNumber example demonstrates how to construct a proper request.
Here is an example of how to call the debug_traceBlockByNumber method programmatically using Python:
This Python script demonstrates how to interact with the debug_traceBlockByNumber method programmatically. Replace <ACCESS-TOKEN> with your actual API key. The Web3 debug_traceBlockByNumber method can also be used through Web3 libraries for Ethereum, enabling opcode-level transaction analysis and facilitating advanced debugging scenarios for Ethereum smart contracts and transactions.
\
The debug_traceCall method is part of the Ethereum JSON RPC Core API and is used for advanced debugging. This method returns a transaction trace.
The debug_traceCall method is part of the Ethereum JSON RPC Core API and is designed for advanced debugging purposes
This method returns a transaction trace object, providing detailed insights into the transaction execution process. Developers can use this method to debug specific transaction calls in the context of a specified block.
The debug_traceCall RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_traceCall method accepts the following parameters:
Object: (None) The transaction call object, specifying details such as the recipient address and value.
DATA: (None) The block number in hex format, tags (latest, earliest, pending), or the block hash.
DATA: (None) The type of tracer, such as callTracer or other supported tracer types.
URL (API Endpoint) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_traceCall method:
result: null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
If successful, the method provides a detailed trace of the transaction call, including:
block: The block details where the transaction is executed.
transaction: The transaction trace object, containing opcode-level execution details.
parameters: Detailed information about the transaction’s inputs and outputs.
value: The value transferred or modified during the transaction execution.
The debug_traceCall method is an essential tool for developers requiring granular debugging of Ethereum transactions. It is particularly useful for analyzing contract interactions, identifying gas inefficiencies, and diagnosing transaction failures. If a debug_traceCall error occurs, ensure the provided transaction object, block number, or hash is correct. The debug_traceCall example demonstrates how to construct a valid request.
Here is an example of how to call the debug_traceCall method programmatically using Python:
This Python script demonstrates how to interact with the debug_traceCall method programmatically. Replace <ACCESS-TOKEN> with your actual API key. The Web3 debug_traceCall method is also accessible through Web3 libraries for Ethereum, enabling seamless debugging workflows for decentralized application development.
\
This method reruns a specific transaction with the same state as when it was originally executed. By doing so, developers can trace the transaction’s execution step by step to understand its behavior.
Remix uses debug_traceTransaction to implement debugging. Use theDebugger tab in Remix instead of calling debug_traceTransactiondirectly.Reruns the transaction with the same state as when the transactionexecuted.
The debug_traceTransaction method is part of the Ethereum JSON RPC Core API and is designed for advanced debugging purposes. This method reruns a specific transaction with the exact same state as when it was initially executed, allowing developers to trace the transaction for debugging purposes. It is commonly used by tools like Remix in the Debugger tab.
The debug_traceTransaction RPC Ethereum method supports all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The debug_traceTransaction method accepts the following parameters:
transactionHash: (data) The hash of the transaction to be traced.
Object: (None) Request options, all of which are optional and default to false.
URL (API Endpoint) https://go.getblock.io/<ACCESS-TOKEN>/
To make a request, send a JSON object with the jsonrpc, method, and params fields. Below is an example of how to make a request using curl:
The server responds with a JSON object. Below is an example response for the debug_traceTransaction method:
result: null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
If successful, the method provides a detailed trace of the specified transaction, including:
block: The block containing the transaction.
transaction: The transaction details and its execution trace.
parameters: The execution context and associated data.
value: The values used or modified during transaction execution.
The debug_traceTransaction method is critical for developers needing to analyze the execution of a specific transaction. It provides insights into opcode-level execution, gas usage, and potential failure points in smart contracts. This method is highly useful for debugging failed transactions and investigating unexpected behavior. If a debug_traceTransaction error occurs, ensure the provided transaction hash is valid and that the node supports this method. The provided debug_traceTransaction example demonstrates how to construct a proper request.
Here is an example of how to call the debug_traceTransaction method programmatically using Python:
This Python script demonstrates how to interact with the debug_traceTransaction method programmatically. Replace <ACCESS-TOKEN> with your actual API key. The Web3 debug_traceTransaction method can also be used through Web3 libraries for Ethereum.
The eth_getBlockReceipts method is part of the Ethereum JSON RPC Core API and is used to retrieve all transaction receipts for a given block. A transaction receipt contains essential information.
Returns all transaction receipts for a given block.
The eth_getBlockReceipts method is part of the Ethereum JSON RPC Core API and is designed for retrieving transaction receipts from a specified block. This method provides all transaction receipts within a single block, enabling developers to analyze transaction outcomes in bulk.
The eth_getBlockReceipts RPC Ethereum method is available across all Ethereum network types, including:
Mainnet
Testnets: Sepolia, Holesky
The eth_getBlockReceipts method accepts the following parameter:
DATA, 32 Bytes: (None) The block number in hexadecimal format or one of the string tags (latest, earliest, or pending).
URL (API Endpoints) https://go.getblock.io/<ACCESS-TOKEN>/
To use this method, send a JSON object containing the jsonrpc, method, and params fields. Below is an example using curl:
The server responds with a JSON object. Below is an example response for the eth_getBlockReceipts method:
result: The transaction receipts of the specified block. null if the method is not allowed or unavailable.
status_code: The HTTP status code for the request.
message: A descriptive message explaining the response, e.g., "Method not allowed."
When successful, the eth_getBlockReceipts method returns all transaction receipts for a given block. Each transaction receipt includes details such as:
transaction: The transaction hash and execution results.
block: The block containing the transaction.
parameters: Metadata and execution parameters associated with the receipts.
value: The value transferred in transactions, encoded as hexadecimal.
The eth_getBlockReceipts method is particularly useful for developers analyzing multiple transaction outcomes in a specific block. By retrieving all receipts in bulk, this method enables efficient debugging and transaction auditing. If a eth_getBlockReceipts error occurs, ensure the block number or tag provided is valid and that the node supports this method. Refer to the eth_getBlockReceipts example for constructing a correct request.
Below is an example of how to call the eth_getBlockReceipts method programmatically using Python:
This Python script demonstrates how to interact with the eth_getBlockReceipts method programmatically. Replace <ACCESS-TOKEN> with your actual API key. The Web3 eth_getBlockReceipts method can also be utilized via Web3 libraries for Ethereum.