Skip to main content

JSON-RPC — eth_ Namespace

QoreChain implements a fully EVM-compatible JSON-RPC interface, enabling standard Ethereum tooling (MetaMask, Hardhat, Foundry, ethers.js, web3.js) to interact with the chain without modification.

Connection

TransportDefault Address
HTTPhttp://localhost:8545
WebSocketws://localhost:8546
note

The EVM JSON-RPC interface is served by the qorechain-vladi mainnet (EVM chain ID 9801, hex 0x2649, live on chain version v3.1.85) and the qorechain-diana testnet (EVM chain ID 9800, hex 0x2648). The local addresses above apply to a node you run yourself; substitute your provider's mainnet or testnet endpoint for remote access.

Supported Namespaces

NamespaceDescription
eth_Core Ethereum JSON-RPC methods
web3_Utility methods (client version, hashing)
net_Network status methods
txpool_Transaction pool inspection
qor_QoreChain-specific extensions (see qor_ Namespace)

eth_ Methods

MethodParametersDescription
eth_blockNumbernoneReturns the latest block number
eth_getBalanceaddress, blockNumberReturns the balance of an address in wei
eth_getTransactionCountaddress, blockNumberReturns the nonce (transaction count) for an address
eth_sendRawTransactionsignedTxDataSubmits a signed transaction for broadcast
eth_callcallObject, blockNumberExecutes a read-only call against the EVM
eth_estimateGascallObjectEstimates the gas required for a transaction
eth_getBlockByNumberblockNumber, fullTx (bool)Returns block data by number
eth_getTransactionByHashtxHashReturns transaction data by hash
eth_getTransactionReceipttxHashReturns the receipt for a mined transaction
eth_getLogsfilterObjectReturns logs matching a filter
eth_chainIdnoneReturns the chain ID (hex-encoded)
eth_gasPricenoneReturns the current gas price in wei
eth_feeHistoryblockCount, newestBlock, rewardPercentilesReturns historical fee data (EIP-1559)

web3_ Methods

MethodParametersDescription
web3_clientVersionnoneReturns the client version string
web3_sha3data (hex)Returns the Keccak-256 hash of the input

net_ Methods

MethodParametersDescription
net_versionnoneReturns the network ID
net_listeningnoneReturns true if the node is listening
net_peerCountnoneReturns the number of connected peers (hex)

Configuration

Enable and configure the JSON-RPC server in app.toml:

[json-rpc]
# Enable the JSON-RPC server
enable = true

# HTTP server address
address = "0.0.0.0:8545"

# WebSocket server address
ws-address = "0.0.0.0:8546"

# Enabled API namespaces
api = "eth,web3,net,txpool,qor"

# Maximum number of logs returned by eth_getLogs
filter-cap = 10000

# Maximum gas for eth_call and eth_estimateGas
gas-cap = 25000000

# EVM execution timeout
evm-timeout = "5s"

# Transaction fee cap (in QOR)
txfee-cap = 1

# Maximum open WebSocket connections
max-open-connections = 0

Examples

eth_blockNumber

Request:

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

Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x53b35"
}

eth_chainId

Request:

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

Response (mainnet qorechain-vladi, chain ID 9801):

{
"jsonrpc": "2.0",
"id": 2,
"result": "0x2649"
}

On the qorechain-diana testnet (chain ID 9800) this method returns "0x2648".

eth_getBalance

Request:

curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28", "latest"],
"id": 3
}'

Response:

{
"jsonrpc": "2.0",
"id": 3,
"result": "0x56bc75e2d63100000"
}

Connecting with ethers.js

import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider("http://localhost:8545");

// Get latest block
const block = await provider.getBlockNumber();
console.log("Latest block:", block);

// Get balance
const balance = await provider.getBalance("0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28");
console.log("Balance:", ethers.formatEther(balance), "QOR");
info
  • Chain ID is returned as a hex string. Convert to decimal for wallet configuration — 0x2649 is 9801 (mainnet), 0x2648 is 9800 (testnet).
  • Gas pricing follows the EIP-1559 model. Use eth_feeHistory for base fee and priority fee estimation.
  • Block tags accepted: "latest", "earliest", "pending", or a hex block number.
  • Filter limitations: eth_getLogs is capped at filter-cap results per query (default 10,000). Use narrower block ranges for large datasets.