# Flamethrower
A small Rust project that composes two crates—`power_house` and (optionally) `pent_house`—to produce a deterministic cognition ledger. There are no third‑party dependencies; everything else is standard library code.
## Quickstart
```bash
# Build in educational mode (default feature)
cargo build
# Run the HTTP service
FLAME_PORT=8080 FLAME_LEDGER=./ledger.db ./target/debug/flamethrower
# Mint a shard (label, seed)
printf "GET /mint?label=aurora&seed=4242 HTTP/1.1\r\nHost: localhost\r\n\r\n" | nc 127.0.0.1 8080
# Ingest a shard (paste values from /mint)
printf "GET /ingest?label=aurora&seed=4242&checksum=123 HTTP/1.1\r\nHost: localhost\r\n\r\n" | nc 127.0.0.1 8080
# Health and metrics
printf "GET /healthz HTTP/1.1\r\nHost: localhost\r\n\r\n" | nc 127.0.0.1 8080
printf "GET /metrics HTTP/1.1\r\nHost: localhost\r\n\r\n" | nc 127.0.0.1 8080
```
### Commercial feature
The `commercial` feature enables `pent_house` integration and is intended for properly licensed, commercial use.
```bash
export FLAME_ALLOW_COMMERCIAL=1 # explicit opt-in
cargo build --features commercial
```
## What it does
- Mints a shard deterministically from `(label, seed)`
- Re-verifies shards during ingestion using `power_house`
- Maintains an append-only ledger with a cumulative digest
- Exposes `/healthz` and `/metrics` on a minimal HTTP server (std::net)
## Troubleshooting
- “Refusing commercial mode”: set `FLAME_ALLOW_COMMERCIAL=1` and ensure you have the appropriate license.
- “Verification failed”: shard was modified or the version of `power_house` does not match.
- Port already in use: change `FLAME_PORT`.