···11-`hydrant` is an AT Protocol indexer built on the `fjall` database. it's built to be flexible, supporting both full-network indexing and filtered indexing (e.g., by DID), allowing querying with XRPCs (not only `com.atproto.*`!), providing an ordered event stream, etc. oh and it can also act as a relay!
22-33-you can see [random.wisp.place](https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae/random.wisp.place) (standalone binary using http API) or the [statusphere example](https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae/hydrant/blob/main/examples/statusphere.rs) (hydrant-as-library) for examples. for rust docs look at https://hydrant.klbr.net/ for now.
44-55-**WARNING: *the db format is only partially stable.*** we provide migrations in hydrant itself, so nothing should go wrong! you should still probably keep backups just in case!
66-77-## what's here
88-99-- [getting started](getting-started.md): building, running, reverse proxying
1010-- [configuration](configuration.md): all environment variables
1111-- [build features](build-features.md): optional cargo features (`relay`, `backlinks`, etc.)
1212-- [concepts](concepts/README.md): how the stream works, relay comparison, multi-relay support
1313-- [rest api](api/README.md): management API reference
1414-- [xrpc](xrpc/README.md): data access via XRPC
1515-1616-## quick start
1717-1818-```bash
1919-cargo build --release
2020-export HYDRANT_DATABASE_PATH=./hydrant.db
2121-./target/release/hydrant
2222-```
11+---
22+title: hydrant
33+---
44+55+`hydrant` is an AT Protocol indexer built on the `fjall` database. it's built to be flexible, supporting both full-network indexing and filtered indexing (e.g., by DID), allowing querying with XRPCs (not only `com.atproto.*`!), providing an ordered event stream, etc. oh and it can also act as a relay!
66+77+you can see [random.wisp.place](https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae/random.wisp.place) (standalone binary using http API) or the [statusphere example](https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae/hydrant/blob/main/examples/statusphere.rs) (hydrant-as-library) for examples. for rust docs look at https://hydrant.klbr.net/ for now.
88+99+**WARNING: *the db format is only partially stable.*** we provide migrations in hydrant itself, so nothing should go wrong! you should still probably keep backups just in case!
1010+1111+## what's here
1212+1313+- [getting started](getting-started.md): building, running, reverse proxying
1414+- [configuration](configuration.md): all environment variables
1515+- [build features](build-features.md): optional cargo features (`relay`, `backlinks`, etc.)
1616+- [concepts](concepts/README.md): how the stream works, relay comparison, multi-relay support
1717+- [rest api](api/README.md): management API reference
1818+- [xrpc](xrpc/README.md): data access via XRPC
1919+2020+## quick start
2121+2222+```bash
2323+cargo build --release
2424+export HYDRANT_DATABASE_PATH=./hydrant.db
2525+./target/release/hydrant
2626+```
+3-1
docs/api/README.md
···11-# rest api
11+---
22+title: rest api
33+---
2435hydrant's REST API is split into public endpoints (safe to expose) and management endpoints (keep private). see [getting started](../getting-started.md#reverse-proxying) for guidance on what to expose.
46
···11-# database operations
11+---
22+title: database operations
33+---
2435- `POST /db/train`: train zstd compression dictionaries for the `repos`, `blocks`, and `events` keyspaces. dictionaries are written to disk; a restart is required to apply them. the crawler, firehose, and backfill worker are paused for the duration and restored on completion.
46- `POST /db/compact`: trigger a full major compaction of all database keyspaces in parallel. the crawler, firehose, and backfill worker are paused for the duration and restored on completion.
+3-1
docs/api/filter.md
···11-# filter management
11+---
22+title: filter management
33+---
2435- `GET /filter`: get the current filter configuration.
46- `PATCH /filter`: update the filter configuration.
···11-# ingestion control
11+---
22+title: ingestion control
33+---
2435## GET /ingestion
46
+3-1
docs/api/pds.md
···11-# PDS management
11+---
22+title: PDS management
33+---
2435hydrant rate-limits firehose events per PDS. each PDS is assigned to a named rate tier that controls how aggressively hydrant limits events from it. two built-in tiers are always present: `default` (conservative limits for unknown operators) and `trusted` (higher limits for well-behaved operators). additional tiers can be defined via `RATE_TIERS`.
46
+3-1
docs/api/repos.md
···11-# repository management
11+---
22+title: repository management
33+---
2435all `/repos` endpoints that return lists respond with NDJSON by default. send `Accept: application/json` or `Content-Type: application/json` to get a JSON array instead.
46
+3-1
docs/build-features.md
···11-# build features
11+---
22+title: build features
33+---
2435`hydrant` has several optional compile-time features:
46
···11-# hydrant vs tap
11+---
22+title: hydrant vs tap
33+---
2435while [`tap`](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) is designed as a firehose consumer and simply just propagates events while handling sync, `hydrant` is flexible, it allows you to directly query the database for records, and it also provides an ordered view of events, allowing the use of a cursor to fetch events from a specific point. it can act as both an indexer or an ephemeral view of some window of events.
46
+3-1
docs/configuration.md
···11-# configuration
11+---
22+title: configuration
33+---
2435hydrant is configured via environment variables, all prefixed with `HYDRANT_` (except `RUST_LOG`). a `.env` file in the working directory is loaded automatically.
46
+3-1
docs/getting-started.md
···11-# getting started
11+---
22+title: getting started
33+---
2435## requirements
46
+3-1
docs/xrpc/README.md
···11-# xrpc
11+---
22+title: xrpc
33+---
2435`hydrant` implements the following XRPC endpoints under `/xrpc/`. only expose `/xrpc/*` publicly, see [getting started](../getting-started.md#reverse-proxying) for guidance.
46
+3-1
docs/xrpc/atproto.md
···11-# com.atproto.*
11+---
22+title: com.atproto.*
33+---
2435these are standard atproto endpoints. you can look at [the atproto api reference](https://docs.bsky.app/docs/category/http-reference) for more info.
46
+3-1
docs/xrpc/backlinks.md
···11-# blue.microcosm.links.*
11+---
22+title: blue.microcosm.links.*
33+---
2435hydrant implements a subset of [microcosm constellation](https://constellation.microcosm.blue/) when it's built with the `backlinks` cargo feature (`cargo build --features backlinks`).
46
+3-1
docs/xrpc/hydrant.md
···11-# systems.gaze.hydrant.*
11+---
22+title: systems.gaze.hydrant.*
33+---
2435these are some non-standard XRPCs that might be useful.
46