ESC API
The Elastos Smart Chain (ESC) is a fully EVM-compatible blockchain. That means every Ethereum JSON-RPC method you already know — eth_call, eth_getBalance, eth_sendRawTransaction — works out of the box. Use your existing Ethereum tooling; just point it at an ESC endpoint.
Providers
For the complete list of ESC RPC endpoints (including Glide Finance and WebSocket), see Network Endpoints.
Default Elastos-hosted JSON-RPC bases for quick setup:
| Network | Provider | RPC URL | Chain ID |
|---|---|---|---|
| Mainnet | Elastos | https://api.elastos.io/esc | 20 |
| Testnet | Elastos | https://api-testnet.elastos.io/esc | 21 |
Use more than one RPC endpoint in production. If one provider goes down, your dApp can fail over to another without downtime.
Key Methods
These are the methods you'll use most often. The full Ethereum JSON-RPC spec applies.
| Method | Description |
|---|---|
eth_blockNumber | Latest block number. |
eth_getBalance | ELA balance for an address (in wei). |
eth_sendRawTransaction | Submit a signed transaction. |
eth_call | Execute a read-only contract call. |
eth_getTransactionReceipt | Get the receipt (status, logs, gas used) for a mined tx. |
eth_getLogs | Query event logs by address, topics, or block range. |
net_version | Returns the chain ID (20 for mainnet). |
Using with ethers.js
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider("https://api.elastos.io/esc");
const blockNumber = await provider.getBlockNumber();
console.log("Current block:", blockNumber);
const balance = await provider.getBalance("0xYourAddress");
console.log("Balance:", ethers.formatEther(balance), "ELA");
Using with web3.js
import Web3 from "web3";
const web3 = new Web3("https://api.elastos.io/esc");
const blockNumber = await web3.eth.getBlockNumber();
console.log("Current block:", blockNumber);
const balance = await web3.eth.getBalance("0xYourAddress");
console.log("Balance:", web3.utils.fromWei(balance, "ether"), "ELA");
On ESC, the native gas token is ELA (not ETH). Everything else — units, decimals (18), gas mechanics — behaves identically to Ethereum.
Block Explorer
| Network | Explorer URL |
|---|---|
| Mainnet | esc.elastos.io |
| Testnet | esc-testnet.elastos.io |
Both explorers are Blockscout instances — you can verify contracts, inspect transactions, and query token holders directly in the browser.
Faucet
Need testnet ELA? Grab some from the ESC testnet faucet:
Testnet ELA (tELA) is free and cannot be traded. Use it for development and testing only.
ESC CLI (geth)
ESC nodes run a modified geth client. You can interact with a local node using the geth CLI.
| Command | Purpose |
|---|---|
geth account | Manage local accounts. |
geth attach | Interactive JavaScript console attached to a running node. |
geth console | Start a node with the console. |
geth version | Print client version. |
| Flag | Purpose |
|---|---|
--rpc | Enable HTTP-RPC. |
--rpcport | HTTP-RPC port (default 20635). |
--ws | Enable WebSocket. |
--datadir | Data directory for chain state and keystore. |
--syncmode | Sync mode: fast, full, or light. |
See the Elastos.ELA.SideChain.ESC wiki for the full geth command reference.