Quickstart

From nothing to a fail-closed broker with your first key, first topic, and first record — five minutes on one machine.

1. Download a release (or build from source)

# pick your target; linux-amd64 shown
gh release download v0.6.0 --repo rahulkj/firn --pattern 'firn-v0.6.0-linux-amd64.tar.gz' --pattern 'SHA256SUMS'
shasum -a 256 -c SHA256SUMS              # integrity
gh attestation verify firn-v0.6.0-linux-amd64.tar.gz --repo rahulkj/firn   # SLSA provenance

tar -xzf firn-v0.6.0-linux-amd64.tar.gz  # firnd, firn-cli, README.md, LICENSE (top level)
sudo install -m 0755 firnd firn-cli /usr/local/bin/

2. First boot — fail closed, by design

firnd -data-dir ./data

With zero keys and no escape hatch, nothing but /healthz answers; gRPC returns Unauthenticated everywhere. On the very first start it prints a one-time token to stderr — shown once, never stored:

BOOTSTRAP TOKEN: <64 hex chars, printed once>

3. Mint the first (admin) key

TOKEN=<the hex from stderr>
KEY=$(curl -s -X POST localhost:9460/apikeys \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"root","role":"admin"}' | python3 -c 'import json,sys; print(json.load(sys.stdin)["key"])')
echo "$KEY"   # shown exactly once — save it

That call mints exactly one admin key and voids the bootstrap token. Every later boot enforces auth immediately — nothing else to configure. (For local hacking you can run -dev instead; do not.)

4. Create a topic and produce

# streaming topic, 3 partitions
firn-cli -api-key "$KEY" create-topic --name orders --partitions 3 --mode stream

# produce — key routes to a partition by FNV-64a(key) % 3; unset key = round-robin
firn-cli -api-key "$KEY" produce --topic orders --key k1 --value '{"order":123,"total":42}'

# fetch from partition 1, offset 0
firn-cli -api-key "$KEY" fetch --topic orders --partition 1 --offset 0 --max 10

5. Try the queue path

firn-cli -api-key "$KEY" create-queue --name jobs
firn-cli -api-key "$KEY" produce --topic jobs --key sku-9 --value '{"sku":"sku-9","qty":1}'

# claim up to 5 deliveries with a 30s visibility lease
curl -s -X POST localhost:9460/queues/jobs/pull \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d '{"max_messages":5,"visibility_timeout_ms":30000}'

# ack one (by delivery_id from the pull response)
curl -s -X POST localhost:9460/queues/jobs/ack \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d '{"delivery_id":"d-3f2a9c…"}'

# a message that isn't acked within 3 delivery attempts lands in jobs.dlq
firn-cli -api-key "$KEY" dlq list --queue jobs
firn-cli -api-key "$KEY" dlq redrive --queue jobs   # re-produce back into jobs

6. Look around

open http://localhost:9460/ui/      # read-only dashboard (browser)
firn-cli -api-key "$KEY" groups     # group membership + offsets
firn-cli -api-key "$KEY" list       # topics
curl -s localhost:9460/healthz      # {"status":"ok","version":"0.5.2"} — public

What just happened (and did not)