Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

JSON-RPC

Evolve provides a full Ethereum-compatible JSON-RPC 2.0 API.

Endpoint

Default: http://localhost:8545

Supported Methods

eth_ Namespace

MethodDescription
eth_chainIdReturns the chain ID
eth_blockNumberReturns current block number
eth_getBlockByNumberGet block by number
eth_getBlockByHashGet block by hash
eth_getTransactionByHashGet transaction by hash
eth_getTransactionReceiptGet transaction receipt
eth_sendRawTransactionSubmit signed transaction
eth_callCall contract (read-only)
eth_estimateGasEstimate gas for transaction
eth_getBalanceGet account balance
eth_getTransactionCountGet account nonce
eth_getCodeGet contract code
eth_getStorageAtGet storage value
eth_gasPriceGet current gas price
eth_feeHistoryGet fee history
eth_getLogsGet event logs

net_ Namespace

MethodDescription
net_versionNetwork version
net_listeningIs node listening
net_peerCountNumber of peers

web3_ Namespace

MethodDescription
web3_clientVersionClient version string
web3_sha3Keccak-256 hash

Examples

Get Block Number

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": "0x64"
}

Get Balance

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

Send Transaction

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

Call Contract

curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
      "to": "0x...",
      "data": "0x..."
    }, "latest"],
    "id": 1
  }'

WebSocket Subscriptions

Connect to ws://localhost:8545 for real-time updates.

Subscribe to New Blocks

const ws = new WebSocket('ws://localhost:8545');
 
ws.send(JSON.stringify({
  jsonrpc: '2.0',
  method: 'eth_subscribe',
  params: ['newHeads'],
  id: 1
}));
 
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('New block:', data.params.result);
};

Subscribe to Logs

ws.send(JSON.stringify({
  jsonrpc: '2.0',
  method: 'eth_subscribe',
  params: ['logs', {
    address: '0x...',
    topics: ['0x...']
  }],
  id: 2
}));

Configuration

rpc:
  enabled: true
  http_addr: "127.0.0.1:8545"
  ws_addr: "127.0.0.1:8546"
  client_version: "evolve/0.1.0"
  max_connections: 100
  request_timeout_secs: 30

Error Codes

CodeMessage
-32700Parse error
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error
-32000Server error