sigil_getLatestBlock and (optionally) tower_getFinalityStatus. Sigil’s single-block MACA finality means the latest block is normally also finalised, but Tower confirms it under epoch lock.
When to use this
- Indexers that need every block exactly once.
- Webhook delivery that triggers on chain events.
- Off-chain agents that react to on-chain activity.
Prerequisites
- A reachable RPC endpoint.
- Persistent storage for the last-processed height (a single integer is enough).
Recipe — TypeScript
stream.ts
Recipe — Rust
stream.rs
Expected output
Common errors
| Symptom | Cause | Fix |
|---|---|---|
block not found for cursor | Cursor advanced past head | Re-fetch head; clamp cursor <= head.height |
| Duplicate processing after crash | Persisted cursor late | Persist cursor = block.height + 1 in the same transaction as downstream side effects |
| Skipping blocks | Treated head as final | Always gate on tower_getFinalityStatus.finalized_height |
| Rate limited (HTTP 429) | Polling too aggressively | Raise POLL_INTERVAL_MS or move to the direct RPC endpoint |
See also
- Concept: consensus and finality — why Tower confirms what MACA produced.
- Cookbook: Query a balance — the simplest single-shot read pattern.
- API reference: JSON-RPC