mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
Document dex-api-server's actual architecture: it is the single-process, in-memory-orderbook daemon. There is no consensus binding — the orderbook finalises orders synchronously inside OrderBook.AddOrder, so a single- validator self-loop on top would only add latency. Multi-node consensus lives in cmd/dag-network (build tag zmqtest), not here. Add cmd/dex-api-server/standalone_test.go behind the integration build tag. It builds the daemon, places a limit order via /api/order, and confirms the orderbook is queryable end-to-end. Run: go test -tags=integration ./cmd/dex-api-server/... -count=1 -timeout 60s Output: PASS — TestStandalonePlaceOrderRoundTrip (1.89s) Architectural note: the audit asked for a Quasar self-loop here. Honest assessment in the README — that loop would be redundant in a single process. The real refactor (one binary, --peers flag, both modes) is a separate piece of work that requires clean interfaces between the two orderbook implementations.