nostr-watch is an OpenSats-funded TypeScript monorepo for monitoring the Nostr relay network. It implements NIP-66 — the Nostr Relay Monitoring specification — which defines how monitors publish structured relay health data back onto the Nostr network itself. The stack covers everything from raw relay probing and auditing, to aggregating those results into queryable state, to serving that state through REST and MCP endpoints and a web dashboard. Individual libraries are independently installable so you can integrate relay checking or NIP-66 data into your own applications without adopting the full stack.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sandwichfarm/nostr-watch/llms.txt
Use this file to discover all available pages before exploring further.
Core libraries
The four libraries most commonly used as standalone packages:nocap
Adapter-based relay capability discovery. Checks WebSocket connectivity, DNS, SSL, NIP-11, and geolocation for any relay URL.
route66
NIP-66 relay aggregation and state management. Aggregates monitor check events and exposes them through a unified query API.
auditor
Validates relay behavior against the NIPs they advertise in their NIP-11 info document.
nostrings
Relay URL sanitization and normalization. Validates and canonicalizes
wss:// and ws:// relay URLs.Services
Long-running agents and state machines that form the operational nostr-watch network:relaymon
Relay health monitor. Runs continuous nocap checks and publishes results as NIP-66 Kind 30166 events. Supports Node.js and Deno.
trawler
Relay crawler. Discovers new relays across the Nostr network and seeds them into the monitoring pipeline.
rstate
NIP-66 relay intelligence state machine. Aggregates monitor events and serves them over a REST API and MCP endpoint.
Three-layer architecture
Packages in the monorepo follow a strict one-way dependency rule:- internal/ — Infrastructure shared across the monorepo: logging (
@nostrwatch/logger), event publishing (@nostrwatch/publisher), shared utilities, and queue management. These packages have no dependencies on libraries or apps. - libraries/ — Reusable packages consumable independently via npm or pnpm.
nocap,route66,auditor, andnostringsall live here. - apps/ — Product applications including the web dashboard (
gui), monitoring agents (relaymon,trawler), and the relay state machine (rstate).
Next steps
Quickstart
Install nocap and run your first relay check in under five minutes.
Architecture
Understand the package layers, adapter patterns, and cross-package conventions.