Add stamp-monitor; move Bee to 2.8.1

This is the config that was already running on the host, brought back
into the repo where it belongs, plus the Bee bump it implies.

stamp-monitor watches prod_bee's postage batches and renews them before
they lapse. It exists because nothing did: the gateway's batch fell under
minTtlDays, the gateway tried to renew it itself, the top-up (64.64 xBZZ
on a depth-24 batch) exceeded the wallet, and the throw took down every
route that boots the gateway context. A batch running out was never
supposed to be able to return 500 on /v1/models.

It runs next to Bee rather than reading the chain from elsewhere because
bucket fullness is not on-chain -- stamps are off-chain signatures, so
only a node that saw them knows how full a batch is. A batch can be fully
funded and still refuse writes, and that is the failure the chain cannot
show you.

Bee 2.8.0 -> 2.8.1 for a related reason: 2.8.0 omits utilizationRatio
from /stamps, so a batch at 215 of 256 reported as empty. An absent
number read as zero, and zero means "plenty of room" -- fullness alerts
would have stayed quiet on exactly the batch that needed them. The
monitor now derives the figure either way, but the node should not be the
thing lying. Digest-pinned: this node holds a chequebook and a stake.

BEE_STAMP_MANAGE defaults to false in the example now, and the batch ID
is pinned. Leaving the managed path reachable is what caused the outage,
and an empty BEE_POSTAGE_BATCH_ID is what re-enables it.

The dashboard is deliberately not routed through Traefik -- it can spend
xBZZ. Readme documents the tunnel instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLYiaPYror1vLKApYKrxTu
This commit is contained in:
Felix FaerberandClaude Opus 5 committed 2026-08-19 01:57:18 +03:00
1 parent 7fcd9df9d3
commit b4c62905e6
3 files changed
+113 -5

No files matched your search

+15 -2
View File
@@ -18,9 +18,16 @@ ESCROW_ADDRESS=0x34Db8E014E71928f17E23eC1272B602582222c9c
XBZZ_ADDRESS=0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da
# --- Bee node ---
# Postage batch is bought once on first deploy and stored in bee-data volume.
# Pin the batch explicitly. It used to be bought on first deploy and left to
# the gateway to manage, which is how the outage happened: the batch fell
# under minTtlDays, the gateway tried to renew it, the renewal cost more xBZZ
# than the wallet held, and the throw took down every route that boots the
# gateway context. Renewal now belongs to stamp-monitor, which has spend caps
# and alerts; the gateway just uses the batch it is given.
#
# Must be set. An empty value here is what re-enables the path above.
BEE_POSTAGE_BATCH_ID=
BEE_STAMP_MANAGE=true
BEE_STAMP_MANAGE=false
BEE_STAMP_LABEL=hosted-gateway
BEE_STAMP_TTL_DAYS=30
@@ -38,3 +45,9 @@ LOG_LEVEL=info
# --- Phase 2 (Stripe) — leave blank in v1 ---
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# --- stamp-monitor ---
# Bearer token for the monitor's dashboard and admin API. That UI can spend
# xBZZ (manual top-up), so treat it as a spending credential, not a viewer
# login. Generate with `openssl rand -hex 32`; never commit the real value.
STAMP_MONITOR_ADMIN_TOKEN=change-me