ZentChain RPC Endpoints
Connect to ZentChain nodes and interact with the blockchain through these RPC endpoints.
Mainnet RPC
HTTP Endpoint
https://rpc.zentchain.com
WebSocket Endpoint
wss://ws.zentchain.com
Chain ID
1450
Testnet RPC
HTTP Endpoint
https://rpc-testnet.zentchain.com
WebSocket Endpoint
wss://ws-testnet.zentchain.com
Chain ID
1451
Example Usage
With Web3.js
const Web3 = require('web3');
const web3 = new Web3('https://rpc.zentchain.com');
// Get latest block number
web3.eth.getBlockNumber().then(console.log);
With Ethers.js
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://rpc.zentchain.com');
// Get latest block number
async function getBlockNumber() {
const blockNumber = await provider.getBlockNumber();
console.log(blockNumber);
}
getBlockNumber();