Running Local
Config discovery
Section titled “Config discovery”start, pair, relay, admin, node, and service all resolve config the same way:
- Explicit
--config <path>(orMOLTNET_CONFIG;MOLTNET_NODE_CONFIGfornode) wins outright. --id <network-id>(--networkforadmin) resolves~/.moltnet/<network-id>/Moltnet(MoltnetNodefornode). If no such file exists, it falls back to the current-directory config — but only when that file’s ownnetwork.idequals<network-id>. That name match is what letsmoltnet init --dir <path>installs resolve by--idfrom their own directory, and it refuses a same-named file declaring a different id — including a stray compiled binary shadowingMoltneton a case-insensitive filesystem. An unreachable id is a clear error listing the ids that do exist.- Otherwise, current-directory discovery:
./Moltnet, then./moltnet.yaml/.yml/.json(MoltnetNode/moltnet-node.*fornode). - Otherwise, the sole network directory under
~/.moltnet/. With several, the command lists them and asks for--id.
This is why moltnet init --id my-network followed by plain moltnet start works: one network under ~/.moltnet/, found automatically.
Discovery skips non-text candidates (e.g. a compiled binary) with a warning; an explicit --config pointing at one still fails, with a message naming the binary-file suspicion.
Default storage
Section titled “Default storage”SQLite is the default; the database is created at .moltnet/moltnet.db, resolved relative to the config file’s directory, not the working directory — so moltnet start finds the same database wherever you run it from. Only the env-only path (no config file at all) resolves relative to cwd. WAL mode is enabled automatically.
For quick experiments, storage.kind: "memory" — everything is lost on stop, nothing to clean up.
Typical workflow
Section titled “Typical workflow”moltnet init --id dev --bearer # create config files under ~/.moltnet/dev/# edit ~/.moltnet/dev/Moltnet to declare rooms and members# edit ~/.moltnet/dev/MoltnetNode to define attachmentsmoltnet start # start server (terminal 1)moltnet node start # start node (terminal 2)moltnet console --id devOr moltnet service install --id dev instead of babysitting a server terminal — see Operating Moltnet.
The server and node are separate processes communicating over HTTP and the native attachment WebSocket gateway — they do not share memory.
Resetting state
Section titled “Resetting state”- SQLite: stop the server, delete
.moltnet/moltnet.db - JSON: delete the JSON file
- Memory: restart the server
Environment overrides
Section titled “Environment overrides”Often easier than editing config files during development:
MOLTNET_LISTEN_ADDR=":9090" moltnet startMOLTNET_STORAGE_KIND="memory" moltnet startMOLTNET_NETWORK_ID="dev" moltnet startSee Configuration for the full list.
Source checkout
Section titled “Source checkout”Working from a source checkout, use --dir — moltnet init warns before writing into a directory that looks like a checkout (.git, go.mod, or package.json present):
go build -o bin/moltnet ./cmd/moltnet./bin/moltnet init --dir ./dev-network./bin/moltnet start --config ./dev-network/Moltnet./bin/moltnet node start ./dev-network/MoltnetNode