⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

system_chain

Description

Reports the human-readable name of the chain the node is serving. Use this to confirm you are connected to Astar mainnet versus Shiden or Shibuya before broadcasting extrinsics.

Parameters

This method does not require any parameters.

Returns

TypeDescription
stringChain name (for example Astar, Shiden, or Shibuya)

Request Example

{
"jsonrpc": "2.0",
"method": "system_chain",
"params": [],
"id": 1
}

Response Example

{
"jsonrpc": "2.0",
"result": "Astar",
"id": 1
}

Code Examples

cURL

curl https://api-astar.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system_chain",
"params": [],
"id": 1
}'

JavaScript (polkadot.js)

import { ApiPromise, WsProvider } from '@polkadot/api';

const api = await ApiPromise.create({
provider: new WsProvider('wss://api-astar.n.dwellir.com/YOUR_API_KEY')
});
const chain = await api.rpc.system.chain();
console.log('Connected to', chain.toString());

Python (requests)

import requests
import json

resp = requests.post(
"https://api-astar.n.dwellir.com/YOUR_API_KEY",
headers={"Content-Type": "application/json"},
data=json.dumps({
"jsonrpc": "2.0",
"method": "system_chain",
"params": [],
"id": 1
})
)
print(resp.json()["result"])