Skip to main content

wallet/getnodeinfo

Real-Time Node Monitoring

Dwellir's TRON infrastructure provides instant node status with version info, sync state, and network connectivity. Monitor node health and configuration for optimal integration.

Access node information →

Retrieve detailed information about the connected TRON node including software version, network configuration, current block height, and peer connections.

Use Cases#

wallet/getnodeinfo is crucial for:

  • Health Monitoring - Check node status and sync state
  • Version Tracking - Verify node software version
  • Network Analysis - Monitor peer connections
  • Configuration Audit - Review node settings
  • Debugging - Troubleshoot connection issues

Parameters#

This method requires no parameters.

Request Example#

{}

Response Fields#

FieldTypeDescription
beginSyncNumnumberBlock number when sync started
blockstringCurrent block hash and height
solidityBlockstringLatest solidified block
currentConnectCountnumberCurrent peer connections
activeConnectCountnumberActive peer connections
passiveConnectCountnumberPassive peer connections
totalFlownumberTotal network traffic
peerListarrayConnected peer information
configNodeInfoobjectNode configuration details
machineInfoobjectHardware and OS information
cheatWitnessInfoMapobjectWitness validation info

Implementation Examples#

# Get node information
curl -X POST "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getnodeinfo" \
-H "Content-Type: application/json" \
-d '{}'

# Parse basic info with jq
curl -s -X POST "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getnodeinfo" \
-H "Content-Type: application/json" \
-d '{}' | jq '{
version: .configNodeInfo.codeVersion,
network: .configNodeInfo.network,
current_block: .block,
solidity_block: .solidityBlock,
peers: .currentConnectCount,
active_peers: .activeConnectCount
}'

# Get sync status
curl -s -X POST "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getnodeinfo" \
-H "Content-Type: application/json" \
-d '{}' | jq '{
current: (.block | split(",")[0] | split(":")[1] | tonumber),
solidity: (.solidityBlock | split(",")[0] | split(":")[1] | tonumber),
lag: ((.block | split(",")[0] | split(":")[1] | tonumber) -
(.solidityBlock | split(",")[0] | split(":")[1] | tonumber))
}'

# Monitor node status script
#!/bin/bash
API_KEY="YOUR_API_KEY"

while true; do
echo "=== TRON Node Status - $(date) ==="

response=$(curl -s -X POST \
"https://api-tron-mainnet.n.dwellir.com/$API_KEY/wallet/getnodeinfo" \
-H "Content-Type: application/json" \
-d '{}')

if [ $? -eq 0 ]; then
echo "✓ Node Online"
echo "$response" | jq -r '
"Version: " + .configNodeInfo.codeVersion,
"Network: " + .configNodeInfo.network,
"Peers: " + (.currentConnectCount | tostring),
"Block: " + .block
'
else
echo "✗ Node Offline"
fi

echo ""
sleep 30
done

# Extract peer information
curl -s -X POST "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getnodeinfo" \
-H "Content-Type: application/json" \
-d '{}' | jq '
{
peer_count: .peerList | length,
top_peers: [.peerList[] | {
host: .host,
port: .port,
version: .nodeInfo.codeVersion,
latency: .avgLatency
}] | sort_by(.latency) | .[0:5]
}'

Response Example#

{
"beginSyncNum": 58000000,
"block": "Num:58234567,ID:0000000003787ac74d9bb8f8c9c59ac3f3e3b9b8c9e3e8f9",
"solidityBlock": "Num:58234547,ID:0000000003787ab34d9bb8f8c9c59ac3f3e3b9b8c9e3e8f8",
"currentConnectCount": 30,
"activeConnectCount": 18,
"passiveConnectCount": 12,
"totalFlow": 1234567890,
"peerList": [
{
"host": "192.168.1.100",
"port": 18888,
"avgLatency": 45,
"blockInNum": 58234567,
"connectTime": 1702456789000,
"nodeInfo": {
"codeVersion": "4.7.2",
"p2pVersion": "1.0.0"
}
}
],
"configNodeInfo": {
"codeVersion": "4.7.2",
"versionName": "GreatVoyage-v4.7.2",
"versionNum": "17766",
"p2pVersion": "11111",
"listenPort": 18888,
"discoverEnable": true,
"activeNodeSize": 18,
"passiveNodeSize": 12,
"sendNodeSize": 30,
"maxConnectCount": 50,
"sameIpMaxConnectCount": 2,
"backupListenPort": 10001,
"backupMemberSize": 0,
"backupPriority": 8,
"dbVersion": 2,
"minParticipationRate": 15,
"supportConstant": true,
"minTimeRatio": 0.6,
"maxTimeRatio": 5.0,
"allowCreationOfContracts": 0,
"allowAdaptiveEnergy": 0
},
"machineInfo": {
"threadCount": 150,
"deadLockThreadCount": 0,
"cpuCount": 16,
"totalMemory": 34359738368,
"freeMemory": 12884901888,
"cpuRate": 0.35,
"javaVersion": "1.8.0_292",
"osName": "Linux",
"jvmTotalMemory": 8589934592,
"jvmFreeMemory": 4294967296,
"processCpuRate": 0.25,
"memoryDescInfo": "Total: 32GB, Free: 12GB, Usage: 62.5%",
"deadLockThreadInfoList": []
},
"cheatWitnessInfoMap": {}
}

Common Use Cases#

1. Health Check Endpoint#

async function healthCheck() {
try {
const info = await getNodeInfo();
const blockInfo = parseBlockString(info.block);
const solidityInfo = parseBlockString(info.solidityBlock);

const healthy =
info.currentConnectCount > 5 &&
(blockInfo.number - solidityInfo.number) < 100;

return {
status: healthy ? 'healthy' : 'degraded',
details: {
peers: info.currentConnectCount,
syncLag: blockInfo.number - solidityInfo.number,
version: info.configNodeInfo?.codeVersion
}
};
} catch (error) {
return {
status: 'unhealthy',
error: error.message
};
}
}

2. Version Compatibility Check#

async function checkCompatibility(requiredVersion) {
const info = await getNodeInfo();
const nodeVersion = info.configNodeInfo?.codeVersion || '0.0.0';

return {
compatible: compareVersions(nodeVersion, requiredVersion) >= 0,
nodeVersion,
requiredVersion
};
}

3. Network Statistics#

async function getNetworkStats() {
const info = await getNodeInfo();

// Analyze peer versions
const versionStats = {};
info.peerList?.forEach(peer => {
const version = peer.nodeInfo?.codeVersion || 'Unknown';
versionStats[version] = (versionStats[version] || 0) + 1;
});

return {
totalPeers: info.currentConnectCount,
activePeers: info.activeConnectCount,
passivePeers: info.passiveConnectCount,
versionDistribution: versionStats,
networkTraffic: formatBytes(info.totalFlow)
};
}

Best Practices#

  1. Cache Results - Node info can be cached for 30-60 seconds
  2. Monitor Regularly - Check node health every 1-5 minutes
  3. Alert Thresholds - Set alerts for low peers or high sync lag
  4. Version Tracking - Monitor node version for required updates
  5. Fallback Nodes - Have backup nodes ready if health degrades

Need help? Contact support or visit our TRON documentation.