Automated Tests
just test runs unit tests plus integration tests against Postgres and Redis
(started automatically if not already running). Neither task runs the E2E suites in
buzz-test-client — those are marked #[ignore] and require a running relay:
Live Local Relay
The fastest way to exercise the relay end-to-end is to build the release binaries once, runbuzz-relay, and drive it with the buzz CLI. The
CLI signs every request with NIP-98, so you don’t need nak or hand-rolled
curl.
1. Setup
Already running Buzz Desktop? Desktop uses the same Docker container names (buzz-postgres,buzz-redis) and the same default ports (:5432,:6379).just setupwill reuse those services, so your test relay writes into Desktop’s database. That’s fine for read/write smoke tests, but:just resetwipes Desktop’s data along with yours. If you need isolation, stop Desktop first or run the dev stack on a different Compose project (COMPOSE_PROJECT_NAME=buzz-dev docker compose …).
just reset wipes all local data and starts over — including Buzz
Desktop’s data if its services are sharing your dev stack (see callout
above).
Heads up — scrub stale env first. If your shell inherits any ofBUZZ_AUTH_TAG,BUZZ_RELAY_URL, orBUZZ_PRIVATE_KEYfrom a prior session (or a staging config),unsetthem before continuing. A staleBUZZ_AUTH_TAGfails the local dev relay withauth_error: signature verification failedon the first CLI write — it is not tolerated.
2. Build the binaries
3. Start the relay
In a separate terminal (it runs in the foreground):Health/readiness/liveness live on a separate port (defaultThe relay starts in dev mode (8080,BUZZ_HEALTH_PORT) so K8s probes bypass auth middleware. The main app port also exposes/healthfor convenience.
BUZZ_REQUIRE_AUTH_TOKEN=false). The startup
log emits a WARN about this — that’s expected for local testing. See the env
vars table at the bottom if you need to lock it down.
Already running Buzz Desktop (or another relay) on:3000/:8080/:9102? Buzz binds three ports — main, health, metrics — and any of them can collide. Use a separate terminal per role and export the right vars in each: In the relay terminal (before launchingbuzz-relay):In your working / CLI terminal (for steps 4+ and the ACP harness):Every snippet later in this doc shows the defaults. When you seelocalhost:3000/:8080in a code block, mentally substitute your overrides — or the CLI will end up talking to Buzz Desktop’s relay.
IgnoreWhen you’re done, stop the relay (Ctrl-C in its terminal). If it’s backgrounded or you lost the terminal:just setup’s “Next steps” banner. It still printsjust relay(a debug build). Usebuzz-relayfrom step 2 here — step 2 already built the release binary.
pkill -f buzz-relay. Leaving
it running will collide with the next reviewer who follows this doc on
the same machine.
4. Smoke test the CLI against the relay
End-to-end: generate an identity, create a channel, post a message, read it back. This is the minimum sequence an agent needs to verify a local relay.{"event_id":"…","accepted":true,"message":""} for
the send, and the message body in the get output. thread returns []
for a leaf message — populated only after a reply comes in (see §5).
5. Going deeper
For full coverage of every CLI command (54 subcommands across 12 groups), followcrates/buzz-cli/TESTING.md.
The relay’s HTTP bridge accepts three endpoints — useful if you’re testing
a client other than buzz-cli:
All three accept NIP-98 auth (recommended) or, in dev mode, an
X-Pubkey
header fallback. There is no REST API for fetching message threads — use
POST /query with an #e filter, or buzz messages thread.
ACP Harness (optional, end-to-end with a real agent)
buzz-acp connects an ACP-speaking agent (goose, codex, claude code,
buzz-agent) to the relay. The harness listens for events, drives the
agent over stdio, and the agent replies through MCP tools.
Minimum recipe — assumes the relay from step 3 is running and the channel
$CHANNEL from step 4 still exists. The agent identity must be different
from the sender identity (BUZZ_ACP_RESPOND_TO=anyone still skips events
the agent signed itself).
Using a different ACP agent? The default recipe assumesIf you started the agent before adding it to the channel, just run thegooseis on$PATHand configured (goose --versionshould print). For codex / claude code / buzz-agent, setBUZZ_ACP_AGENT_COMMANDandBUZZ_ACP_AGENT_ARGSaccordingly — seecrates/buzz-acp/README.md. Without these, buzz-acp will fail to spawn the agent subprocess on startup.
add-member afterwards — it picks up the membership notification live and
subscribes without restart (membership notification: subscribing to new channel …).
The justfile also ships just goose key="$AGENT_NSEC" (foreground) and
just goose-bg key="$AGENT_NSEC" (background screen session) which set the
same env. See crates/buzz-acp/README.md for parallel agents, heartbeats,
respond-to gates, and forum subscriptions.
To exercise deferred ACP startup, add BUZZ_ACP_LAZY_POOL=true before launching
buzz-acp. The harness should connect, authenticate, subscribe, and publish
online presence without starting the configured ACP child. The first accepted,
flushable mention should start exactly one child and then dispatch the queued
message. Automated coverage in pool_lifecycle_state pins single-wake,
retry/backoff, and stale-result behavior; it does not replace this real
relay/process smoke test.
Send the agent a task — switch your shell back to the sender identity
from step 4 and @mention the agent:
buzz messages thread --channel <id> --event <event_id> fetches the reply chain for a specific mention.
Configuration reference
The relay reads all configuration from environment variables. Defaults work out of the box withjust setup or just relay. Common overrides:
CLI-side, only two matter for testing: