* docs: typo in `build-essential` package name
* improvement(NIP-42): use 'restricted:' prefix for auth error msgs
* docs: add database maintenance example queries
* feat: allow logging output to file
* feat: roll over logs daily
* refactor: reorder imports
* improvement: default to logging on stdout
* fix: ensure startup SQL runs, even with zero min writers
---------
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
Co-authored-by: rorp <rorp@protonmail.com>
Co-authored-by: Yuval Adam <_@yuv.al>
Co-authored-by: Jamin M <jaminmenter@outlook.com>
Co-authored-by: Greg Heartsfield <scsibug@imap.cc>
This is inspired by the work of
v0l (https://github.com/v0l/nostr-rs-relay/).
A new trait abstracts the storage layer with an async API. Rusqlite
is still used with worker threads, but this allows for Postgresql or
other backends to be used.
There may be bugs, this has not been rigorously tested.
When submitting events to relays, clients currently have no way to know
if an event was successfully committed to the database. This NIP
introduces the concept of command results which are like NOTICE's except
provide more information about if an event was accepted or rejected.
A command result is a JSON object with the following structure that is
returned when an event is successfully saved to the database or
rejected:
["OK", <event_id>, <true|false>, <message>]
nip20: https://github.com/nostr-protocol/nips/pull/62