Join our community of builders on Discord!

Testnet API & RPC Reference

The Lightchain AI Testnet exposes standard Ethereum JSON-RPC endpoints alongside Lightchain-specific extensions for AIVM and PoI interactions.

Endpoints

ProtocolURLUse Case
HTTPShttps://rpc.testnet.lightchain.aiStandard RPC calls
WSSwss://rpc.testnet.lightchain.aiSubscriptions & real-time
Archivehttps://archive.testnet.lightchain.aiHistorical state (eth_call, eth_getBalance at old blocks)
Beacon APIhttps://beacon.testnet.lightchain.aiConsensus layer (finality, validators, headers)

Rate Limits

The public endpoints publish no fixed rate limit and may be rate-limited during periods of high demand.

Supported JSON-RPC Methods

Standard Ethereum Methods

All standard Ethereum JSON-RPC methods are supported. Commonly used methods include: Querying State
MethodDescription
eth_blockNumberReturns the latest block number
eth_getBalanceReturns the balance of an address
eth_getTransactionByHashReturns transaction details by hash
eth_getTransactionReceiptReturns the receipt of a transaction
eth_getBlockByNumberReturns block details by number
eth_getBlockByHashReturns block details by hash
eth_getCodeReturns the bytecode at an address
eth_getStorageAtReturns storage at a position
eth_callExecutes a read-only call
eth_getLogsReturns logs matching a filter
Sending Transactions
MethodDescription
eth_sendRawTransactionSubmits a signed transaction
eth_estimateGasEstimates the gas for a transaction
eth_gasPriceReturns the current gas price
eth_getTransactionCountReturns the nonce for an address
Subscriptions (WebSocket)
MethodDescription
eth_subscribeSubscribe to events (newHeads, logs)
eth_unsubscribeUnsubscribe from an event stream

Lightchain-Specific Methods

Lightchain adds no custom JSON-RPC methods. The public testnet endpoint serves the debug, eth, net, rpc, txpool and web3 namespaces. AI inference does not go through JSON-RPC. It runs through the protocol contracts (JobRegistry and SessionManager) or through the Developer API. Model availability, fees and limits are read from AIConfig with ordinary eth_call.

Example Requests

Get Latest Block Number

CodeBASH
Response:
CodeJSON

Get Account Balance

CodeBASH

Subscribe to New Blocks (WebSocket)

CodeJAVASCRIPT

Error Codes

CodeMessageDescription
-32600Invalid RequestMalformed JSON-RPC request
-32601Method Not FoundThe method does not exist
-32602Invalid ParamsInvalid method parameters
-32603Internal ErrorServer-side processing error
-32000Server errorTransaction rejected; the message says why, for example nonce too low, transaction underpriced or insufficient funds for gas * price + value
-32700Parse ErrorInvalid JSON payload

Health Check

Verify that the RPC endpoint is responding:
CodeBASH
Expected result: "8200" (the chain ID as a string).

Resources


Last updated: 1 November 2026