Captures the health of the server, including metrics and synchronization progress.

This is useful to monitor whether the server is running (or simply, if the underlying node is ready to receive requests). lastTipUpdate will be null if the server hasn't received any tip update from the Cardano node which means that either:

  • There's an error with the connection to the node
  • The node is still starting and checking the integrity of its database.

The node checks the database integrity on each restart; in some cases it can take several minutes. While doing so, it does not allow any external client to connect.

See also InteractionContext for an easy way to manage connection establishment with a bootstrapping node.

Hierarchy

  • ServerHealth

Index

Properties

currentEra

currentEra: Era

lastKnownTip

lastKnownTip: Tip

lastTipUpdate

lastTipUpdate: string

metrics

metrics: object

Type declaration

  • activeConnections: number
  • Optional runtimeStats?: object
    • cpuTime: number
    • currentHeapSize: number
    • gcCpuTime: number
    • maxHeapSize: number
  • sessionDurations: object
    • max: number
    • mean: number
    • min: number
  • totalConnections: number
  • totalMessages: number
  • totalUnrouted: number

network

network: "mainnet" | "preview" | "preprod"

networkSynchronization

networkSynchronization: number

startTime

startTime: string

version

version: string