server_info - XRPL
Example code for the server_info JSON RPC method. Complete guide to using server_info JSON-RPC in the GetBlock Web3 documentation.
Parameters
Request Example
curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "server_info",
"params": [{}],
"id": "getblock.io"
}'const axios = require('axios');
const url = 'https://xrp.getblock.io/mainnet/';
const headers = {
'x-api-key': 'YOUR-API-KEY',
'Content-Type': 'application/json'
};
const payload = {
jsonrpc: '2.0',
method: 'server_info',
params: [{}],
id: 'getblock.io'
};
axios.post(url, payload, { headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
{
"result": {
"info": {
"build_version": "1.9.4",
"complete_ledgers": "32570-63632030",
"load_factor": 1,
"peers": 21,
"server_state": "full",
"time": "2024-Jan-15 12:00:00.000000 UTC",
"uptime": 1234567,
"validated_ledger": {
"base_fee_xrp": 0.00001,
"hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
"reserve_base_xrp": 10,
"reserve_inc_xrp": 2,
"seq": 63632030
}
},
"status": "success"
}
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
Error Code
Description
SDK Integration
Last updated
Was this helpful?