14 Commits
Author SHA1 Message Date
Gabriel Cruz 1336d42d4c fix(gossipsub): bound the per-topic message queue and expose the ingress limits (#101) 2026-08-11 11:26:50 -03:00
Gabriel Cruz bafe4b9f83 fix(service-disco): advertise a caller-supplied XPR (#99) 2026-08-11 10:04:04 -03:00
vladopajic a31c40d65c feat: logs filter (#95) 2026-08-01 20:22:42 +02:00
Dario LipicarandClaude Opus 5 ad00876e9d fix(lidl): give createXpr services and newPrivateKey a LIDL type (#97)
* fix(lidl): give createXpr services and newPrivateKey a LIDL type

logos-cpp-sdk#127 makes an unrecognised C++ spelling a build error
instead of silently publishing it as the opaque `any`, and two
declarations in plugin.h relied on that silence.

createXpr's `services` was `std::vector<std::pair<std::string,
std::string>>` — LIDL has no pair, so it published as `[any]`. The
pair's second element carries raw binary (it becomes a
ServiceInfoEntry's NimFfiBytes), but as a std::string it round-tripped
through UTF-8, which is lossy for non-UTF-8 bytes. It is now
`std::map<std::string, std::vector<uint8_t>>` — LIDL `{tstr: bstr}` —
which reaches the record byte for byte. decodeXpr's `services` becomes
an object keyed by service id to mirror it, so a decoded record feeds
back in without reshaping; `data` stays base64 there because that value
rides in an untyped `result`, not a typed slot.

newPrivateKey took `KeyScheme`, an enum, which LIDL also has no type
for. It now takes the scheme name — the vocabulary metadata.json
already documents for `keyType`, parsed the way parseTransport parses
"tcp"/"quic". The numeric KEY_SCHEME_* values belong to the Nim
binding and are no contract for a caller in another language.

decode_xpr now round-trips 0x01 0x00 0x02 0x80 0xfe 0xff 0x03 and
compares byte for byte, which is the lossiness this fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(lidl): keep the decoded-record services shape as it was

The previous commit also changed recordEntryToJson's `services` from
`[{id, data}]` to an object keyed by id, to mirror the map createXpr
now takes. That was wrong: recordEntryToJson serves discoLookup and
discoRandomLookup as well as decodeXpr, so it silently reshaped three
results, and tutorial 9 aborted iterating a lookup record —
`s["data"]` on what had become a bare base64 string throws
json type_error.305.

Keyed-by-id is also wrong on its own terms here. Lookup records come
from remote peers and may legitimately repeat a service id; an object
drops all but the last, while the array represents them faithfully.

createXpr's parameter stays `std::map<std::string,
std::vector<uint8_t>>` (`{tstr: bstr}`) — that is the typing fix and
the byte-exactness it buys, and it is unaffected. decode_xpr still
proves the round-trip, indexing the array instead of the object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 14:35:59 -03:00
Gabriel Cruz 78952d5141 feat: use nim-ffi cbindings (#77) 2026-07-29 08:39:38 -03:00
vladopajic 7b4b776b26 docs(tutorial): followup (#92) 2026-07-27 14:53:49 -03:00
vladopajic eb8f89f3af docs(tutorial): add introduction tutorial (#90) 2026-07-24 14:14:38 +00:00
vladopajic 7db2524898 docs(tutorial): add tutorials 9, 10 and 11 (#87) 2026-07-24 13:45:00 +00:00
vladopajic 0d0ffb7fe4 add separator after introduction to tutorial ends (#89) 2026-07-23 15:37:33 -03:00
vladopajic b9651cc1d7 docs(tutorial): add tutorials 5, 6, 7, 8 (#84) 2026-07-23 18:04:23 +00:00
vladopajic cfbe14af07 ci(tutorials): add smoke test for code (#85) 2026-07-23 17:29:14 +00:00
vladopajic b7b930bbaf chore(tutorials): remove borders from rendered .md navigation (#86)
* remove borders

* refresh

* even better
2026-07-23 17:54:09 +02:00
vladopajic 2d53b34fb1 docs(tutorial): add tutorials 2, 3 and 4 (#81) 2026-07-23 12:19:54 +00:00
vladopajic 78b7552507 feat(tutorial) add support for runnable tutorials with CI and docs generation (#80) 2026-07-22 12:47:58 +00:00