Network

Get Network Status

Changed on

This endpoint returns the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.

post/network/status

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body

NetworkRequest required

A NetworkRequest is utilized to retrieve some data specific exclusively to a NetworkIdentifier.

network_identifier, NetworkIdentifier required

The network_identifier specifies which network a particular object is associated with.

metadata, object

Example request

{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  }
}

Response

Expected response to a valid request

NetworkStatusResponse required

NetworkStatusResponse contains basic information about the node's view of a blockchain network. It is assumed that any BlockIdentifier.Index less than or equal to CurrentBlockIdentifier.Index can be queried.

If a Rosetta implementation prunes historical state, it should populate the optional oldest_block_identifier field with the oldest block available to query. If this is not populated, it is assumed that the genesis_block_identifier is the oldest queryable block.

If a Rosetta implementation performs some pre-sync before it is possible to query blocks, sync_status should be populated so that clients can still monitor healthiness. Without this field, it may appear that the implementation is stuck syncing and needs to be terminated.

current_block_identifier, BlockIdentifier required

The block_identifier uniquely identifies a block in a particular network.

current_block_timestamp, integer required

The timestamp of the block in milliseconds since the Unix Epoch. The timestamp is stored in milliseconds because some blockchains produce blocks more often than once a second.

genesis_block_identifier, BlockIdentifier required

The block_identifier uniquely identifies a block in a particular network.

oldest_block_identifier, BlockIdentifier

The block_identifier uniquely identifies a block in a particular network.

sync_status, SyncStatus

SyncStatus is used to provide additional context about an implementation's sync status.

This object is often used by implementations to indicate healthiness when block data cannot be queried until some sync phase completes or cannot be determined by comparing the timestamp of the most recent block with the current time.

peers, Peer[]

Example response

{
  "current_block_identifier": {
    "index": 1123941,
    "hash": "0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
  },
  "current_block_timestamp": 1582833600000,
  "genesis_block_identifier": {
    "index": 1123941,
    "hash": "0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
  },
  "oldest_block_identifier": {
    "index": 1123941,
    "hash": "0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
  },
  "sync_status": {
    "current_index": 100,
    "target_index": 150,
    "stage": "header sync"
  },
  "peers": [
    {
      "peer_id": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
    }
  ]
}

Changes

    • breaking

      added the new required request property network_identifier/blockchain

    • breaking

      added the new required request property network_identifier/network

    • breaking

      the network_identifier request property type changed from no type to object

    18 more changes in this revision