Skip to main content
ALL CHAINS

Testing & Testnet

Elastos has public testnets for all three chains — main chain, ESC, and EID. Use them to validate transactions, smart contracts, and DID operations before deploying to mainnet. This page covers testnet configuration, faucets, local nodes, and integration tests for each chain.

Hardhat Testnet Configuration

// hardhat.config.ts
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const config: HardhatUserConfig = {
solidity: "0.8.20",
networks: {
escTestnet: {
url: "https://api-testnet.elastos.io/esc",
chainId: 21,
accounts: [process.env.TESTNET_PRIVATE_KEY!],
},
escMainnet: {
url: "https://api.elastos.io/esc",
chainId: 20,
accounts: [process.env.MAINNET_PRIVATE_KEY!],
gasPrice: 1000000000,
},
},
};

export default config;

Testnet Configuration

Main Chain Testnet:

const mainChainTestnet = {
rpcUrl: "https://api-testnet.elastos.io/ela",
defaultPort: 21336,
};

Faucets

To get testnet ELA:

Main Chain Testnet: Community Discord channels often have faucet bots.