···36363737### API
38383939-#### `com.atproto.sync.listReposByCollection`
4040-4141-[Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-list-repos-by-collection)
3939+#### `com.atproto.sync.listReposByCollection`: [Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-list-repos-by-collection)
42404341Lightrail implements some [proposed changes](https://github.com/bluesky-social/atproto/pull/4733) to this query:
4442···5048- `limit` can be up to 10,000 (lexicon specifies 2,000 max). This matches `collectiondir`'s limit.
514952505353-#### `com.atproto.sync.listRepos`
5151+#### `com.atproto.sync.listRepos`: [Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-list-repos)
54525555-[Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-list-repos)
56535757-5858-#### `com.atproto.sync.getRepoStatus`
5959-6060-[Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-get-repo-status)
5454+#### `com.atproto.sync.getRepoStatus`: [Query docs](https://docs.bsky.app/docs/api/com-atproto-sync-get-repo-status)
615562566357## Lightrail server quick start
···78727973### Key configs
80747575+- **`--db-path`**, default `./lightrail.db`: where to write lightrail's [fjall](https://fjall-rs.github.io/) db
7676+- **`--listen`**, default `0.0.0.0:2511`: host and port to bind
7777+7878+8179```bash
8282-# you can list all config options with:
8080+# you can list *all* available options with:
8381cargo run -- --help
8482```
85838686-- **`--db-path`**, default `./lightrail.db`: where to write lightrail's [fjall](https://fjall-rs.github.io/) db
8787-- **`--listen`**, default `0.0.0.0:2511`: host and port to bind
8484+Environment vars can be used for all configs, prefixed with `LIGHTRAIL_`, like `LIGHTRAIL_DB_PATH=/path/to/wherever.db`.
888589869087#### Atmosphere configs
···115112- Lightrail's ordering of DIDs in the `listReposByCollection` response is different from `collectiondir`
116113117114 - `collectiondir` always inserts new DIDs at the end of the paginated response
118118- - Lightrail makes no guarantee except that the response will not contain duplicates
115115+ - Lightrail makes no ordering guarantee except that the paged response will not contain duplicates
116116+117117+ You should start your firehose listener *before* crawling `listReposByCollection`, because DIDs newly indexed by lightrail after the first is requested are not guaranteed to be present in the total paged set.
119118120119121120- If you see a log line like
···145144When we call `sync.getRecord`, we provide a made-up collection and rkey, which works for our purposes because the response will contain a _proof of absense_ if the key doesn't exist in the repo: a CAR slice (with rev + data from the commit object!) containing adjacent keys (that we'll use!). Unfortunately, not every PDS implements proof of absense responses, notably **bridgy** currently returns an error for non-existent keys.
146145147146148148-#### `sync.getRepo` resync fallback
147147+#### Resync fallback with `sync.getRepo`
149148150149If the `describeRepo` approach fails for any reason, lightstream attempt to resync from a full repo export.
150150+151151+Eg., Bridgy's PDS often fails the `sync.getRecord` probe (see above) but its repos are still indexed by lightrail via this full-repo fallback.
151152152153153154### Sync1.1