···8080| `CRAWLER_MAX_PENDING_REPOS` | `2000` | max pending repos for crawler. |
8181| `CRAWLER_RESUME_PENDING_REPOS` | `1000` | resume threshold for crawler pending repos. |
82828383-## api
8383+## REST api
84848585### management
8686···143143- `PUT /repos`: explicitly track repositories. accepts an NDJSON body of `{"did": "..."}` (or JSON array of the same).
144144- `DELETE /repos`: untrack repositories. accepts an NDJSON body of `{"did": "..."}` (or JSON array of the same).
145145146146-### data access (xrpc)
146146+### event stream
147147+148148+- `GET /stream`: subscribe to the event stream.
149149+ - query parameters:
150150+ - `cursor` (optional): start streaming from a specific event ID.
151151+152152+### stats
153153+154154+- `GET /stats`: get stats about the database:
155155+ - `counts`: counts of repos, records, events, and errors, etc.
156156+ - `sizes`: sizes of the database keyspaces on disk, in bytes.
157157+158158+## data access (xrpc)
147159148160`hydrant` implements the following XRPC endpoints under `/xrpc/`:
149161150150-#### com.atproto.*
162162+### com.atproto.*
151163152164the following are implemented currently:
153165- `com.atproto.repo.getRecord`
154166- `com.atproto.repo.listRecords`
155167156156-#### systems.gaze.hydrant.*
168168+### systems.gaze.hydrant.*
157169158170these are some non-standard XRPCs that might be useful.
159171160160-##### systems.gaze.hydrant.countRecords
172172+#### systems.gaze.hydrant.countRecords
161173162174return the total number of stored records in a collection.
163175···168180169181returns `{ count }`.
170182171171-#### blue.microcosm.links.*
183183+### blue.microcosm.links.*
172184173185hydrant implements a subset of [microcosm constellation](https://constellation.microcosm.blue/) when it's built with the `backlinks` cargo feature (`cargo build --features backlinks`).
174186175187when enabled, hydrant indexes all AT URI and DID references found inside stored records into a reverse index. this lets you efficiently answer "what records link to this subject?".
176188177177-##### blue.microcosm.links.getBacklinks
189189+#### blue.microcosm.links.getBacklinks
178190179191return records that link to a given subject.
180192···190202191203results are ordered by source record rkey (ascending by default, descending when `reverse=true`). the cursor is stable across new insertions for TID rkey records.
192204193193-##### blue.microcosm.links.getBacklinksCount
205205+#### blue.microcosm.links.getBacklinksCount
194206195207return the number of records that link to a given subject.
196208···200212| `source` | no | filter by source collection (same format as `getBacklinks`). |
201213202214returns `{ count }`.
203203-204204-### event stream
205205-206206-- `GET /stream`: subscribe to the event stream.
207207- - query parameters:
208208- - `cursor` (optional): start streaming from a specific event ID.
209209-210210-### stats
211211-212212-- `GET /stats`: get stats about the database:
213213- - `counts`: counts of repos, records, events, and errors, etc.
214214- - `sizes`: sizes of the database keyspaces on disk, in bytes.