TRON Blockchain: How to Check the Number of Peers the Tron Node is Connected to?


How to Check the Number of Peers the Tron Node is Connected to?

To check the number of peers your Tron node is connected to, you can use either the Tron CLI command or the API. Here’s how you can do it using both methods:

Using Tron CLI: Open your terminal or command prompt and run the following command:

1
tron-cli peer
tron-cli peer

This command will display information about the peers your node is connected to, including their IP addresses and connection status. You can check the count of peers listed to determine the number of connections.

Using the API: You can also retrieve peer information programmatically by making an API call to your Tron node. Here’s an example of how to do it using cURL:

1
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"tron_getNodeInfo","params":[],"id":1}' http://YOUR_NODE_IP:PORT/wallet
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"tron_getNodeInfo","params":[],"id":1}' http://YOUR_NODE_IP:PORT/wallet

Replace YOUR_NODE_IP with the IP address of your Tron node and PORT with the corresponding API port. This API call will return detailed information about your node, including the number of connected peers.

By using either the CLI or API method, you can determine the number of peers your Tron node is connected to and verify that it is actively participating in the Tron network.

Tron Blockchain

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
808 words
Last Post: TRON Blockchain: How to Check If a Node is synchronized and Fully Functional?
Next Post: Azure Billing: How to Update the "Sold To" Address?

The Permanent URL is: TRON Blockchain: How to Check the Number of Peers the Tron Node is Connected to?

Leave a Reply