⚠️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 - JSON-RPC Method

Description

Returns the human-readable name of the Enjin Matrix network that the node is connected to. Use this method in smoke tests and connection validators to make sure your client is talking to Matrix mainnet or the correct canary network before sending transactions.

Parameters

This method does not require any parameters.

Returns

FieldTypeDescription
resultstringName of the connected chain

Request Example

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

Response Example

{
"jsonrpc": "2.0",
"result": "Enjin Matrixchain",
"id": 1
}

Code Examples

cURL

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

JavaScript (fetch)

const response = await fetch('https://api-enjin-matrixchain.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'system_chain',
params: [],
id: 1
})
});

const data = await response.json();
console.log(`Connected to: ${data.result}`);

Python (requests)

import json
import requests

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

response = requests.post(
"https://api-enjin-matrixchain.n.dwellir.com/YOUR_API_KEY",
headers={"Content-Type": "application/json"},
data=json.dumps(payload),
timeout=10,
)

chain_name = response.json()["result"]
print(f"Connected to: {chain_name}")

Use Cases

  • Safety checks – verify that production services are still pinned to Matrix mainnet after configuration changes.
  • Multi-network tooling – dynamically load type bundles or custom RPC definitions per chain name.
  • Monitoring – alert if a node begins reporting an unexpected chain identifier.