fetch-logo
ConceptsConceptsGuidesGuidesExamplesExamplesReferencesReferencesAPIsAPIs
GitHub (opens in a new tab)
  • References
        • Almanac contract overview
        • Registration and endpoints weighting
    • Ledger
      • Versions
      • Active networks
      • Mainnet archives
      • Validators security
    • Indexer
      • Endpoints / Playground UIs
      • Querying
      • Entities
      • Versioning
  • References
        • Almanac contract overview
        • Registration and endpoints weighting
    • Ledger
      • Versions
      • Active networks
      • Mainnet archives
      • Validators security
    • Indexer
      • Endpoints / Playground UIs
      • Querying
      • Entities
      • Versioning
        • Example
References
Indexer
Versioning

Versioning

The versions of both the GraphQL API and the Indexer itself can be retrieved simply using the following query on the GraphQL playground.

Example

query ReleaseVersionTest {
  _metadata {
    queryNodeVersion
    indexerNodeVersion
  }
}

Each of these version numbers are stored as the value to the key "version" within their relevant module package.json file. These files can be found in the docker/node-cosmos/ and subql/packages/query/ directories for the Indexer and GraphQL versions, respectively.

// The Indexer version number, taken from "docker/node-cosmos/package.json"
{
  "name": "@subql/node-cosmos",
  "version": "1.0.0",
  ...
}

The _metadata entity

The _metadata entity has further utility beyond the scope of the example query given prior. Using any of the relevant fields from the type definition below, internal states and config information can be retrieved with ease.

type _metadata {
        lastProcessedHeight: Int
        lastProcessedTimestamp: Date
        targetHeight: Int
        chain: String
        specName: String
        genesisHash: String
        indexerHealthy: Boolean
        indexerNodeVersion: String
        queryNodeVersion: String
        rowCountEstimate: [TableEstimate]
        dynamicDatasources: String
      }

Example

If a developer is curious about the chain-id or whether the Indexer has passed any health checks, he can use indexerHealthy. These values can be returned within the playground or otherwise connected projects.

query ReleaseVersionTest {
  _metadata {
    chain
    indexerHealthy
  }
}

Was this page helpful?

EntitiesAPIs
footer-logo

Main website

Integrations

Events

We’re hiring!

Twitter (opens in a new tab)Telegram (opens in a new tab)Discord (opens in a new tab)GitHub (opens in a new tab)Youtube (opens in a new tab)LinkedIn (opens in a new tab)Reddit (opens in a new tab)
Sign up for developer updates