Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nostrdb, switch to local relay model #2121

Draft
wants to merge 146 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
4ee391e
nostrdb/build: fix additional compiler errors
jb55 Dec 11, 2023
8f0ab4b
nostrdb/add "import -"
mattn Dec 3, 2023
2d0d3c9
nostrdb/stream: actually use file pointer in stream api
jb55 Dec 14, 2023
a822261
c: move cursor.h to nostrdb subdir
jb55 Jan 25, 2024
a58b674
nostrdb/api: don't expose many internals, like note
jb55 Dec 12, 2023
fb493c6
nostrdb/cursor: fix warning that build.rs is complaining about
jb55 Dec 14, 2023
d2d1c57
nostrdb/rust: initial api for Ndb and NdbConfig
jb55 Dec 14, 2023
6a97b20
nostrdb/build: fix constness on config pointer in ingester thread
jb55 Dec 14, 2023
9bf8e8f
nostrdb/re-apply ispunct crash fix
jb55 Dec 17, 2023
f625cf9
c: move compiler to nostrdb dir
jb55 Jan 25, 2024
aff63c0
nostrdb: add supporting files before the move commit
jb55 Jan 25, 2024
a9a54e3
nostrdb: add supporting files for the bolt11 parser
jb55 Dec 23, 2023
fa310a3
c: move c files into nostrdb in prep for switchover
jb55 Jan 25, 2024
4325a71
nostrdb: port everything over to be in as sync as possible
jb55 Jan 25, 2024
66b6d4a
nostrdb: move everything to src
jb55 Dec 23, 2023
e7ef63d
nostrdb/add initial content parser
jb55 Dec 23, 2023
40aeecc
nostrdb/add libnostrdb.a
jb55 Dec 23, 2023
f7ef2b2
nostrdb/cursor: re-apply infinite loop bug fix
jb55 Dec 23, 2023
4c0df09
nostrdb/test: disable migrate for now
jb55 Dec 23, 2023
f4ffa0b
nostrdb/varint: switch to 64 bit varints
jb55 Dec 23, 2023
b3822ef
nostrdb/fix build
jb55 Dec 23, 2023
ad6bc78
nostrdb/fix github action
jb55 Dec 23, 2023
4bef3da
nostrdb/make: cleanup a bit, separate bench running
jb55 Dec 23, 2023
742ebae
nostrdb/block: add bolt11 invoice encoding/decoding
jb55 Dec 23, 2023
3d15de5
nostrdb/bech32: retab
jb55 Dec 23, 2023
d3089db
nostrdb/nostr_bech32: only parse up to raw bech32 buffers
jb55 Dec 27, 2023
d77f47a
nostrdb/cursor: add malloc_slice
jb55 Dec 27, 2023
7d69de3
nostrdb/cursor: add pull_varint_u32
jb55 Dec 27, 2023
28e6333
nostrdb/cursor: fix empty string pushing in push_c_str
jb55 Dec 27, 2023
f7fb942
nostrdb/cursor: fix some warnings
jb55 Dec 27, 2023
2276683
nostrdb/cursor: add align function
jb55 Dec 27, 2023
663b6cb
nostrdb/search: switch to cursor_align function
jb55 Dec 27, 2023
e94bdcd
nostrdb/Inital embedded content parser
jb55 Dec 27, 2023
4f55723
nostrdb/nostr_bech32: parse in one pass
jb55 Dec 27, 2023
150b0ac
nostrdb/bech32: add some initial tests
jb55 Dec 27, 2023
5279931
nostrdb/content_parser: add initial db decoders
jb55 Dec 27, 2023
deb56ea
nostrdb/parser: handle period at end of url
kernelkind Dec 28, 2023
bb599e4
nostrdb/blocks: add note block iterator
jb55 Dec 28, 2023
94d504d
nostrdb/bech32: fix big in bech32 size parsing
jb55 Dec 28, 2023
47ca60a
nostrdb/parser: fix bech32 block decoding
jb55 Dec 29, 2023
ed2dba0
nostrdb/invoice: fix crash in any-amount invoice parsing
jb55 Dec 29, 2023
fe99e98
nostrdb/header: move bech32 around
jb55 Dec 30, 2023
1e644c8
nostrdb/blocks: add total_size
jb55 Dec 30, 2023
6f3958a
nostrdb/blocks: add ndb_blocks_free
jb55 Dec 30, 2023
beaed9c
nostrdb/blocks: actually set the note block version
jb55 Dec 30, 2023
f90a363
nostrdb/blocks: write note blocks on ingest
jb55 Dec 29, 2023
34d1a8c
nostrdb/blocks: expose block iterator internals
jb55 Dec 31, 2023
20ff404
nostrdb/fix clang compile issue
jb55 Dec 31, 2023
00b36ea
nostrdb/fix: don't write the owned flag to the DB
jb55 Jan 1, 2024
6e60bb7
nostrdb/blocks: add ndb_blocks_flags function
jb55 Dec 31, 2023
46b61e1
nostrdb/disable lmdb download
jb55 Jan 1, 2024
07cca84
nostrdb/Initial nostrdb relay subscriptions
jb55 Nov 27, 2023
2b32b39
nostrdb/test: switch reaction test to use subscriptions
jb55 Jan 3, 2024
7dc2877
nostrdb/search: don't enforce sequential tokens
jb55 Jan 4, 2024
c4c6742
nostrdb/subs: subs and monitor cleanup
jb55 Jan 3, 2024
c923dc5
nostrdb/filters: add ndb_filter_group_init function
jb55 Jan 3, 2024
8e47e6d
nostrdb/debug: add a few more debug statement
jb55 Jan 3, 2024
4aded46
nostrdb/subs: notify on profile notes as well
jb55 Jan 3, 2024
831c9ff
nostrdb/subs: always fail when calling wait_for_notes on a subid of 0
jb55 Jan 3, 2024
0a85a81
nostrdb/filter: sort filter elements
jb55 Jan 4, 2024
f1a1a13
nostrdb/filter: use binary search for large contact list filters
jb55 Jan 4, 2024
aad669a
nostrdb/filters: remove ndb_filter_group from public API
jb55 Jan 4, 2024
c221ca5
nostrdb/ocd: small cleanup
jb55 Jan 4, 2024
008db55
nostrdb/filter: don't allow adding id elements on kinds
jb55 Jan 4, 2024
328078d
nostrdb/cursor: remove old array code
jb55 Jan 4, 2024
503eede
nostrdb/query: extract ndb_cursor_start
jb55 Jan 4, 2024
4cf035d
nostrdb/cursor: fix bug when pushing last element
jb55 Jan 4, 2024
4eea236
nostrdb/Initial nostrdb queries
jb55 Jan 4, 2024
15ac0dc
nostrdb/query: implement kind queries
jb55 Jan 4, 2024
9afd8f9
nostrdb/Fix typos
shuoer86 Jan 5, 2024
6458900
nostrdb/debug: add print_kind_keys helper
jb55 Jan 6, 2024
a5a1e63
nostrdb/cleanup: remove old dbscan stuff
jb55 Jan 6, 2024
200a5b9
nostrdb/filter: rename FILTER_GENERIC to FILTER_TAG
jb55 Jan 6, 2024
108ec68
nostrdb/index: make sure kind index is DUPSORT + INTEGERDUP
jb55 Jan 6, 2024
ea08f35
nostrdb/Query Plans
jb55 Jan 6, 2024
be4d703
nostrdb/ndb: add inital query command
jb55 Jan 6, 2024
504e6f1
nostrdb/query: support until for kind query plans
jb55 Jan 6, 2024
fe9e83e
nostrdb/ndb: measure query performance
jb55 Jan 6, 2024
8c9a330
nostrdb/fix macos build
jb55 Jan 6, 2024
1eaef36
nostrdb/perf: add some flamegraph helpers to makefile
jb55 Jan 8, 2024
608a311
nostrdb/filter: don't end field if we don't have one active
jb55 Jan 8, 2024
b35a7d6
nostrdb/query: add tag index and tag queries
jb55 Jan 9, 2024
340cb98
nostrdb/tce: add AUTH to-client-event
fishcharlie Dec 24, 2023
84f7f9f
nostrdb: strblock: add typedef
jb55 Jan 25, 2024
78b4777
nostrdb: header: add ptr helpers for swift
jb55 Jan 25, 2024
83b5bd3
nostrdb: blocks: add word count interface
jb55 Jan 26, 2024
454eb84
nostrdb: tce: fix build for previous TCE change
jb55 Jan 26, 2024
8a018a3
nostrdb: port kernelkind's to the new bech32 parser
jb55 Feb 1, 2024
96265ab
nostrdb: queue: switch to prot_queue_try_pop_all
jb55 Feb 6, 2024
edd6467
nostrdb: ndb: add ndb_poll_for_notes
jb55 Feb 6, 2024
97a44d4
nostrdb: filters: copy filter metadata into subscription
jb55 Feb 7, 2024
5814e61
nostrdb: silence annoying debug
jb55 Feb 7, 2024
a1a8a52
nostrdb: return number of items popped when polling
jb55 Feb 7, 2024
b033f87
nostrdb: query: include note size in query results
jb55 Feb 8, 2024
76bdaf5
nostrdb: filter: add ndb_filter_end
jb55 Feb 8, 2024
b30be3b
nostrdb: filter: use relative data offsets for easy cloning
jb55 Feb 9, 2024
2e2c038
nostrdb: filter: add ndb_filter_clone
jb55 Feb 9, 2024
6c9b360
nostrdb: filter: make sure to return clone errors
jb55 Feb 9, 2024
24e9531
nostrdb: filter: make sure clone copies metadata
jb55 Feb 9, 2024
1058695
nostrdb: random: add getrandom fallback for android
jb55 Feb 10, 2024
50359ca
nostrdb: fix a few note size compile issues
jb55 Apr 4, 2024
4ec15e4
nostrdb: cores: just set to 2 on unknown platforms
jb55 Feb 11, 2024
d52a308
nostrdb: plan: add created_at query plan
jb55 Mar 12, 2024
7314bca
nostrdb: plan: use a less efficient plan for author query plans
jb55 Mar 13, 2024
b2db60e
nostrdb: fix dubious looking parens logic
jb55 Apr 3, 2024
19be285
nostrdb: build: fix compile warning
jb55 Apr 4, 2024
e33464a
nostrdb: add ndb_unsubscribe
jb55 Apr 11, 2024
ab1380a
nostrdb: add ability to register a subscription callback
jb55 Apr 4, 2024
94b8a07
nostrdb: fix realloc corruption
jb55 Apr 25, 2024
7eddbe0
nostrdb: api: add ndb_note_json
jb55 Apr 30, 2024
57c6734
nostrdb: ndb: dump json in filters and fulltext queries
jb55 Apr 30, 2024
0b000f7
nostrdb: ndb_note_json: return length
jb55 Jun 28, 2024
d506a6a
nostrdb: fix note content parsing bug with damus.io urls
jb55 Aug 1, 2024
05b157d
nostrdb: debug: improve tag index display
jb55 Aug 1, 2024
82b13cb
nostrdb: fix bech32 parsing and add test
jb55 Aug 1, 2024
34e8e2a
nostrdb: Fix issue where id tag filters are pushed as strings
jb55 Aug 1, 2024
1075890
nostrdb: add ndb_filter_json method
jb55 Aug 3, 2024
895bbb2
nostrdb: make more things const
jb55 Aug 3, 2024
091d9dd
nostrdb: expose ndb_filter_get_elements
jb55 Aug 13, 2024
94eda3c
nostrdb: expose filter introspection methods
jb55 Aug 14, 2024
5d62484
nostrdb: bolt11: move utf8_check into local function.
rustyrussell Aug 17, 2024
bcacf9b
nostrdb: Makefile: build using ccan/ versions of files.
rustyrussell Aug 17, 2024
e1dbdd8
nostrdb: src: delete copies outside ccan/ dirs.
rustyrussell Aug 17, 2024
a12b8a1
nostrdb: ndb_filter_from_json
jb55 Aug 16, 2024
3bab65a
nostrdb: Makefile: fix missing dependencies on bolt11 headers.
rustyrussell Aug 18, 2024
7a7d94d
nostrdb: bolt11: update to latest version from CLN
rustyrussell Aug 18, 2024
3ddebca
nostrdb: bolt11: remove unneeded fields.
rustyrussell Aug 18, 2024
963a85f
nostrdb: filter: allow mutable int elements
jb55 Aug 19, 2024
806a9c7
nostrdb: filter: retain const variant of get_int_elemnet
jb55 Aug 19, 2024
50f07ce
nostrdb: content_parser: fix incorrect comment.
rustyrussell Aug 24, 2024
f0de1e1
nostrdb: nostrdb: fix ndb_builder_find_str.
rustyrussell Aug 24, 2024
10b4a09
nostrdb: content_parser: fix blocks_size
jb55 Aug 28, 2024
9d58cb1
nostrdb: ccan: copy ccan files into their own subdirectory.
rustyrussell Aug 17, 2024
51aff0c
nostrdb: bolt11: move utf8_check into local function.
rustyrussell Aug 17, 2024
3e0719f
nostrdb: Makefile: build using ccan/ versions of files.
rustyrussell Aug 17, 2024
ae10ce4
nostrdb: ccan: sync with normal versions.
rustyrussell Aug 17, 2024
157827e
nostrdb: ccan: update to latest.
rustyrussell Aug 17, 2024
210cb30
c: re-add damus-only C stuff
jb55 Jan 25, 2024
1a465ab
c: remove some unused files from project
jb55 Jan 25, 2024
8872f1d
optimized id matching function
jb55 Feb 26, 2024
4ba8c8e
Switch over to use use blocks from nostrdb
jb55 Feb 2, 2024
e08cedf
Fix relay compile issue
jb55 Apr 4, 2024
dca0497
ndb: add subscription callback initializers
jb55 Apr 4, 2024
436b8a7
test: fix broken tests
jb55 Apr 5, 2024
824d0f5
add assert to catch potential bug
jb55 Apr 17, 2024
f8931a6
wip local relay model
jb55 Apr 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DamusNotificationService/NotificationFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct NotificationFormatter {
content.title = Self.zap_notification_title(zap)
content.body = Self.zap_notification_body(profiles: state.profiles, zap: zap)
content.sound = UNNotificationSound.default
content.userInfo = LossyLocalNotification(type: .zap, mention: .note(notify.event.id)).to_user_info()
content.userInfo = LossyLocalNotification(type: .zap, mention: .init(nip19: .note(notify.event.id))).to_user_info()
return (content, "myZapNotification")
default:
// The sync method should have taken care of this.
Expand Down
2 changes: 1 addition & 1 deletion DamusNotificationService/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class NotificationService: UNNotificationServiceExtension {
return
}

guard let notification_object = generate_local_notification_object(from: nostr_event, state: state) else {
guard let notification_object = generate_local_notification_object(ndb: state.ndb, from: nostr_event, state: state) else {
// We could not process this notification. Probably an unsupported nostr event kind. Suppress.
// contentHandler(UNNotificationContent())
// TODO: We cannot really suppress until we have the notification supression entitlement. Show the raw notification
Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5-24 profile loading was much better
1 change: 0 additions & 1 deletion damus-c/damus-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#include "damus.h"
#include "bolt11.h"
#include "amount.h"
#include "nostr_bech32.h"
Expand Down
Loading