You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -543,6 +543,17 @@ To see the integration test coverage report open `.coverage/integration/lcov-rep
543
543
open .coverage/integration/lcov-report/index.html
544
544
```
545
545
546
+
## Export Events
547
+
548
+
Export all stored events to a [JSON Lines](https://jsonlines.org/) (`.jsonl`) file. Each line is a valid NIP-01 Nostr event JSON object. The export streams rows from the database using cursors, so it works safely on relays with millions of events without loading them into memory.
549
+
550
+
```
551
+
npm run export # writes to events.jsonl
552
+
npm run export -- backup-2024-01-01.jsonl # custom filename
553
+
```
554
+
555
+
The script reads the same `DB_*` environment variables used by the relay (see [CONFIGURATION.md](CONFIGURATION.md)).
556
+
546
557
## Configuration
547
558
548
559
You can change the default folder by setting the `NOSTR_CONFIG_DIR` environment variable to a different path.
0 commit comments