123# @nzip/lofi-node45**Self-host the sync backend for [lofi](https://github.com/FelineStateMachine/lofi) apps: one daemon6embedding a Jazz sync server, iroh peer-to-peer transport, and ticket-gated access.**78Issue a ticket carrying location + secret; the app seals it at rest — admin capability behind the9user's passkey — and syncs against your node. Pair homes by ticket — no static IPs, no cloud — and10choose where your data lives.1112[Documentation](https://lofi.host/node) · [API reference](https://lofi.host/node/api) ·13[JSR package](https://jsr.io/@nzip/lofi-node) · [MIT License](LICENSE)1415Building with an AI agent? Feed it [llms.txt](https://lofi.host/node/llms.txt) for an index of the16node documentation, or [llms-full.txt](https://lofi.host/node/llms-full.txt) for the complete docs17and API reference in one file.1819## Quick start2021Run straight from JSR with `dx` (Deno's npx — `deno x`):2223```sh24dx -A jsr:@nzip/lofi-node/cli init --port 4802 # ticket-gated by default25dx -A jsr:@nzip/lofi-node/cli start # gate URL + node-pairing ticket26dx -A jsr:@nzip/lofi-node/cli ticket issue --label phone # app-connect ticket (shown once)27```2829Equivalent forms:3031```sh32deno run -A jsr:@nzip/lofi-node/cli start # plain deno33deno install -g -A -n lofi-node jsr:@nzip/lofi-node/cli # persistent `lofi-node` command34```3536> Freshly published versions sit behind Deno's 24-hour37> [minimum-dependency-age](https://docs.deno.com/go/minimum-dependency-age) supply-chain gate.38> Within that window use `deno run --minimum-dependency-age=0 -A jsr:@nzip/lofi-node/cli …`39> (`deno x` does not yet accept the override).4041On first start the native iroh layer is downloaded from this repo's GitHub release for the matching42version and sha256-verified against digests pinned inside the package. No Deno at all? Grab a43compiled binary from the [releases](https://github.com/FelineStateMachine/lofi-node/releases) (macOS44arm64 and Linux x86_64; the macOS binary is unsigned — clear quarantine with45`xattr -d com.apple.quarantine lofi-node-*`). Linux aarch64 is pending an upstream jazz-napi46`linux-arm64-gnu` build.4748Or run the container image:4950```sh51docker run --rm -v lofi-node-data:/data ghcr.io/felinestatemachine/lofi-node \52 init --dir /data --port 480253docker run -d --name lofi-node --network host -v lofi-node-data:/data \54 ghcr.io/felinestatemachine/lofi-node55```5657The image is linux/amd64 (arm64 hosts run it under emulation, per the jazz-napi gap above);58[compose.yaml](compose.yaml) is the reference deployment, and59[the deployment guide](https://lofi.host/node/docs/beyond-the-lan) covers networking and persistence60choices.6162As a library:6364```sh65deno add jsr:@nzip/lofi-node66```6768```ts69import { createSyncNode } from "@nzip/lofi-node";7071const node = await createSyncNode({ appId, backendSecret, adminSecret, dataDir: "./data" });72node.url; // -> JAZZ_SERVER_URL for the lofi app73```7475Tutorials (self-hosting, pairing, store provisioning), guides, and reference live at76[lofi.host/node](https://lofi.host/node). The normative contracts stay in this repo:77[docs/app-ticket.md](docs/app-ticket.md) (ticket format, scopes, store-status — with78[conformance fixtures](docs/fixtures/app-ticket-fixtures.json)) and79[docs/hosting-lofi-apps.md](docs/hosting-lofi-apps.md) (validated hosting walkthrough).8081## Developing lofi-node8283```sh84deno task native # build the native addon (Rust; once, or per vendored change)85deno task check # fmt --check + lint + typecheck — the PR gate86deno task test # full suite; iroh/jazz integration auto-skips without the addon87```8889The native layer is a provenance-tracked vendor of upstream90[n0-computer/iroh-ffi](https://github.com/n0-computer/iroh-ffi)'s `iroh-js` crate — see91[native/iroh-js/UPSTREAM.md](native/iroh-js/UPSTREAM.md) for the vendoring contract and92[CONTRIBUTING.md](CONTRIBUTING.md) for boundaries and the release procedure.