b4c62905e6f2b57b61f3d7a5c09cc4b4055af751
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
DevOps
This repo manages the two environments for the Token4Token hosted gateway:
local/— docker-compose files for running development and testing environments locally. Tests run inside Docker, no host-side Bun needed.hostinger/— Docker Swarm stack files for the remote production cluster on Hostinger.
The layout mirrors cipherdolls/devops.
Local development
cd local
make up # bring the dev stack up (postgres, redis, bee, anvil, api, worker)
make logs # tail
make down # clean shutdown
The dev compose mounts ../../hosted-gateway/src so file changes hot-reload
inside the container (bun run --watch).
Local testing
Every E2E spec runs inside Docker against a fresh stack (anvil fork of Gnosis, deployed contracts, a t4t-provider container against a stub Ollama).
cd local
make test SPEC=accounts # run one spec
make test-all # run every spec sequentially
make test brings up postgres + redis + anvil + bee + t4t-provider + hosted
api + worker, then runs the bun test container against them. After the run
it tears everything down (-v --remove-orphans).
Hostinger / production
Stack files in hostinger/ are applied via docker stack deploy from the CI
pipeline. Not relevant for local development.
Languages
Makefile
77.2%
TypeScript
18.7%
Dockerfile
4.1%