M1-F: end-to-end LLM marketplace lifecycle on Vector testnet
Bonded-escrow marketplace for prompt → response between buyers and
local-LLM suppliers, settling on Vector (UTxO) via Aiken Plutus V3
validators. Lifecycle PostEscrow → Claim → Submit → Accept proven on
Vector testnet 2026-05-06; AcceptEscrow tx 125e3cfe…7dc100d distributes
payment + bonds per the validator's distribution rule.
Workspace layout (pnpm + TypeScript):
contracts/marketplace/ Aiken validators (advert + escrow) + plutus.json
packages/shared/ Tx-builders (lucid-evolution), CBOR codecs,
chain providers (mock / read-only / live Ogmios)
supplier/ OpenAI-compatible HTTP node (Ollama by default;
vLLM / llama.cpp / OpenRouter / OpenClaw all
swap-in via OLLAMA_URL); 202+poll chat handler
buyer/ Express + React SPA; server-side runs the full
chain lifecycle via /v1/submit-prompt and
/v1/accept; SPA never holds the buyer key
indexer/ Chain-follower (extends apex-dashboard pattern),
SSE event stream + REST queries
indexer-ui/ Operator dashboard (events + suppliers + escrow
lookup)
tests/ 1098 vitest unit + integration tests (10 skipped
under M1-F-D-defer for UPLC test plumbing)
deploy/testnet/ Per-service docker-compose for the Hetzner stack
docs/EXECUTIVE_SUMMARY.* Marp deck (PDF + PPTX) — 11 slides, mermaid
diagrams pre-rendered for portable export
docs/CLOUDFLARE_WAF_BYPASS.md CF Skip-rule runbook for /v1/* paths
docs/ARCHITECTURE.md canonical spec
Live demo (testnet, 2026-05-06):
https://mp-buyers.vector.testnet.apexfusion.org (buyer SPA)
https://mp-suppliers.vector.testnet.apexfusion.org (supplier API)
https://mp-indexer.vector.testnet.apexfusion.org (indexer + UI)
This commit is contained in:
49
tests/fixtures/supplier-side/sample-config.ts
vendored
Normal file
49
tests/fixtures/supplier-side/sample-config.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Supplier-side sample config fixture — M1-C RED phase
|
||||
*
|
||||
* Provides a deterministic SupplierConfig for test injection.
|
||||
* Built INDEPENDENTLY from buyer-side fixtures. No shared helpers.
|
||||
*/
|
||||
|
||||
import type { SupplierConfig } from "../../../supplier/src/config.js";
|
||||
import { SUPPLIER_PKH, SUPPLIER_PRIVATE_KEY_HEX } from "./wallet-keys.js";
|
||||
|
||||
/** The advert UTxO that this supplier's config points at. */
|
||||
export const SAMPLE_ADVERT_TX_HASH = "b".repeat(64);
|
||||
export const SAMPLE_ADVERT_INDEX = 0;
|
||||
|
||||
/** A deterministic valid 64-char hex tx hash for use in escrow refs. */
|
||||
export const SAMPLE_ESCROW_TX_HASH = "f".repeat(64);
|
||||
|
||||
/** Full supplier config used in route handler tests. */
|
||||
export function buildSampleConfig(): SupplierConfig {
|
||||
return {
|
||||
supplierPrivKeyHex: SUPPLIER_PRIVATE_KEY_HEX,
|
||||
ogmiosUrl: "ws://localhost:1337",
|
||||
ollamaUrl: "http://localhost:11434",
|
||||
advertRef: {
|
||||
txHash: SAMPLE_ADVERT_TX_HASH,
|
||||
index: SAMPLE_ADVERT_INDEX,
|
||||
},
|
||||
networkId: 0,
|
||||
port: 8080,
|
||||
ollamaTimeoutMs: 120_000,
|
||||
liveChain: false,
|
||||
};
|
||||
}
|
||||
|
||||
/** Env map matching the sample config above, for loadConfig() unit tests. */
|
||||
export function buildSampleEnv(): Record<string, string> {
|
||||
return {
|
||||
SUPPLIER_PRIV_KEY_HEX: SUPPLIER_PRIVATE_KEY_HEX,
|
||||
OGMIOS_URL: "ws://localhost:1337",
|
||||
OLLAMA_URL: "http://localhost:11434",
|
||||
ADVERT_REF: `${SAMPLE_ADVERT_TX_HASH}#${SAMPLE_ADVERT_INDEX}`,
|
||||
NETWORK_ID: "0",
|
||||
PORT: "8080",
|
||||
OLLAMA_TIMEOUT_MS: "120000",
|
||||
};
|
||||
}
|
||||
|
||||
/** The pkh embedded in the sample config. */
|
||||
export { SUPPLIER_PKH };
|
||||
Reference in New Issue
Block a user