163 lines
7.7 KiB
Plaintext
163 lines
7.7 KiB
Plaintext
# supplier/.env.example
|
|
#
|
|
# Copy to supplier/.env and fill in real values before `docker compose up`.
|
|
# .env is gitignored — NEVER commit a populated copy.
|
|
#
|
|
# To generate a fresh Ed25519 wallet seed:
|
|
# openssl rand -hex 32
|
|
# Fund the resulting address with ~5 AP3X on Vector testnet via the faucet
|
|
# before running. See deploy/README.md §2.
|
|
#
|
|
# Lines marked SECRET must never be shared, logged, or committed.
|
|
|
|
# ─── Required ─────────────────────────────────────────────────────────────
|
|
|
|
# 64-char hex Ed25519 private key seed for the supplier wallet. SECRET.
|
|
# Generate via: openssl rand -hex 32
|
|
SUPPLIER_PRIV_KEY_HEX=PASTE_64_HEX_CHARS_HERE
|
|
|
|
# Ogmios WebSocket URL. For external hosted Ogmios (recommended for M1-F):
|
|
# wss://ogmios.vector.testnet.apexfusion.org
|
|
# For a local Ogmios container (M1-F-vector-stack follow-up): ws://ogmios:1337
|
|
OGMIOS_URL=wss://ogmios.vector.testnet.apexfusion.org
|
|
|
|
# Ollama HTTP base URL. Inside compose this is the service name.
|
|
OLLAMA_URL=http://ollama:11434
|
|
|
|
# OutputReference of this supplier's on-chain advertisement UTxO.
|
|
# Format: "<64-hex-tx-hash>#<int-output-index>"
|
|
# Posting an advert is a one-shot operation — see deploy/README.md §4.
|
|
ADVERT_REF=PASTE_TXHASH_HERE#0
|
|
|
|
# Cardano network ID. "0" = testnet, "1" = mainnet.
|
|
# IMPORTANT: leave at "0" until ARCHITECTURE.md §9 #5 mainnet safety lands.
|
|
NETWORK_ID=0
|
|
|
|
# ─── Optional ─────────────────────────────────────────────────────────────
|
|
|
|
# HTTP listen port inside the container. Compose maps this to the host.
|
|
PORT=8080
|
|
|
|
# Ollama request timeout (ms). Tiny CPU model on Hetzner CX is slow — keep
|
|
# generous. Increase if you see ollama_timeout reasons in logs.
|
|
OLLAMA_TIMEOUT_MS=120000
|
|
|
|
# ─── Optional — OpenAI-compatible backend (LLM_BACKEND=openai) ────────────
|
|
# Switch the chat job runner to POST /v1/chat/completions at OPENAI_BASE_URL
|
|
# instead of Ollama. Used by the mainnet ChatMock-backed supplier and any
|
|
# hosted OpenAI-compatible API (OpenAI, DeepSeek, etc.).
|
|
# LLM_BACKEND=openai
|
|
# OPENAI_BASE_URL=http://marketplace-mainnet-chatmock:8000 # or https://api.deepseek.com
|
|
# OPENAI_TIMEOUT_MS=180000
|
|
|
|
# OPENAI_API_KEY — optional bearer token. When set, the supplier forwards it
|
|
# as `Authorization: Bearer <key>` on every /v1/chat/completions request.
|
|
# Leave empty for endpoints that don't require auth (ChatMock, other local
|
|
# proxies). REQUIRED for hosted APIs (DeepSeek, OpenAI). SECRET.
|
|
# OPENAI_API_KEY=
|
|
|
|
# ─── Optional (not in supplier/src/config.ts; consumed by index.ts boot) ──
|
|
# Pre-derived public-key + pkh + bech32 address. M1-D will derive these from
|
|
# SUPPLIER_PRIV_KEY_HEX automatically; until then index.ts reads them from
|
|
# env. Tests inject WalletKey directly.
|
|
# SUPPLIER_PUB_KEY_HEX=
|
|
# SUPPLIER_PKH=
|
|
# SUPPLIER_ADDRESS=
|
|
|
|
# ─── Optional — chain provider selection (M1-F-2) ─────────────────────────
|
|
# LIVE_CHAIN: opt-in to real Ogmios submitTx + awaitTx.
|
|
# Default unset = ReadOnlyOgmiosProvider (no real chain writes; safe for dev).
|
|
# Set to literal "1" to enable LiveOgmiosProvider — REAL TESTNET/MAINNET
|
|
# SUBMISSIONS WILL HAPPEN. Any other value (including "true", "yes", "TRUE")
|
|
# is treated as off, by design (safety against misconfiguration).
|
|
LIVE_CHAIN=
|
|
|
|
# ─── tx:post-advert — run once before first deploy (M1-F-3) ───────────────────
|
|
# Execute: pnpm --filter @marketplace/supplier tx:post-advert
|
|
# On success, copy the printed "<txHash>#0" string into ADVERT_REF above.
|
|
|
|
# Capability published in the on-chain advertisement. // added M1-F-3
|
|
ADVERT_CAPABILITY_ID=llm.text.generate.v1
|
|
|
|
# Ollama model name served by this supplier. // added M1-F-3
|
|
ADVERT_MODEL=qwen2.5:0.5b
|
|
|
|
# Maximum output tokens the supplier will honour per request. // added M1-F-3
|
|
ADVERT_MAX_OUTPUT_TOKENS=512
|
|
|
|
# Maximum processing time the supplier guarantees (ms). // added M1-F-3
|
|
ADVERT_MAX_PROCESSING_MS=60000
|
|
|
|
# Flat price per prompt in AP3X lovelace. // added M1-F-3
|
|
ADVERT_PRICE_LOVELACE=2000000
|
|
|
|
# Supplier bond deposited into the advert UTxO (lovelace). // added M1-F-3
|
|
# Default 1_000_000 if omitted.
|
|
ADVERT_SUPPLIER_BOND_LOVELACE=1000000
|
|
|
|
# Buyer bond required per escrow (lovelace). // added M1-F-3
|
|
# Default 1_000_000 if omitted.
|
|
ADVERT_BUYER_BOND_LOVELACE=1000000
|
|
|
|
# HTTPS endpoint buyers will call (must be publicly reachable). // added M1-F-3
|
|
ADVERT_ENDPOINT_URL=https://mp-supplier.vector.testnet.apexfusion.org
|
|
|
|
# Optional off-chain detail pointer (IPFS / HTTPS URI). // added M1-F-3
|
|
# Leave empty for v1 if no extended metadata is published.
|
|
ADVERT_DETAIL_URI=
|
|
|
|
# Optional sha256 of the detail JSON (64 hex chars). // added M1-F-3
|
|
# If empty, defaults to sha256("") =
|
|
# e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
|
ADVERT_DETAIL_HASH=
|
|
|
|
# ─── Optional: CIP-33 reference scripts ───────────────────────────────────
|
|
# Saves witness-set fee on script-spending txs (Claim, Submit, Accept,
|
|
# Reclaim, RetireAdvert) by referencing on-chain script UTxOs instead of
|
|
# inlining the full validator CBOR. Leave unset to use inlined scripts
|
|
# (current behavior).
|
|
#
|
|
# Publish the two reference UTxOs (one-shot; uses SUPPLIER_PRIV_KEY_HEX +
|
|
# OGMIOS_URL + NETWORK_ID from this env file):
|
|
# docker compose -f deploy/testnet/docker-compose.supplier.yml run --rm \
|
|
# --entrypoint sh supplier \
|
|
# -c "node_modules/.bin/tsx supplier/src/cli/publish-reference-scripts.ts"
|
|
# Paste the two printed refs here AND into buyer/.env, then
|
|
# `docker compose down && up -d` to apply.
|
|
# ESCROW_REF_UTXO=<txhash>#0
|
|
# ADVERT_REF_UTXO=<txhash>#1
|
|
|
|
# ─── Optional: chat-session tuning (CAPABILITY_KIND=chat-session only) ─────
|
|
# CHAT_IDLE_TIMEOUT_MS=300000 # auto-end sessions idle this long
|
|
# MAX_CHAT_SESSIONS=1 # concurrent session slots (default 1)
|
|
# CHAT_SETTLE_MODE=full # "full" (Claim/Submit) or "ticket" (no supplier
|
|
# # chain ops; buyer reclaims the Open escrow)
|
|
|
|
# ─── Autonomous Surplus seller (surplus:start) ────────────────────────────
|
|
# This service uses a seller-scoped Surplus key. It does not need a wallet
|
|
# private key. Keep both API keys in the host-only surplus-seller.env file.
|
|
SURPLUS_LIVE=
|
|
SURPLUS_API_URL=https://api.surplusintelligence.ai
|
|
SURPLUS_SELLER_API_KEY=si_seller_REPLACE_ME
|
|
SURPLUS_OPENROUTER_API_KEY=sk-or-v1-REPLACE_ME
|
|
SURPLUS_PROVIDER_BASE_URL=https://openrouter.ai/api/v1
|
|
OPENROUTER_CAPACITY_BASE_URL=https://openrouter.ai/api
|
|
SURPLUS_SELLER_WALLET=0x0000000000000000000000000000000000000000
|
|
SURPLUS_PAYOUT_ADDRESS=0x0000000000000000000000000000000000000000
|
|
# The controller discovers all fixed-price text models and selects one by
|
|
# current demand. It keeps only one active offer. At the default 490 bps
|
|
# recovery floor, a $0.05 seller cap bounds upstream spend near $1.02 per day.
|
|
SURPLUS_PER_OFFER_CAP_USD=0.05
|
|
SURPLUS_AGGREGATE_CAP_USD=0.05
|
|
SURPLUS_OPENROUTER_RESERVE_USD=1.00
|
|
SURPLUS_OPENROUTER_MAX_LIMIT_USD=20.00
|
|
SURPLUS_MIN_RECOVERY_BPS=490
|
|
SURPLUS_UNDERCUT_BPS=10
|
|
SURPLUS_MAX_CANDIDATE_ORDER_BOOKS=10
|
|
SURPLUS_REPRICE_INTERVAL_MS=300000
|
|
SURPLUS_REQUEST_TIMEOUT_MS=120000
|
|
# 0 keeps selling. 1 pauses after the first trade or one offer-cap of spend.
|
|
SURPLUS_STOP_AFTER_SETTLED_REQUESTS=0
|
|
SURPLUS_SETTLED_STATUSES=confirmed
|
|
SURPLUS_STATE_PATH=/var/lib/surplus-manager/state.json
|