~ knotless Search/
↑↓ move↵ open⇧↵ all results

zat.dev/zlay

atproto relay in zig · mirror of https://tangled.org/zat.dev/zlay

0
0
36 lines · 1.4 KB Raw History
# 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)