William Casarin and Daniel D’Aquino
6818d001f2
nostrdb: mem: reduce default queue size
...
This was overkill and was using lots of memory
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
4bf9160502
nostrdb: fix heap corruption on windows
...
windows thinks this is heap corruption... so I
guess we have to trust it.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
02df1e209b
nostrdb: windows: fix threading bugs
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
3186b0e1d3
nostrdb: fix windows build
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
de0935582c
nostrdb: ndb_filter_{eq,is_subset_of}: make interfaces const
...
this makes rust happier
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
573de6b881
nostrdb: ndb_filter_is_subset_of
...
subset testing for filters. Can be used to see if one subset is
redundant in the presence of a another in the local relay model
Changelog-Added: Add ndb_filter_is_subset_of
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
44ab702792
nostrdb: add ndb_filter_eq
...
filter equality testing. this works because field elements are sorted
Changelog-Added: Add ndb_filter_eq for filter equality testing
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
1fdf234c46
nostrdb: rename get_elems to find_elements
...
This is more accurate
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
3018200e95
nostrdb: add ndb_subscription_filters
...
Expose a way to get the set of filters for a subscription. On the rust
side, we should likely ndb_filter_clone each filter asap, because the
result of this function will only be valid up until the subscription
ends.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
47b79fc02e
nostrdb: ingest: support kind 6 reposts
...
This also enables processing raw json via ndb import
Fixes: https://github.com/damus-io/nostrdb/issues/46
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
0c483bb55a
nostrdb: print search keys to stdout
...
otherwise it's way too annoying to grep
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
8c446f804c
nostrdb: filter: retain const variant of get_int_elemnet
...
otherwise rust gets bitchy at as
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
e92018aee5
nostrdb: filter: allow mutable int elements
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
b4b84e6895
nostrdb: resync with repo
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
6c53bc75f2
nostrdb: content_parser: fix blocks_size
...
we are crossing cursors
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
827731b9cb
nostrdb: filter: retain const variant of get_int_elemnet
...
otherwise rust gets bitchy at as
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
56d44d0004
nostrdb: filter: allow mutable int elements
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
bbed448ccb
nostrdb: ndb_filter_from_json
...
Changelog-Added: Add method for parsing filter json
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
b326f007f2
nostrdb: expose filter introspection methods
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
a86d8416fc
nostrdb: expose ndb_filter_get_elements
...
This can be used to iterate though filter elements
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
b5c57dc935
nostrdb: make more things const
...
rust is happier this way
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
7d6814a481
nostrdb: add ndb_filter_json method
...
Changelog-Added: Add ndb_filter_json method for creating json filters
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
8dd048681b
nostrdb: Fix issue where id tag filters are pushed as strings
...
When creating filters, sometimes IDs are pushed as strings, so if there
is ever a 0 byte, the id prematurely ends, causing the filter to not
match
Fixes: https://github.com/rust-nostr/nostr/issues/454
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
2d02a17af6
nostrdb: fix bech32 parsing and add test
...
was off by one
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
3171959d85
nostrdb: debug: improve tag index display
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
bca3716e33
nostrdb: fix note content parsing bug with damus.io urls
...
Changelog-Fixed: Fixed bug where non-bech32 damus io urls would cause corruption
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
57db252783
nostrdb: ndb_note_json: return length
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
319579f912
nostrdb: ndb: dump json in filters and fulltext queries
...
This is much more useful
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
92e1e4b08f
nostrdb: api: add ndb_note_json
...
add a way to write an ndb note as json to a buffer
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
ffc50bb2c1
nostrdb: fix realloc corruption
...
can't figure out why this is happening, but let's disable it for now
while we test. we shouldn't hit this code path anyways once we switch
over to local notes in damus ios
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
a562be009d
nostrdb: add ability to register a subscription callback
...
Since Damus iOS is not an immediate-mode UI like android, we would
rather not poll for results. Instead we need a way to register a
callback function that is called when we get new subscription results.
This is also useful on the android side, allowing us to request a new
frame to draw when we have new results, instead of drawing every second.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
30c9bc7db7
nostrdb: add ndb_unsubscribe
...
We didn't have a way to unsubscribe from subscriptions. Now we do!
Apps like notecrumbs may open up many local subscriptions based on
incoming requests. We may need to make the MAX_SUBSCRIPTIONS size much
larger, but this should be okish for now.
Changelog-Added: Add ndb_unsubscribe to unsubscribe from subscriptions
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
0ac03df841
nostrdb: build: fix compile warning
...
A small size_t/uint64 conversion issue
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
db99b4f4d4
nostrdb: fix dubious looking parens logic
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
cc9585b6e3
nostrdb: plan: use a less efficient plan for author query plans
...
This is less efficient for now but we don't have a small-author-list
query plan yet.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
bd17dcfac6
nostrdb: plan: add created_at query plan
...
This introduces the basic created_at query plan. We scan the created_at
+ id index in descending order looking for items that match a filter.
This is a very general query plan, but might not be very efficient for
anything other than local timelines.
Changelog-Added: Add general created_at query plan for timelines
Closes: https://github.com/damus-io/nostrdb/issues/26
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
25e91b386c
nostrdb: cores: just set to 2 on unknown platforms
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
560e9e53cd
nostrdb: fix a few note size compile issues
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
1c1e5fa2a0
nostrdb: random: add getrandom fallback for android
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
2d5f86b142
nostrdb: filter: make sure clone copies metadata
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
89686d758a
nostrdb: filter: make sure to return clone errors
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
6c26add1da
nostrdb: filter: add ndb_filter_clone
...
Clone filters when moving them into subscriptions. This will allow us to
fix the double free issue on the rust side.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
3c5a83392e
nostrdb: filter: use relative data offsets for easy cloning
...
Instead of storing exact pointers inside of our filter elements, just
store offsets. This will allow us to clone filters very easily without
having to mess around with fixing up the pointers afterwards.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
1c63c3b9bb
nostrdb: filter: add ndb_filter_end
...
This is a pretty scary looking function that realloc our large variable
filter buffer into a compact one. This saves up a bunch of memory when
we are done building the filter.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
0bd4717e01
nostrdb: query: include note size in query results
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
bebd531b58
nostrdb: return number of items popped when polling
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
5788c077c4
nostrdb: silence annoying debug
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
1b77b4f0e0
nostrdb: filters: copy filter metadata into subscription
...
This fixes a few ownership issues
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
62625c6ff3
nostrdb: ndb: add ndb_poll_for_notes
...
The polling variant of ndb_wait_for_notes. This makes more sense for
realtime apps like notedeck
Changelog-Added: Add ndb_poll_for_notes
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
c8d88058d4
nostrdb: queue: switch to prot_queue_try_pop_all
...
This allows you to `try pop` multiple items instead of 1
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
b8bef86ea1
nostrdb: port kernelkind's to the new bech32 parser
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
b128330b2a
nostrdb: tce: fix build for previous TCE change
...
Fixes: 34093cd1 ("tce: add AUTH to-client-event")
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
934ea80f85
nostrdb: blocks: add word count interface
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
588cebd18d
nostrdb: header: add ptr helpers for swift
...
swift is kind of dumb when it comes to opaque pointers
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
ccca6e58ec
nostrdb: strblock: add typedef
...
I don't technically need this but it helps a lot on the swift side
of things since I already have code that uses this identifier of a
similar structure
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:40:00 -07:00
William Casarin and Daniel D’Aquino
8b3c86c5de
nostrdb/query: add tag index and tag queries
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
05c5a6dacb
nostrdb/filter: don't end field if we don't have one active
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
1a6568deca
nostrdb/perf: add some flamegraph helpers to makefile
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
1b2f4c41df
nostrdb/fix macos build
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
25bcf9c243
nostrdb/ndb: measure query performance
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
3993679cc0
nostrdb/query: support until for kind query plans
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
e302bf37fa
nostrdb/ndb: add inital query command
...
still very early, but works for kinds!
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
a45f4d3087
nostrdb/Query Plans
...
Instead of running queries off filters directly, we do some simple
heuristics and determine a reasonable query plan for the given filter.
To test this, also add a kind index query plan and add a test for it.
We still need tag, author, and created_at index scans. This is up next!
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
d598e178c1
nostrdb/index: make sure kind index is DUPSORT + INTEGERDUP
...
We will probably need a migration for this?
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
77601e77ee
nostrdb/filter: rename FILTER_GENERIC to FILTER_TAG
...
it's a bit more intuitive
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
206efba58a
nostrdb/cleanup: remove old dbscan stuff
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
a84749cd07
nostrdb/debug: add print_kind_keys helper
...
I needed this for debugging kind queries
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
75c7adddb8
nostrdb/query: implement kind queries
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
9f1b9ab945
nostrdb/Initial nostrdb queries
...
Still a lot more work to do, but this is at least a proof of concept for
querying nostrdb using filters.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
b2080a946e
nostrdb/cursor: fix bug when pushing last element
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
942e47a720
nostrdb/query: extract ndb_cursor_start
...
This is useful for positioning LMDB cursors at the start of a query. We
will be re-using this in the upcoming query code
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
6dbf3416b9
nostrdb/cursor: remove old array code
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
2b14acd62f
nostrdb/filter: don't allow adding id elements on kinds
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
267a9ac54b
nostrdb/ocd: small cleanup
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
8b03ed6175
nostrdb/filters: remove ndb_filter_group from public API
...
We can just use a list of filters instead when subscribing
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
6cd7b945ca
nostrdb/filter: use binary search for large contact list filters
...
This is much more efficient than linear scans
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:59 -07:00
William Casarin and Daniel D’Aquino
e5e6735129
nostrdb/filter: sort filter elements
...
If they are sorted we can do binary search when matching filters like
how strfry does it.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
9c2f7a931c
nostrdb/subs: always fail when calling wait_for_notes on a subid of 0
...
this is an invalid subscription id
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
b1bbf355de
nostrdb/subs: notify on profile notes as well
...
We missed this in the original subscription code
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
d7a2064786
nostrdb/debug: add a few more debug statement
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
4d14ca8d0a
nostrdb/filters: add ndb_filter_group_init function
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
81d65cd5bf
nostrdb/subs: subs and monitor cleanup
...
We need to free these resources when we're done with them.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
f03d8a5ac9
nostrdb/search: don't enforce sequential tokens
...
This makes it a bit more flexible, but maybe we can add quoting in the
future that re-enables this. Or maybe a search option
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
0df18ae1a4
nostrdb/test: switch reaction test to use subscriptions
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
8c5ec32eaa
nostrdb/Initial nostrdb relay subscriptions
...
This adds some initial code for the nostrdb relay subscription monitor.
When new notes are written to the database, they are checked against
active subscriptions. If any of the subscriptions are matched, the note
primary key is written to the inbox queue for that subscription.
We also add an ndb_wait_for_notes() method that simply waits for notes
to be written by the subscription monitor.
Changelog-Added: Added filter subscriptions
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
bdedf8bd8c
nostrdb/disable lmdb download
...
since we have this committed now
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
c2383060aa
nostrdb/blocks: add ndb_blocks_flags function
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
432cdb96d9
nostrdb/fix: don't write the owned flag to the DB
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
f580c7dd93
nostrdb/fix clang compile issue
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
c677233dcb
nostrdb/blocks: expose block iterator internals
...
so we don't need heap allocation. we will be calling this a lot in tight
render loops, we don't want to be allocating on each frame.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
d063362bd7
nostrdb/blocks: write note blocks on ingest
...
When ingesting notes, parse text/longform contents and store them in nostrdb.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
088683696a
nostrdb/blocks: actually set the note block version
...
Version 1 to start
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
f2795aa71c
nostrdb/blocks: add ndb_blocks_free
...
In some situations we will need to have owned note blocks. For
example, when we try to fetch note blocks from the database and it's not
there yet. We will need to parse the content on the spot and return an
owned copy, since it will not be immediately available in the database.
Add a new flag field to note blocks that lets us know if it's owned by
malloc or nostrdb.
We the add a free function that checks this flag and frees the object if
its set. If it is not set then it doesn nothing because it likely came
from the database.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
c831976078
nostrdb/blocks: add total_size
...
Fix this mistake that we have with ndb_notes where we don't know the
total size of the object
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
c2c73c3af6
nostrdb/header: move bech32 around
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
971fa3e4ef
nostrdb/invoice: fix crash in any-amount invoice parsing
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
dfa145dd4a
nostrdb/parser: fix bech32 block decoding
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
4cfe28d802
nostrdb/bech32: fix big in bech32 size parsing
...
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
034f2cc02f
nostrdb/blocks: add note block iterator
...
This adds an api that walks along and pulls compact note block data out of
nostrdb.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00
William Casarin and Daniel D’Aquino
d73422db38
nostrdb/content_parser: add initial db decoders
...
We need to pull the data out as well! Let's add some initial decoders.
We still need tests to make sure it's working.
Signed-off-by: William Casarin <jb55@jb55.com >
2025-08-11 16:39:43 -07:00