Skip to main content

Ronin RPC

Overview

The Ronin RPC (remote procedure call) services are built to power any web3 application on Ronin that needs a reliable source of blockchain data. Using the RPC services, developers don't have to set up and maintain their own Ronin nodes to interact with the blockchain.

info

API reference: Ronin JSON-RPC API

RPC endpoints

Public RPC endpoints

Public RPC endpoints provide universal access to the blockchain via straightforward URLs, no authentication needed. This open-door approach ensures that anyone can start interacting with Ronin’s blockchain effortlessly.

NameEndpoint
Luganodeshttps://ronin.lgns.net/rpc
Ronin mainnethttps://api.roninchain.com/rpc
Saigon testnethttps://saigon-testnet.roninchain.com/rpc

Private RPC endpoints

Opt for our private RPC endpoints for enhanced control and scalability, maintained by dedicated node providers. These nodes come in various service tiers, from complimentary basic access to premium levels offering higher request limits and advanced features.

Sky Mavis's endpoints

NodeEndpointRate limit
Mainnet RPChttps://api-gateway.skymavis.com/rpc100 requests per second; 140,000 requests per day
Testnet RPChttps://api-gateway.skymavis.com/rpc/testnet100 requests per second; 140,000 requests per day
Mainnet archive RPChttps://api-gateway.skymavis.com/rpc/archive100 requests per second; 140,000 requests per day
Testnet archive RPChttps://api-gateway.skymavis.com/rpc/testnet-archive100 requests per second; 140,000 requests per day
RPC over WebSocketwss://api-gateway.skymavis.com/rpc/socket10 requests per second; 100 requests per day

Using the API with Web3.js and ethers.js

Web3.js example

Web3.js
const options = {
headers: [
{ name: 'x-api-key', value: 'xxxxxx' },
],
};

const web3Provider = new Web3.providers.HttpProvider('https://api-gateway.skymavis.com/rpc', options);
const web3 = new Web3(web3Provider);

console.log('Latest block number:', await web3.eth.getBlockNumber());

Ethers.js example

Ethers.js
const connection = {
url: 'https://api-gateway.skymavis.com/rpc',
headers: {
'x-api-key': 'xxxxx'
}
};

const provider = new ethers.providers.JsonRpcProvider(connection);

console.log('Latest block number:', await provider.getBlockNumber());

Adding API key in request header

For simpler scenarios, you can include your API key directly in the query string:

Web3.js
const apiKey = 'YOUR_API_KEY';
const web3Provider = new Web3.providers.HttpProvider('https://api-gateway.skymavis.com/rpc?apikey=' + apiKey);
Ethers.js
const apiKey = 'YOUR_API_KEY';
const provider = new ethers.providers.JsonRpcProvider('https://api-gateway.skymavis.com/rpc?apikey=' + apiKey);
cURL
curl --location --request POST 'https://api-gateway.skymavis.com/rpc?apikey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [
],
"id": 1
}'

See also

JSON-RPC API reference