1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# zlay
an [AT Protocol](https://atproto.com/) relay in Zig. It discovers PDS hosts, processes their repository events, verifies signatures when signing keys are available, and serves a combined WebSocket stream and sync APIs. Protocol primitives come from [zat](https://tangled.org/zat.dev/zat); the collection index draws on [lightrail](https://tangled.org/microcosm.blue/lightrail).
**live:** [zlay.waow.tech](https://zlay.waow.tech/_health).
## install
requires Zig 0.17, a C toolchain and PostgreSQL. Clone the repo and build:
```sh
zig build -Dbackend=zio -Doptimize=ReleaseSafe -j2
```
## use
Set `DATABASE_URL` for a dedicated PostgreSQL database, choose writable event and collection-index directories, then run `zig-out/bin/zlay`. Configure credentials and discovery before exposing the service; see the docs for startup, retention and deployment.
## develop
```sh
zig fmt --check build.zig build.zig.zon src scripts # formatting
zig build test -j2 # tests
zig build test-index -j2 # collection index behavior
zig build -Dbackend=zio -j2 # analyze the production I/O backend
```
Normal builds use `std.Io.Threaded`; `-Dbackend=zio` selects [lalinsky’s zio](https://github.com/lalinsky/zio). Use ReleaseSafe for deployments.
## docs
[docs/](docs/) covers architecture, configuration and operation.
## license
[MIT](LICENSE)