# Blockchain monitoring

Source: https://docs.settlemint.com/docs/developer-guides/operations/blockchain-monitoring
Monitor platform status from the DALP dapp and API, and inspect chain RPC and indexer health from the API or CLI.



Use blockchain monitoring when you need detailed chain RPC and indexer diagnostics. The API exposes sync lag, block age, finality lag, stall time, reindex state, and recent service status for each monitored chain service.

Use platform status when you need the operator dashboard rollup. The platform status API combines data freshness, transaction infrastructure, API request health, and workflow health into one snapshot and a trailing history view.

This is operational data for a DALP environment. It helps you answer questions like:

* Is an indexer behind the chain head?
* Is a chain RPC endpoint stale or stalled?
* Which networks have degraded or critical health?
* Did a service recover after an incident?

<Callout type="info" title="Admin or owner access required">
  Blockchain monitoring endpoints require the global `admin` role or the organization `owner` role. API keys inherit the
  permissions of the user that created them.
</Callout>

## What DALP monitors [#what-dalp-monitors]

DALP reports health for two service types:

| Service type | What it tells you                                                                   |
| ------------ | ----------------------------------------------------------------------------------- |
| `chain-rpc`  | Whether DALP can read fresh blocks from the configured chain RPC endpoint.          |
| `indexer`    | Whether the indexer is keeping up with chain head and serving current indexed data. |

Health status values are:

| Status       | Meaning                                                        |
| ------------ | -------------------------------------------------------------- |
| `healthy`    | The service is reporting normally.                             |
| `degraded`   | The service is lagging or stale enough to need attention.      |
| `critical`   | The service is unhealthy for the monitored range.              |
| `unknown`    | DALP does not have enough recent data to classify the service. |
| `reindexing` | The indexer is rebuilding data for a chain.                    |

## Get the platform status rollup [#get-the-platform-status-rollup]

Open Platform settings > Platform status in the dapp when you need the operator dashboard view. DALP shows the same snapshot and history data from the API to users with administrator or owner access.

Use the platform status snapshot when you need a single environment-level health view for an operations dashboard. The snapshot returns a header verdict, four panel verdicts, and stat cards for the last 24 hours.

```bash
curl -G "https://your-platform.example.com/api/v2/platform-status/snapshot" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"
```

The response groups health into four panels:

| Panel          | What it summarizes                                                         |
| -------------- | -------------------------------------------------------------------------- |
| Data freshness | Latest indexer rollups, chains in sync, and recent sync errors.            |
| Transactions   | Chain RPC service coverage.                                                |
| Platform API   | Request volume and 4xx/5xx rates over the trailing 24 hours.               |
| Workflows      | Completed and stalled workflow counts when workflow metrics are available. |

The platform status verdict is `operational`, `degraded`, `outage`, or `no_data`. `no_data` means DALP has not collected enough rollup data yet, such as immediately after a fresh deployment.

Use the history endpoint when you need the trailing daily severity grid shown in the dapp status page. The `days` query parameter accepts 1 to 90 days and defaults to 90.

```bash
curl -G "https://your-platform.example.com/api/v2/platform-status/history" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  --data-urlencode "days=30"
```

## Get a blockchain monitoring summary [#get-a-blockchain-monitoring-summary]

Use the blockchain monitoring summary endpoint for the current state per monitored chain service.

```bash
curl -G "https://your-platform.example.com/api/v2/blockchain-monitoring/health-metrics/summary" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  --data-urlencode "from=2026-05-01T00:00:00.000Z" \
  --data-urlencode "to=2026-05-01T12:00:00.000Z"
```

The response contains one entry per monitored service:

```json
{
  "services": [
    {
      "serviceId": "01964f21-9f02-7000-9e8d-1e6d1fdc7f01",
      "serviceType": "indexer",
      "chainId": 11155111,
      "networkName": "Sepolia",
      "latestStatus": "healthy",
      "latestSampledAt": "2026-05-01T11:59:30.000Z",
      "snapshotCount": 48,
      "syncLag": 2,
      "blockHeight": 8154321,
      "blockAgeSeconds": null,
      "finalityLagBlocks": null,
      "stallSeconds": null,
      "recentLatencies": [124, 119, 131],
      "deploymentState": null
    }
  ]
}
```

Use these fields like this:

| Field               | Use it for                                                          |
| ------------------- | ------------------------------------------------------------------- |
| `latestStatus`      | The current classified health state.                                |
| `syncLag`           | Indexer lag in blocks. This is only set for `indexer` services.     |
| `blockAgeSeconds`   | Chain RPC freshness. This is only set for `chain-rpc` services.     |
| `finalityLagBlocks` | Chain RPC finality lag.                                             |
| `stallSeconds`      | How long the chain head has stopped advancing.                      |
| `deploymentState`   | Indexer version and reindex progress when an indexer is rebuilding. |

Admins also see active indexer reindexes on the main dashboard. When an indexer's deployment state shows an active
rebuild, the dashboard displays a reindex banner with the progress percentage, elapsed time, and a link to
`/platform-settings/blockchain-monitoring`. If three or more indexers are actively reindexing, the banner switches to an
aggregate count instead of listing every indexer. The banner is hidden for non-admin users and when there is no meaningful
active reindex status to show.

## Check a timeline [#check-a-timeline]

Use the timeline endpoint when you need chart data or want to see whether a problem is getting worse.

```bash
curl -G "https://your-platform.example.com/api/v2/blockchain-monitoring/health-metrics/timeline" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  --data-urlencode "from=2026-04-24T00:00:00.000Z" \
  --data-urlencode "to=2026-05-01T00:00:00.000Z" \
  --data-urlencode "granularity=day"
```

The timeline accepts `hour` or `day` granularity. The queried range must be 31 days or less.

```json
{
  "buckets": [
    {
      "timestamp": "2026-04-30T00:00:00.000Z",
      "services": [
        {
          "serviceKey": "indexer-11155111",
          "serviceType": "indexer",
          "chainId": 11155111,
          "networkName": "Sepolia",
          "healthyPct": 95.8,
          "degradedPct": 4.2,
          "criticalPct": 0
        }
      ]
    }
  ]
}
```

## Inspect service health [#inspect-service-health]

Use the service breakdown when you need one row per monitored service with aggregate percentages.

```bash
curl -G "https://your-platform.example.com/api/v2/blockchain-monitoring/service-health-metrics" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  --data-urlencode "from=2026-05-01T00:00:00.000Z" \
  --data-urlencode "to=2026-05-01T12:00:00.000Z"
```

The time range for summary and service breakdown calls must be 7 days or less.

## Inspect raw snapshots [#inspect-raw-snapshots]

Use snapshots when you need the underlying health log. You can filter by service, status, service type, network name, and time range.

```bash
curl -G "https://your-platform.example.com/api/v2/blockchain-monitoring/health-snapshots" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  --data-urlencode "status=degraded" \
  --data-urlencode "serviceType=indexer" \
  --data-urlencode "limit=20"
```

Each snapshot includes the sampled time, service type, chain ID, network name, status, block metrics, and collector latency. Responses include `nextCursor` for pagination.

```json
{
  "items": [
    {
      "id": "01964f32-4cc1-7000-a05e-88a188d62921",
      "serviceType": "chain-rpc",
      "chainId": 11155111,
      "networkName": "Sepolia",
      "status": "degraded",
      "rawStatus": "degraded",
      "sampledAt": "2026-05-01T11:55:00.000Z",
      "blockHeight": 8154300,
      "chainHeadBlock": null,
      "syncLag": null,
      "entityCount": null,
      "blockAgeSeconds": 45,
      "finalityLagBlocks": 3,
      "stallSeconds": 30,
      "collectorLatencyMs": 148
    }
  ],
  "nextCursor": null,
  "totalCount": 1,
  "facets": {}
}
```

## Stream health events [#stream-health-events]

Use the stream endpoint when you want live updates in an operations screen or incident console.

```bash
curl -N "https://your-platform.example.com/api/v2/blockchain-monitoring/health-snapshots/stream" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"
```

The stream uses server-sent events. Every event includes `eventType`, so parse that first instead of assuming each message has snapshot fields.

Snapshot events use `eventType: "snapshot"` and carry the same health fields as snapshot list items, plus `serviceId` and optional `deploymentState`:

```json
{
  "eventType": "snapshot",
  "id": "01964f32-4cc1-7000-a05e-88a188d62921",
  "serviceId": "01964f21-9f02-7000-9e8d-1e6d1fdc7f01",
  "serviceType": "indexer",
  "chainId": 11155111,
  "networkName": "Sepolia",
  "status": "healthy",
  "rawStatus": "healthy",
  "sampledAt": "2026-05-01T11:59:30.000Z",
  "blockHeight": 8154321,
  "chainHeadBlock": 8154323,
  "syncLag": 2,
  "entityCount": null,
  "blockAgeSeconds": null,
  "finalityLagBlocks": null,
  "stallSeconds": null,
  "collectorLatencyMs": 124,
  "deploymentState": null
}
```

Block-progress events use `eventType: "block-progress"`. DALP emits these while an indexer processes block batches, including during reindexing:

```json
{
  "eventType": "block-progress",
  "chainId": 11155111,
  "blockNumber": 8154321
}
```

Keep the connection open and update your view based on the event type you receive.

## Use the CLI [#use-the-cli]

The same monitoring data is available from the DALP CLI:

```bash
dalp monitoring blockchain summary --from 2026-05-01T00:00:00.000Z --to 2026-05-01T12:00:00.000Z
dalp monitoring blockchain timeline --from 2026-04-24T00:00:00.000Z --to 2026-05-01T00:00:00.000Z
dalp monitoring blockchain services --from 2026-05-01T00:00:00.000Z --to 2026-05-01T12:00:00.000Z
dalp monitoring blockchain snapshots
dalp monitoring blockchain snapshots-stream
```

Use the CLI for quick checks. Use the API when you are building dashboards, alerting, or operational reports.

## Related operations [#related-operations]

* [Transaction tracking](/docs/developer-guides/operations/transaction-tracking) - Check the status of a submitted transaction by hash.
* [Reconciliate balances](/docs/developer-guides/operations/reconciliate-balances) - Compare on-chain balances with your internal records.
* [API reference](/docs/developer-guides/api-integration/api-reference) - Browse generated API coverage.
