2025-09-24 10:57:22 +02:00
# Podman Staging Environment
2025-10-02 14:37:59 +02:00
The Podman stack mirrors `scripts/dev.sh` using long-lived containers. Every boot spins up a fresh Base Sepolia fork, redeploys contracts, seeds liquidity, and launches the live-reload services behind Caddy on port 80.
2025-09-24 10:57:22 +02:00
## Service Topology
- `anvil` – Base Sepolia fork with optional mnemonic from `onchain/.secret.local`
- `bootstrap` – one-shot job running `DeployLocal.sol` , seeding liquidity, priming blocks, and writing shared env files
- `ponder` – `npm run dev` for the indexer (port 42069 inside the pod)
- `frontend` – Vite dev server for `web-app` (port 5173 inside the pod)
- `txn-bot` – automation loop plus Express status API (port 43069 inside the pod)
2025-10-11 10:55:49 +00:00
- `caddy` – front door at `http://<host>:80` , routing `/api/graphql` , `/health` , `/api/rpc` , and `/api/txn` to the internal services
2025-09-24 10:57:22 +02:00
All containers mount the repository so code edits hot-reload exactly as the local script. Named volumes keep `node_modules` caches between restarts.
## Prerequisites
- Podman 4.x (rootless recommended)
- `podman-compose`
## Launching
```bash
podman-compose -f podman-compose.yml build
podman-compose -f podman-compose.yml up
```
- First run takes several minutes while Foundry installs deps, deploys contracts, and runs the seeding transactions.
- Use `podman-compose down` to stop. Bring-up always redeploys and rewrites `services/ponder/.env.local` plus `tmp/podman/txnBot.env` .
### Access Points (via Caddy)
- Frontend: `http://<host>/`
2025-10-11 10:55:49 +00:00
- GraphQL: `http://<host>/api/graphql`
- RPC passthrough: `http://<host>/api/rpc`
- Txn bot status: `http://<host>/api/txn/status`
2025-09-24 10:57:22 +02:00
## Configuration Knobs
Set environment variables before `podman-compose up` :
- `FORK_URL` – Anvil upstream RPC (defaults to `https://sepolia.base.org` )
- `DEPLOYER_PK` , `DEPLOYER_ADDR` – override deployer wallet; otherwise derived from `.secret.local` or Foundry defaults
- `TXNBOT_PRIVATE_KEY` , `TXNBOT_ADDRESS` , `TXNBOT_FUND_VALUE` – customise bot signer and funding
Edit `containers/Caddyfile` if you need different routes or ports.
## Known Limitations
- State is ephemeral; every restart wipes the fork and redeploys contracts.
- Processes run in dev/watch mode (`npm run dev` ), so staging traffic is not production hardened.
- Secrets live in env files inside the repo mount because no external secret store is wired in.