Chain Node API

Endpoints exposed by both miner and sharder

Chain Endpoints

Get Chain Stats - GET /v1/chain/get/stats

Return the statistics related to the chain steady-state finality (time between two finalized blocks in steady state). No parameters needed.

Response

{
  "delta": 200000000,
  "current_round": 130603,
  "latest_finalized_round": 130598,
  "count": 130406,
  "min": 9.23007,
  "max": 285.661869,
  "mean": 201.55738367607,
  "std_dev": 15.83702479644,
  "total_txns": 221223,
  "rate_1_min": 4.85629917895347,
  "rate_5_min": 4.86069032500071,
  "rate_15_min": 4.86565781002975,
  "rate_mean": 5.0489799699893,
  "percentile_50": 198.3409765,
  "percentile_90": 220.7481467,
  "percentile_95": 230.5547058,
  "percentile_99": 246.39698951
}
FieldDescription

Delta

An arbitrary time that represents 1/2 of the block finality time, or network latency. The current value for it is 200 milliseconds.

Current Round

The number that represents the current round of the blockchain.

Latest Finalized Round

The number that represents the round that generated the latest finalized block.

Count

Number of finalized blocks generated in the block chain since genesis.

Min

Minimum finalization time of a block, in milliseconds.

Max

Maximum finalization time of a block, in milliseconds.

Mean

Mean (Average) finalization time of a block, in milliseconds.

Std Dev

Standard deviation of the finalization time of a block from the mean number, in milliseconds.

Total Txns

The total count of all transactions included in all the blocks generated by the blockchain.

Rates (1min, 5min, 15min, mean)

The moving average rate of occurrence of block finalization events per second during the specified time window.

Percentile (50%, 90%, 95%, 99%)

The block finalization time value, in milliseconds, which the specified percentage of block finalization events lie below. For example, the 90% percentile value means "90% of the block were finalized in a time below this value".

Get latest block and round metrics cached in the miner - GET /v1/diagnostics/get/info

Returns the latest block/round information known to the node. No parameters needed.

Response

{
  "chain_info": [
    {
      "ts": "2024-04-30T13:22:26.715052323Z",
      "round": 262493,
      "finalized_blocks_count": 262492,
      "block_hash": "199edd8a2386dbf9d4690528cfb515dbc9691e30df79abc1abcf972e08e74739",
      "client_state_hash": "elk4h0QNHElOUNZiBLZQIpvkoryRZWQRJtUdOEMWmRw="
    },
    {
      "ts": "2024-04-30T13:22:26.128677627Z",
      "round": 262490,
      "finalized_blocks_count": 262489,
      "block_hash": "4e03f6b261d89425a7279bb4bd725d165b3dbf0ab4d922be6e8490fac7d4e09c",
      "client_state_hash": "q5B7TOCZFrWjdoP+fNs1QHO7iZopaLeVLbV7twc1mk8="
    },
    ....
  ],
  "round_info": [
    {
      "ts": "2024-04-30T13:22:26.71594139Z",
      "round_number": 262496,
      "notarized_blocks_count": 1,
      "zero_notarized_blocks_count": 0,
      "multiple_notarized_blocks_count": 0
    },
    {
      "ts": "2024-04-30T13:22:25.525978397Z",
      "round_number": 262490,
      "notarized_blocks_count": 1,
      "zero_notarized_blocks_count": 0,
      "multiple_notarized_blocks_count": 0
    },
    ....
  ]
}

zero_notarized_blocks_count is the count of rounds with no notarization for any blocks, while multiple_notarized_blocks_count is the count of rounds with multiple notarized blocks. Other fields are self-explanatory. For info. about notarization, Check Blockchain system feature documentation.

Block endpoints

Get latest finalized block - GET /v1/block/get/latest_finalized

Return latest finalized block. No parameters needed.

Response

{
  "version": "1.0",
  "creation_date": 1714486050,
  "hash": "c314b5535e100a05a95ddaefa4bc56a4a5483e8fa064f817002d3647202b7710",
  "miner_id": "c3227e496fdf3c9aa604f3470a2bbd1249f00142150bc067996cd0d6ffcd77ea",
  "round": 275476,
  "round_random_seed": -1.1913434395608466e+18,
  "state_changes_count": 34,
  "merkle_tree_root": "5e389c7a096129cd19c7a2f67e1dc211d012f342a6e2e1e48d25372540bcbc56",
  "state_hash": "2uRvcbkpoClaEtsV61YJGPTb4f3vquFqK1hOsTq8CIc=",
  "receipt_merkle_tree_root": "958beb669158ace6e88ceb39363f8b32fcb011c8f2a84a0889f1382d33673347",
  "num_txns": 2
}

For more information about this response, refer to the Block Entity page.

Get latest finalized magic block Summary - GET /v1/block/get/latest_finalized_magic_block_summary

Returns the latest finalized magic block. For more information and detailed format of the magic block, refer to Magic Block page. No parameters needed.

Response

{
  "version": "1.0",
  "creation_date": 1676096659,
  "hash": "ed79cae70d439c11258236da1dfa6fc550f7cc569768304623e8fbd7d70efae4",
  "miner_id": "",
  "round": 0,
  "round_random_seed": 839695260482366300,
  "state_changes_count": 0,
  "merkle_tree_root": "",
  "state_hash": "LU59aqooaMcvqFWLz02BdO9xQPP3kWmd14aB85DeBgk=",
  "receipt_merkle_tree_root": "",
  "num_txns": 0,
  "maigc_block": {
    "hash": "506391f07cabd7bfee330f979ba9baab498b721b748eb869ba2b5c054932c8bd",
    "previous_hash": "",
    "magic_block_number": 1,
    "starting_round": 0,
    "miners": {
      "type": 0,
      "nodes": {
        "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71": {
          "id": "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71",
          "version": "",
          "creation_date": 1669895308,
          "public_key": "a93743137c318274bf375e32c00b91439c18c0c0432eac550b2c1a54d909fa0f6669408c3208e5f68fab5aa6c36c91e1978670f17118d3fb75b854d68c1c740f",
          "n2n_host": "dev2.zus.network",
          "host": "dev2.zus.network",
          "port": 7071,
          "path": "miner01",
          "type": 0,
          "description": "dev2@gmail.com",
          "set_index": 0,
          "status": 0,
          "in_prev_mb": false,
          "info": {
            "build_tag": "",
            "state_missing_nodes": 0,
            "miners_median_network_time": 0,
            "avg_block_txns": 0
          }
        },
        ....
      }
    },
    "sharders": {
      "type": 1,
      "nodes": {
        "371a09c9eec259d9d3ba794ecccdd392ecdeec4c35565ccc5977fba44e20217d": {
          "id": "371a09c9eec259d9d3ba794ecccdd392ecdeec4c35565ccc5977fba44e20217d",
          "version": "",
          "creation_date": 1669895308,
          "public_key": "c628ee0089586353bdda3476e9b70c9c91d6e0cd9e6ecb6b7d03628e6dd667245e97007fe143e47e6a67d1cd1f902e1a7ac2e9108ae9795050c5f2bafbd28ea1",
          "n2n_host": "dev2.zus.network",
          "host": "dev2.zus.network",
          "port": 7171,
          "path": "sharder01",
          "type": 1,
          "description": "dev2@gmail.com",
          "set_index": 0,
          "status": 0,
          "in_prev_mb": false,
          "info": {
            "build_tag": "",
            "state_missing_nodes": 0,
            "miners_median_network_time": 0,
            "avg_block_txns": 0
          }
        },
        ....
      }
    },
    "share_or_signs": {
      "shares": {
        "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71": {
          "id": "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71",
          "share_or_sign": {
            "96b96df7631e00d339f9a25131927c43cba9f130b075f4af09e8934c21173341": {
              "id": "",
              "message": "d9cd2ce0df45e1677e9a80a6866a728dc81f4f900de8407b9c6a7cc6c8347050",
              "share": "",
              "sign": "1 1f95773ebaba44ca362d3c6c56e9aadcac60d1a3a39048dfba228a344f2ed739 33dea02718fe85e8288089f6efa2276247abd6291d753c81cadc654e4258469"
            },
            "c3227e496fdf3c9aa604f3470a2bbd1249f00142150bc067996cd0d6ffcd77ea": {
              "id": "",
              "message": "34074c8b8ae0605369fc1f9638f4ec9cee172cefb459ba4b191d2453aa6ca564",
              "share": "",
              "sign": "1 10bd1f7168a29b8215a3b7b194c1a0d9d8dbf0cf7a95e751024bd8e7710bd0b0 23327791cf1a76cd2913a50891ea473fc07663c24baf8701794ab3d6f94ef3f4"
            }
          }
        },
        .....
      }
    },
    "mpks": {
      "Mpks": {
        "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71": {
          "ID": "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71",
          "Mpk": [
            "1 149193bdf3444a563a4f4ac776bbfba49374776f0262b93b377f30e5649d3ad5 1a2e7868c6940f15bf56950688c26376985dcf850c35c8f754e438d28f91c705 14ae808cd1e9ac93f524a96f9f44e73028cb636931a19d4e971089eb0fb72286 fcc941c5a29381a2dedb1c186abc6f8b9bbbc1cb774ed2efa89667d2f9d51e",
            "1 9ff8f430a5be8323003a714b7d3c1dc55792971413431b585234feaf7fc2379 1cdc7a25bc42c913b00a351392cb2d5762807dab078c1bbb05c4e0fa909dbe5c 145c357ede6c97a107712a862bb4bc153311fc1e41150838e40844b6a2cefe58 8a5253e9d84d2fb6d066936ed97e64b00c20a1fd7de0b672faed6cdc35dbb3e"
          ]
        },
        ....
      }
    },
    "t": 2,
    "k": 3,
    "n": 3
  }
}

Get 10 most recent finalized blocks - GET /v1/block/get/recent_finalized

Returns a list of the 10 most recent finalized blocks. No parameters needed.

Response

[
  {
    "version": "1.0",
    "creation_date": 1714498100,
    "hash": "18665cca366b1a20f5459eb528af3f3d25e2ab3b7f3295e9261821f693206d97",
    "miner_id": "8f9a15b9551f8552a19cf4750ef14bff3bbac83bc1decd4d5a013a7f36f7ef71",
    "round": 333287,
    "round_random_seed": -3.2753362078073477e+18,
    "state_changes_count": 19,
    "merkle_tree_root": "09e8276f2283016d095d2906ac9ba625773234fc657ec880d8015de2aae34f84",
    "state_hash": "jzjIlWq7UMpIH4L7nPkwjf9Wz7SmHRLlzcoBlc1WmnE=",
    "receipt_merkle_tree_root": "c23f89dc588f71b1181366a014eae26b051d35ebea620cf0cd2a8466a758d8e1",
    "num_txns": 1
  },
  {
    "version": "1.0",
    "creation_date": 1714498100,
    "hash": "3448778b2fe868f8a69e4cbff3226ec360d1838622e813914912960b47aebae7",
    "miner_id": "c3227e496fdf3c9aa604f3470a2bbd1249f00142150bc067996cd0d6ffcd77ea",
    "round": 333286,
    "round_random_seed": 5.365035252831413e+18,
    "state_changes_count": 37,
    "merkle_tree_root": "90da2cc72610b9c5668686d9e42b4f51860d3380ef61aa983c0c248593b4f442",
    "state_hash": "vMEsylBqlZ6787HvkXTMxIZWZGT8VBq9Ojgt5HyXOtY=",
    "receipt_merkle_tree_root": "958beb669158ace6e88ceb39363f8b32fcb011c8f2a84a0889f1382d33673347",
    "num_txns": 2
  },
  ....
]

Get latest block and round metrics cached in the miner - GET /v1/diagnostics/get/info

Returns the latest block/round information stored in a miner. No parameters needed.

Response

{
  "chain_info": [
    {
      "ts": "2024-04-30T13:22:26.715052323Z",
      "round": 262493,
      "finalized_blocks_count": 262492,
      "block_hash": "199edd8a2386dbf9d4690528cfb515dbc9691e30df79abc1abcf972e08e74739",
      "client_state_hash": "elk4h0QNHElOUNZiBLZQIpvkoryRZWQRJtUdOEMWmRw="
    },
    {
      "ts": "2024-04-30T13:22:26.128677627Z",
      "round": 262490,
      "finalized_blocks_count": 262489,
      "block_hash": "4e03f6b261d89425a7279bb4bd725d165b3dbf0ab4d922be6e8490fac7d4e09c",
      "client_state_hash": "q5B7TOCZFrWjdoP+fNs1QHO7iZopaLeVLbV7twc1mk8="
    },
    ....
  ],
  "round_info": [
    {
      "ts": "2024-04-30T13:22:26.71594139Z",
      "round_number": 262496,
      "notarized_blocks_count": 1,
      "zero_notarized_blocks_count": 0,
      "multiple_notarized_blocks_count": 0
    },
    {
      "ts": "2024-04-30T13:22:25.525978397Z",
      "round_number": 262490,
      "notarized_blocks_count": 1,
      "zero_notarized_blocks_count": 0,
      "multiple_notarized_blocks_count": 0
    },
    ....
  ]
}

zero_notarized_blocks_count is the count of rounds with no notarization for any blocks, while multiple_notarized_blocks_count is the count of rounds with multiple notarized blocks. Other fields are self-explanatory. For info. about notarization, Check Blockchain system feature documentation.

Latest Block Fee Stats - GET /v1/block/get/fee_stats

Returns the fee statistics for the transactions of the LFB (latest finalized block). No parameters needed.

Response

{
  "max_fees": 15500000,
  "mean_fees": 0,
  "min_fees": 0
}

Last updated