GateChain’s EVM (Ethereum Virtual Machine) is designed to maintain high compatibility with Ethereum, enabling developers to leverage familiar tools, workflows, and APIs. One of the core components of this compatibility is the JSON-RPC server, which allows clients to interact with the GateChain blockchain by sending standardized JSON-RPC requests. This guide explores the supported JSON-RPC methods, their parameters, return values, and practical usage examples—providing a comprehensive reference for developers building on or integrating with GateChain.
Whether you're retrieving account balances, estimating gas costs, or querying transaction receipts, understanding these endpoints is essential for efficient blockchain interaction. Below, we detail each implemented method in a clear, structured format to enhance readability and usability.
Core JSON-RPC Methods Overview
The following table summarizes the JSON-RPC methods currently supported by GateChain, grouped by namespace. All listed methods are fully implemented and function as specified in the Ethereum JSON-RPC standard.
| Method | Namespace | Implemented | Description |
|---|---|---|---|
web3_clientVersion | Web3 | ✔ | Returns client version |
web3_sha3 | Web3 | ✔ | Computes Keccak-256 hash |
net_version | Net | ✔ | Retrieves network ID |
eth_protocolVersion | Eth | ✔ | Returns protocol version |
eth_syncing | Eth | ✔ | Checks synchronization status |
eth_gasPrice | Eth | ✔ | Gets current gas price |
eth_accounts | Eth | ✔ | Lists available accounts |
eth_blockNumber | Eth | ✔ | Returns latest block number |
eth_getBalance | Eth | ✔ | Fetches account balance |
eth_getStorageAt | Eth | ✔ | Reads contract storage |
eth_getTransactionCount | Eth | ✔ | Gets transaction count (nonce) |
eth_getBlockTransactionCountByNumber | Eth | ✔ | Counts transactions in a block (by number) |
eth_getBlockTransactionCountByHash | Eth | ✔ | Counts transactions in a block (by hash) |
eth_getCode | Eth | ✔ | Retrieves contract bytecode |
eth_sign | Eth | ✔ | Signs data with account key |
eth_sendTransaction | Eth | ✔ | Sends a signed transaction |
eth_sendRawTransaction | Eth | ✔ | Broadcasts raw signed transaction |
eth_call | Eth | ✔ | Executes call without mining |
eth_estimateGas | Eth | ✔ | Estimates gas needed for execution |
👉 Discover how blockchain APIs power decentralized applications today
Detailed Method Reference
web3_clientVersion
Returns the current client version string.
Parameters
None
Returns
String– Client version identifier (e.g.,gate enhanced-1.0.5-135-gf00ae80)
Example Request
curl -X POST --data '{
"jsonrpc":"2.0",
"method":"web3_clientVersion",
"params":[],
"id":67
}' localhost:8545Example Response
{
"jsonrpc":"2.0",
"id":67,
"result":"gate enhanced-1.0.5-135-gf00ae80"
}web3_sha3
Computes the Keccak-256 hash of the given data. Note: This is not standard SHA3-256 but the pre-Ethereum-standard Keccak variant.
Parameters
DATA– Input data to hash (hex format)
Returns
DATA– 32-byte Keccak-256 hash
Example
{
"method":"web3_sha3",
"params":["0x68656c6c6f20776f726c64"]
}Result: 0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad
net_version
Retrieves the current network ID.
Returns
"86"– Mainnet
Example
{
"method":"net_version",
"params":[]
}Response: "86"
eth_protocolVersion
Returns the current Ethereum protocol version.
Returns
String– Hex-encoded protocol version (e.g.,"0x41")
eth_syncing
Checks if the node is currently syncing with the network.
Returns
BooleanorObject:falseif not syncingObject with:
startingBlockcurrentBlockhighestBlock
Example Syncing Response
{
"currentBlock":106699
}eth_gasPrice
Returns the current recommended gas price in wei.
Returns
QUANTITY– Integer representing gas price in wei
Example
Response: "0x09184e72a000" (10,000,000,000,000 wei)
eth_accounts
Lists all accounts controlled by the client.
Returns
Array<DATA>– List of 20-byte Ethereum addresses
Example
[
"0xd9a549bcca822b696718802ec4aad4e1acc24367",
"0xcfe9c51a8039e74b0cce28642be0504fc898094a"
]eth_blockNumber
Returns the number of the most recent block.
Returns
QUANTITY– Latest block number
👉 Learn how real-time blockchain data fuels smart development workflows
eth_getBalance
Queries the balance of a given address.
Parameters
address: DATA (20 bytes)block:"latest"|"earliest"|"pending"| QUANTITY
Returns
QUANTITY– Balance in wei
Example
{
"method":"eth_getBalance",
"params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"]
}eth_getStorageAt
Reads a specific position in a contract's storage.
Parameters
address: Contract addressposition: Storage slot indexblock: Block identifier
Useful for debugging and reading internal contract state directly.
For mappings, compute slot via:
keccak(key || padded_position)Advanced Transaction and Block Queries
Methods like eth_getTransactionCount, getBlockByHash, and getTransactionReceipt enable precise inspection of account activity and blockchain state.
Key Use Cases:
- Tracking nonce for transaction sequencing
- Validating mined transactions
- Auditing smart contract interactions via logs
These are foundational for wallet backends, explorers, and analytics platforms.
Execution & Simulation Tools
eth_call
Executes a message call locally without broadcasting or altering blockchain state. Ideal for reading contract outputs (e.g., balanceOf, view functions).
eth_estimateGas
Estimates gas required to execute a transaction. Helps prevent out-of-gas errors during deployment or interaction.
⚠️ Note: Actual gas usage may differ due to network conditions and EVM behavior.
Transaction Lifecycle Management
Sending Transactions
Use either:
eth_sendTransaction: For locally signed transactions (requires unlocked account)eth_sendRawTransaction: For externally signed raw transactions (recommended for security)
Both return a transaction hash upon acceptance.
Retrieving Results
After sending:
- Use
eth_getTransactionByHashto confirm inclusion. Use
eth_getTransactionReceiptonce mined to get:- Status (
0x1= success) - Gas used
- Contract address (if created)
- Event logs
- Status (
Frequently Asked Questions (FAQ)
Q: Is GateChain fully compatible with Ethereum JSON-RPC?
A: Yes, GateChain supports all major Ethereum JSON-RPC methods required for dApp development, ensuring seamless integration with existing tooling like Web3.js and Ethers.js.
Q: Can I use MetaMask with GateChain?
A: Yes, you can configure MetaMask to connect to GateChain by adding a custom RPC network using the appropriate endpoint and chain ID (86).
Q: How do I sign transactions securely?
A: Avoid using eth_sign on production nodes. Instead, sign transactions offline using libraries like Ethers.js or hardware wallets, then broadcast via eth_sendRawTransaction.
Q: Why does eth_estimateGas return higher values than actual usage?
A: The estimator simulates worst-case scenarios. Factors like node state and gas metering variations can lead to overestimation. Always include a small buffer when setting gas limits.
Q: What is the difference between eth_call and eth_sendTransaction?
A: eth_call reads data without creating a transaction; it's free and instantaneous. eth_sendTransaction writes data to the blockchain, costs gas, and requires mining.
Q: How can I monitor contract events?
A: Parse logs from eth_getTransactionReceipt or use filter-based polling (if supported). Logs contain indexed event data emitted during contract execution.
Final Thoughts
Understanding and effectively using JSON-RPC methods is crucial for any developer working with EVM-compatible blockchains like GateChain. From querying balances to deploying contracts, these interfaces form the backbone of blockchain interaction.
As decentralized systems evolve, mastering low-level APIs ensures robustness, security, and flexibility in your applications.
👉 Access powerful blockchain tools to streamline your development process