- Secure secrets: gitignored ~/pyre/.env (chmod 600) loaded into the API via
`node --env-file-if-exists`; keys never committed/logged/returned. .env.example
documents the vars. Free-first default (text=gemini, image=pollinations).
- @pyre/config: provider selection + key fields.
- @pyre/prometheus: real providers via fetch (no SDK deps) — Gemini/Anthropic/
OpenAI text, Pollinations(free)/fal/DeepInfra/Replicate image, OpenAI moderation;
`createProviders()` factory selects by config + key presence, falls back to stub.
29 tests.
- @pyre/api: /api/prometheus/generate builds providers from config; keys never logged.
Live-verified end-to-end: admin-gated generate returned a real Spawn ("Ashen
Golem"/$AGOL) with a Pollinations image on the $0 stub-text+free-image stack;
.env-loaded admin token enforced. typecheck 8/8, 150 tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72 lines
3.8 KiB
Plaintext
72 lines
3.8 KiB
Plaintext
# ============================================================================
|
|
# PYRE / Prometheus Protocol — environment template
|
|
# Copy to .env (per app) and fill in. NEVER commit a real .env.
|
|
#
|
|
# CORE TRUST RULE: PYRE never holds private keys. There is intentionally NO
|
|
# wallet private key / mnemonic variable anywhere in this file. All signing
|
|
# happens client-side in the user's wallet.
|
|
# ============================================================================
|
|
|
|
# ---- Solana ----------------------------------------------------------------
|
|
# Use an external RPC provider (Helius, Triton, QuickNode, etc.).
|
|
# Do NOT run a validator/RPC node on the MVP VPS.
|
|
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
|
|
SOLANA_RPC_WS_URL=
|
|
SOLANA_CLUSTER=mainnet-beta # mainnet-beta | devnet | testnet
|
|
|
|
# ---- Database (PostgreSQL) -------------------------------------------------
|
|
DATABASE_URL=postgresql://pyre:pyre@localhost:5432/pyre
|
|
|
|
# ---- Redis (queues, cache, rate limiting) ----------------------------------
|
|
REDIS_URL=redis://localhost:6379
|
|
|
|
# ---- AI services (Prometheus) ----------------------------------------------
|
|
# API-based only for MVP. Do NOT run local LLMs/image models on the server.
|
|
# Keys live ONLY in the gitignored ~/pyre/.env (chmod 600), loaded by the API at
|
|
# runtime — never in this committed template, never in git.
|
|
#
|
|
# Provider selection (free-first default): text=gemini (free tier), image=
|
|
# pollinations (free, keyless). Falls back to a deterministic stub when a key is
|
|
# missing, so generation always runs.
|
|
PROMETHEUS_TEXT_PROVIDER=stub # gemini | anthropic | openai | stub
|
|
PROMETHEUS_IMAGE_PROVIDER=stub # pollinations | fal | deepinfra | replicate | stub
|
|
GEMINI_API_KEY= # free tier — aistudio.google.com/apikey
|
|
ANTHROPIC_API_KEY=
|
|
OPENAI_API_KEY= # also enables the free omni-moderation pass
|
|
FAL_KEY= # fal.ai (FLUX schnell ~$0.003/img)
|
|
DEEPINFRA_API_KEY= # cheapest image (~$0.0005/img)
|
|
REPLICATE_API_TOKEN= # FLUX schnell ~$0.003/img
|
|
PINATA_JWT= # IPFS upload of Spawn image + metadata
|
|
|
|
# ---- App URLs / ports ------------------------------------------------------
|
|
WEB_PORT=3000
|
|
API_PORT=4000
|
|
WEB_PUBLIC_URL=http://localhost:3000
|
|
API_PUBLIC_URL=http://localhost:4000
|
|
|
|
# ---- Admin / security ------------------------------------------------------
|
|
ADMIN_API_TOKEN= # protects /admin endpoints
|
|
RATE_LIMIT_SCAN_PER_MIN=10
|
|
|
|
# ---- Classification safety thresholds --------------------------------------
|
|
PROTECTED_USD_THRESHOLD=50 # skip tokens valued above this (USD)
|
|
MAX_PRICE_IMPACT_BPS=300 # skip swap routes above this impact
|
|
QUOTE_MAX_AGE_MS=15000 # skip stale quotes older than this
|
|
|
|
# ---- Protocol fee (§3.1) — transparent, in-tx, non-custodial ---------------
|
|
# The treasury receives ONLY the fee SOL (never user funds). Swap it for a
|
|
# multisig before real volume. The fee is shown in the preview before signing.
|
|
# IMPORTANT: fund the treasury once to rent-exemption (>= ~0.0009 SOL) BEFORE it
|
|
# collects fees — a fee transfer that would leave a 0-balance account below the
|
|
# rent-exempt minimum fails the whole tx ("insufficient funds for rent").
|
|
PYRE_TREASURY_WALLET=122CNV5ZLu6fqZFpEMUdUSQwDv2zs23pkYQhkNtSQk5k
|
|
PYRE_FEE_BPS=500 # 5% of reclaimed rent
|
|
PYRE_SWAP_FEE_BPS=100 # 1% on swaps (proceeds still go to user)
|
|
PYRE_MAX_CONTRIBUTION_BPS=5000 # cap on the optional "feed more" extra (50%)
|
|
|
|
# ---- Optional: metadata / launch (later phases) ----------------------------
|
|
IPFS_OR_ARWEAVE_ENDPOINT=
|
|
IPFS_OR_ARWEAVE_TOKEN=
|
|
# Public key only — the operator signs Pump.fun launches manually in MVP.
|
|
PUMPFUN_CREATOR_WALLET_PUBKEY=
|