.md

sl.instance

The instance's public status report, and a verdict with next steps made from it.

@secondlayer/sdk@15.5.02 methodsfrom source with openpkgSelf-host guideInstance API
status()PublicStatusGet the instance's public status report.
diagnose()InstanceDiagnosisTurn the status report into a verdict with next steps.

Get the instance's public status report.

Reads GET /public/status: the overall status, chain tip, chain integrity, and the state of each service and decoder.

sl.instance.status(): Promise<PublicStatus>
Returns Promise<PublicStatus>
status
string
chainTip
number | null
chainIntegrity
{ ok?: boolean; maxHeight?: number; reason?: string | null }
streams
{ status?: string; tip?: { lag_seconds?: number; block_height?: number; } | nul…
index
{ status?: string; decoders?: PublicStatusDecoder[] }
services
PublicStatusService[]
timestamp
string

Turn the status report into a verdict with next steps.

Resolves to a state (healthy, empty-index, or degraded), the API's own overall status, and a list of issues, each with the commands that resolve it. A fresh instance with no blocks indexed reads as empty-index, not broken.

sl.instance.diagnose(): Promise<InstanceDiagnosis>
Returns Promise<InstanceDiagnosis>
state
InstanceState
overall
The API's own top-level verdict, passed through unmodified.
issues
InstanceIssue[]
InstanceDiagnosis
An instance's state, the API verdict, and the issues found.
InstanceIssue
title, detail, nextSteps
InstanceState
"healthy" | "empty-index" | "degraded"
PublicStatus
The subset of /status a diagnosis reads.
PublicStatusDecoder
decoder, status
PublicStatusService
name, status
Edit on GitHub