Skip to main content

Get Node Health

Checking a node's health status gives you valuable information about the reliability and stability of the node, which can be crucial for various reasons. By monitoring a node's health status, you can ensure the node is functioning properly, maintaining a consistent connection to the network, and actively participating in validating transactions. You can use this information to make informed decisions about which nodes to trust for reliable data, assess network performance, and ensure the integrityAssurance that the data stored in the ledger has not been tampered with or altered in any unauthorized way. of their interactions within the network.

Client in Wallet

If you are using a wallet you can always get the client by calling the client()/getClient()/get_client() method

Example Code

  1. Create a Client that will connect to the node defined in your .env file's NODE_URL variable.
sdk/examples/how_tos/client/get_health.rs
loading...
  1. Use the created client to get the health of the specified url using the Client.get_health() function.
sdk/examples/how_tos/client/get_health.rs
loading...

Full Example Code

sdk/examples/how_tos/client/get_health.rs
loading...

Expected Output

Healthy: true