aboutsummaryrefslogtreecommitdiffstats
path: root/names/config.example.json
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-16 12:57:19 -0700
committerAdam Soltys <[email protected]>2026-10-16 12:57:19 -0700
commita3d2dc2e05a4f7c5ab0d6e7689498da9ca63de7b (patch)
treeb1c9d687e1cf0cced71bb2460a69ccdcb512f0dc /names/config.example.json
parent1dd70cc2c2b9b0a9f65a704ded9e322afabf736f (diff)
downloadcoinosv3-server-a3d2dc2e05a4f7c5ab0d6e7689498da9ca63de7b.tar.gz
coinosv3-server-a3d2dc2e05a4f7c5ab0d6e7689498da9ca63de7b.zip
names: keep state in SQLite
persist() rewrote the whole state file, close to 10 MB, on every settled payment and every queue tick, so one crash during a write could take every name with it. State now lives in SQLite (bun:sqlite, WAL, synchronous=FULL): one row per name, offer, invoice and so on, with the forwarder wallet's state kept as a single row. Each persist() is one transaction that writes only the rows that changed, so a crash leaves the previous state or the new one, never a torn file. The in-memory state object and every persist() call stay as they were. On the first start the JSON state file is imported, and a corrupt one stops startup. The file is left in place, so a rollback to the JSON build still finds its data. store.snapshot() makes a consistent copy while the service runs, for backups. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'names/config.example.json')
0 files changed, 0 insertions, 0 deletions