RPC Endpoints

Ethereum-compatible RPC endpoints

You can use any Ethereum library and tool with the IoTeX blockchain by simply pointing them to an IoTeX Gateway node.

Below, you find a list of official and third-party IoTeX gateways that provide an Ethereum-RPC endpoint, that you can use to configure any Ethereum wallet or developer tool to interact with the IoTeX blockchain:

Checkout the "Run as a Gateway" section of the iotex full-node documentation to learn how to run a full node as a network RPC endpoint.

Mainnet [Chain ID 4689]

EndpointTypeProviderMore

https://babel-api.mainnet.iotex.io

HTTP

IoTeX Foundation

wss://babel-api.mainnet.iotex.io/ws

WSS

IoTeX Foundation

https://babel-api.mainnet.iotex.one

HTTP

IoTeX Foundation

https://babel-api.fastblocks.io

HTTP

IoTeX Foundation

https://iotexrpc.com

HTTP

Ankr

https://rpc.ankr.com/iotex

HTTP

Ankr

HTTP

Thirdweb

Testnet [Chain ID 4690]

EndpointTypeTextMore

https://babel-api.testnet.iotex.io

HTTP

IoTeX Foundation

wss://babel-api.testnet.iotex.io/ws

WSS

IoTeX Foundation

https://babel-api.testnet.iotex.one

HTTP

IoTeX Foundation

https://babel-api.testnet.iotex.one/wss

WSS

IoTeX Foundation

Example

To get the balance of the IoTeX address ukzv5m6xnsg3gzaec3shew8nw03cch2x53d6v6 you first convert it into the Ethereum address format using ioctl:

$ ioctl account ethaddr io1ukzv5m6xnsg3gzaec3shew8nw03cch2x53d6v6
io1ukzv5m6xnsg3gzaec3shew8nw03cch2x53d6v6 - 0xE584ca6F469c11140Bb9c4617Cb8f373E38C5D46

which gives you the following Ethereum address:0xE584ca6F469c11140Bb9c4617Cb8f373E38C5D46.

Then you can query the Babel endpoint according to the Ethereum JSON RPC API:

ยป curl -X POST -H "Content-Type:application/json" --data '{"id": 1, "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xE584ca6F469c11140Bb9c4617Cb8f373E38C5D46", ""]}' https://babel-api.mainnet.iotex.io
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x10f0cf064dd59200000"
}

Which returns the balance 0x10f0cf064dd59200000 (hex) for the address, expressed in Rau units (i.e. 5000000000000000000000 Rau, equivalent to 5000 IOTX).

Check out the official Ethereum JSON-RPC API Documentation at:

Chain ID

The chainID chain identifier was introduced by Ethereum in EIP-155 to prevent replay attacks between Ethereum-compatible chains, it is a way to tell chains apart, where Ethereum was assigned a chainID of 1.

In respect of this EIP, IoTeX chainIDs have been picked as follows:

NetworkchainID

IoTeX Mainnet

4689

IoTeX Testnet

4690

Supported API calls

Below is the list of the currently supported APIs:

Additional API methods support can be requested by posting an issue in the GitHub repository below:

Last updated