Skip to main content

Get Node Information

You can access all the features of the library using an instance of the Client class. The Client class provides high-level abstraction to all interactions over IOTA network (Tangle). You have to instantiate this class before you start any interactions with the library, or more precisely with the IOTA nodes that power IOTA network.

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.

You can also find this guide in the native iota.js library

Code Example


This example uses dotenv, which is not safe to use in production environments.

// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Calls `GET /api/core/v2/info`.
//! Returns general information about the node.
//! Run: `cargo run --example node_api_core_get_info --release -- [NODE URL]`.

use iota_client::{Client, Result};

async fn main() -> Result<()> {
// Take the node URL from command line argument or use one from env as default.
let node_url = std::env::args().nth(1).unwrap_or_else(|| {
// This example uses dotenv, which is not safe for use in production.

// Create a client with that node.
let client = Client::builder()

// Get node info.
let info = client.get_info().await?;



Run the Example

Run the example by running the following command:

cargo run --example node_api_core_get_info --release --
  • You can replace with any node url.

Expected Output

NodeInfoWrapper {
node_info: InfoResponse {
name: "HORNET",
version: "2.0.0-beta.5",
status: StatusResponse {
is_healthy: true,
latest_milestone: LatestMilestoneResponse {
index: 746869,
timestamp: 1661868434,
milestone_id: "0xbab289ebb1fdcc8516772074c3c465aaad648f234a4c1ff138f16c65a88b1298",
confirmed_milestone: ConfirmedMilestoneResponse {
index: 746869,
timestamp: 1661868434,
milestone_id: "0xbab289ebb1fdcc8516772074c3c465aaad648f234a4c1ff138f16c65a88b1298",
pruning_index: 0,
supported_protocol_versions: [
protocol: ProtocolResponse {
version: 2,
network_name: "testnet",
bech32_hrp: "rms",
min_pow_score: 1500.0,
rent_structure: RentStructureResponse {
v_byte_cost: 100,
v_byte_factor_key: 10,
v_byte_factor_data: 1,
token_supply: "1450896407249092",
pending_protocol_parameters: [],
base_token: BaseTokenResponse {
name: "Shimmer",
ticker_symbol: "SMR",
unit: "SMR",
subunit: Some(
decimals: 6,
use_metric_prefix: false,
metrics: MetricsResponse {
blocks_per_second: 8.4,
referenced_blocks_per_second: 9.2,
referenced_rate: 109.52380952380952,
features: [],
url: "",