Adds a Codex/ChatGPT backend path for the supplier alongside the
existing Ollama one. The mainnet supplier is repointed at a localhost
ChatMock proxy (RayBytes/ChatMock, pinned :v1.35) that authenticates
against a ChatGPT Pro subscription via OAuth.
- supplier/src/openai.ts: HTTP client for OpenAI-compatible
/v1/chat/completions. Same return shape as ollama.callOllama so
jobRunner can branch cleanly.
- supplier/src/jobRunner.ts: branch on config.llmBackend.
- supplier/src/config.ts: LLM_BACKEND ("ollama" default | "openai"),
OPENAI_BASE_URL, OPENAI_TIMEOUT_MS (default 180_000 — GPT first-token
latency).
- supplier/src/cli/gen-keypair.ts: standalone Ed25519 keypair generator
+ bech32 address derivation. Used to bootstrap a fresh supplier
wallet without round-tripping through tx:post-advert --dry-run.
- deploy/mainnet/docker-compose.chatmock.yml: long-running chatmock
serve + one-shot --profile login flow.
- deploy/mainnet/docker-compose.supplier.yml: rewritten for openai
backend; Traefik routes at mp-suppliers-gpt.vector.apexfusion.org so
the unsuffixed slot stays free for a future supplier with a
different backend.
- tests/unit/supplier-openai.test.ts: unit coverage for callOpenAi.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
72 lines
2.6 KiB
YAML
72 lines
2.6 KiB
YAML
# deploy/mainnet/docker-compose.supplier.yml — Supplier — MAINNET (ChatGPT/Codex backend)
|
|
#
|
|
# This compose runs the mainnet supplier with LLM_BACKEND=openai pointed at
|
|
# the ChatMock localhost proxy (see docker-compose.chatmock.yml). Traefik
|
|
# routes at mp-suppliers-gpt.vector.apexfusion.org so the unsuffixed
|
|
# mp-suppliers.* slot remains free for a future supplier with a different
|
|
# backend.
|
|
#
|
|
# Pre-flight networks (must already exist):
|
|
# docker network create marketplace-mainnet-net # one-shot
|
|
# # traefik-net is created by the Traefik project
|
|
#
|
|
# Pre-flight services:
|
|
# docker compose -f docker-compose.chatmock.yml up -d chatmock
|
|
# # then run the --profile login flow once to seed OAuth tokens in
|
|
# # the chatmock_data volume — see chatmock compose header for details
|
|
|
|
name: marketplace-mainnet-supplier
|
|
|
|
services:
|
|
supplier:
|
|
build:
|
|
context: ../..
|
|
dockerfile: supplier/Dockerfile
|
|
container_name: marketplace-mainnet-supplier
|
|
restart: unless-stopped
|
|
env_file:
|
|
- path: ../../supplier/.env
|
|
required: false
|
|
environment:
|
|
LLM_BACKEND: openai
|
|
OPENAI_BASE_URL: http://marketplace-mainnet-chatmock:8000
|
|
OPENAI_TIMEOUT_MS: "180000"
|
|
PORT: "8080"
|
|
# Enable LiveOgmiosProvider so submitTx/awaitTx actually broadcast.
|
|
# Mirrors the testnet supplier compose; without this the supplier
|
|
# silently falls back to ReadOnlyOgmiosProvider and Claim/Submit
|
|
# never reach chain.
|
|
LIVE_CHAIN: "1"
|
|
# NETWORK_ID and OGMIOS_URL intentionally not pinned here — they MUST
|
|
# come from the operator-provided supplier/.env on a mainnet host.
|
|
# Setting them via compose would be a footgun: a stray re-up on
|
|
# testnet hardware could silently re-tag the supplier as mainnet.
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/healthz >/dev/null || exit 1"]
|
|
interval: 20s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
networks:
|
|
- marketplace-mainnet-net
|
|
- traefik-net
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=traefik-net"
|
|
- "traefik.http.routers.mp-suppliers-gpt-mainnet.entrypoints=web"
|
|
- "traefik.http.routers.mp-suppliers-gpt-mainnet.rule=Host(`mp-suppliers-gpt.vector.apexfusion.org`)"
|
|
- "traefik.http.services.mp-suppliers-gpt-mainnet.loadbalancer.server.port=8080"
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
networks:
|
|
marketplace-mainnet-net:
|
|
external: true
|
|
name: marketplace-mainnet-net
|
|
traefik-net:
|
|
external: true
|
|
name: traefik-net
|