> ## Documentation Index
> Fetch the complete documentation index at: https://docs.presschain.io/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON-RPC Reference

> Practical Ethereum-compatible RPC calls for PressChain V3 developers.

# JSON-RPC reference

PressChain V3 exposes an Ethereum-compatible JSON-RPC interface. Existing EVM tooling can perform network reads, contract calls, log queries and signed transaction submission when configured for the PressChain network.

Canonical public testnet endpoint:

```text theme={null}
https://rpc.presschain.io
```

Current Chain ID:

```text theme={null}
77117002
```

Hexadecimal Chain ID:

```text theme={null}
0x498B64A
```

## Request format

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_chainId",
  "params": []
}
```

Requests are sent with HTTP `POST` and `content-type: application/json`.

## Verify chain identity

```bash theme={null}
curl -s https://rpc.presschain.io \
  -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
```

A V3 testnet client should expect `0x498B64A`, allowing for case differences in hex output.

## Current block

```json theme={null}
{"jsonrpc":"2.0","id":2,"method":"eth_blockNumber","params":[]}
```

The result is a hexadecimal quantity. Convert with a bigint-capable parser when the value is used programmatically.

## Read a transaction receipt

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "eth_getTransactionReceipt",
  "params": ["0xTRANSACTION_HASH"]
}
```

A `null` result can mean the transaction is not yet included or is unknown to that node. That is different from a receipt whose `status` indicates execution failure.

## Read contract state

Use `eth_call` with encoded ABI data:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "eth_call",
  "params": [
    {"to":"0xCONTRACT","data":"0xENCODED_CALL"},
    "latest"
  ]
}
```

Use an ABI library rather than hand-encoding selectors unless you are building low-level tooling.

## Methods commonly used by applications

| Method                      | Typical use                 |
| --------------------------- | --------------------------- |
| `eth_chainId`               | verify the network          |
| `eth_blockNumber`           | observe chain height        |
| `eth_getBalance`            | inspect native balance      |
| `eth_call`                  | read a contract             |
| `eth_getLogs`               | index events                |
| `eth_getTransactionByHash`  | inspect a transaction       |
| `eth_getTransactionReceipt` | confirm execution           |
| `eth_getTransactionCount`   | inspect account nonce       |
| `eth_estimateGas`           | estimate a prepared call    |
| `eth_gasPrice`              | obtain gas pricing signal   |
| `eth_sendRawTransaction`    | submit a signed transaction |

## Observability

Log RPC method, duration, endpoint class and error code. Do not log private keys, seed phrases or sensitive signing material.

For submitted transactions, persist the transaction hash as soon as it is known. If a browser times out afterward, the hash gives the application a recovery path without creating a duplicate write.

## Scaling reads

RPC is excellent for authoritative reads and verification. High-volume search, sorting and aggregation belong in an indexer or projection layer.

A good PressChain application uses both: projections for product speed, RPC and contracts for authority.
