Skip to main content

Get Node Information

Sometimes it's needed to get certain info from the Node to determine for example if the node is synced or which features it has enabled. You can get this info from a Client instance.

Client in Wallet

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

The following code example will:

  1. Create a Client which will connect to the Shimmer Testnet.
  2. Use the created client to get information about the node.
  3. Print the information to the console.

Code Example

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": []
}