Node Info
Get Arkhia's mirror node info
info
To configure your web3Provider, please refer to the Getting Started Docs:
net_version
Returns the current chain id.
Parameters
None
Returns
Hex string or Integer: Current chain id
- Web3.js
- Node.js (Axios)
- Curl
web3Provider.eth.getChainId() .then((res) => console.log(`-> get node version`, res)) .catch(e => console.log('-> get node version: ' + e));
import axios from 'axios';const data = JSON.stringify({ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 0});const config = { method: 'post', url: '<JSON_RPC_URL>/<YOUR_API_KEY>', headers: { 'Content-Type': 'application/json'}, data : data};async function main() { await axios(config) .then(function (response) { console.log(response.data)); }); .catch(function (error) { console.log(error); });}
curl --location --request POST '<JSON_RPC_URL>/<YOUR_API_KEY>' \--header 'Content-Type: application/json' \--data-raw '{ "jsonrpc": "2.0", "method": "net_version", "params":[], "id": 0}'
web3_clientVersion
Returns the current mirror node client version
Parameters
None
Returns
String: Current client version
- Web3.js
- Node.js (Axios)
- Curl
web3Provider.eth.getNodeInfo() .then((res) => console.log(`-> get is node listening`, res)) .catch(e => console.log('-> get is node listening: ' + e));
import axios from 'axios';const data = JSON.stringify({ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 0});const config = { method: 'post', url: '<JSON_RPC_URL>/<YOUR_API_KEY>', headers: { 'Content-Type': 'application/json'}, data : data};async function main() { await axios(config) .then(function (response) { console.log(response.data)); }); .catch(function (error) { console.log(error); });}
curl --location --request POST '<JSON_RPC_URL>/<YOUR_API_KEY>' \--header 'Content-Type: application/json' \--data-raw '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params":[], "id": 0}'