NATS-compatible server with JetStream, written in MoonBit
Status: core NATS server is working. A client can connect, authenticate, PING/PONG, SUB, PUB/HPUB, and receive MSG/HMSG, including wildcard and queue-group subscriptions. The server enforces payload/control line/connection limits, serves /varz, /connz, /subsz and /healthz, and has a CLI with auth and monitoring flags. JetStream and KV are the next milestones. The plan and scope are tracked in docs/acceptance.md.
| Area | v1 |
|---|---|
| Core NATS | protocol listed above, headers, wildcards, queue groups, auth, limits, monitoring |
| JetStream | single-node streams, retention, dedupe, push/pull consumers, ACK/NAK/WPI/TERM, KV (next) |
| Interfaces | moonnatsd CLI, JSON status, monitoring endpoints |
| Out of scope | clustering/Raft, leaf nodes, gateways, JWT/nkey, multi-tenancy, mirrors/sources, object store, encryption at rest |
moon check --deny-warn
moon test --target wasm-gc # pure core, no native toolchain required
moon test --target native # protocol, auth and TCP integration tests
moon run cmd/moonnatsd # listens on 127.0.0.1:4222moon run cmd/moonnatsd -- --token secret --monitor-port 8222
curl -s http://127.0.0.1:8222/varz
nats -s nats://127.0.0.1:4222 --auth-token secret pub hello worldnats -s nats://127.0.0.1:4222 sub hello
nats -s nats://127.0.0.1:4222 pub hello worldsrc/core pure protocol model, header/CONNECT parsing, subject trie, stats
src/server native listener/connection runtime, auth, monitoring
src/store WAL/block storage and recovery (planned)
src/jetstream stream/consumer state machines (planned)
src/kv KV facade over JetStream (planned)
src/cli argument parsing and command lineInstall
Download zipNATS-compatible server with JetStream, written in MoonBit