Skip to main content

Get Node Information

Obtaining a node's information allows you to gather important details about the node's current status and capabilities. By checking if a node is synced, you can ensure it has successfully synchronized with the network's latest state, providing accurate and up-to-date information.

Additionally, knowing which features are enabled on a node helps you understand its functionalities and capabilities, allowing you to make informed decisions on interacting with the node and utilizing its specific features.

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_info.rs
loading...
  1. Use the created client to get the information of the specified url using the Client.get_info() function.
sdk/examples/how_tos/client/get_info.rs
loading...

Full Example Code

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

Expected Output

{
"name": "HORNET",
"version": "2.0.0-rc.6",
"status": {
"isHealthy": true,
"latestMilestone": {
"index": 5857259,
"timestamp": 1687786864,
"milestoneId": "0x4acfdc55bf4d7eab9e947cda3f6c4c88578c3fd59e44d3b461b706ef73186622"
},
"confirmedMilestone": {
"index": 5857259,
"timestamp": 1687786864,
"milestoneId": "0x4acfdc55bf4d7eab9e947cda3f6c4c88578c3fd59e44d3b461b706ef73186622"
},
"pruningIndex": 4749782
},
"supportedProtocolVersions": [
2
],
"protocol": {
"version": 2,
"networkName": "testnet-1",
"bech32Hrp": "rms",
"minPowScore": 1500,
"belowMaxDepth": 15,
"rentStructure": {
"vByteCost": 100,
"vByteFactorKey": 10,
"vByteFactorData": 1
},
"tokenSupply": "1450896407249092"
},
"pendingProtocolParameters": [],
"baseToken": {
"name": "Shimmer",
"tickerSymbol": "SMR",
"unit": "SMR",
"subunit": "glow",
"decimals": 6,
"useMetricPrefix": false
},
"metrics": {
"blocksPerSecond": 1.2,
"referencedBlocksPerSecond": 0.6,
"referencedRate": 50.0
},
"features": []
}