Commit Graph
22 Commits
Author SHA1 Message Date
Igor Sirotin 280a7889a3 feat: define the bindings as a Nimble package
Consumers resolve liblogosdelivery at the revision these bindings were
written against, instead of pinning it themselves, and build it through
the task here rather than reimplementing logos-delivery's flags.

srcDir points at an empty directory, so nothing is contributed to a
dependent's Nim path.
2026-08-24 16:10:35 +01:00
Igor SirotinandClaude Opus 5 7b138bf71f feat: Messaging API (MessagingClient) (#120)
* feat(messaging): object-oriented Go mirror of the Nim MessagingClient

Adds pkg/messaging: a high-level, idiomatic Go binding for the Messaging
API, mirroring logos-delivery's Nim MessagingClient. A MessagingClient owns
a node and carries the messaging surface as methods on it — New / Start /
Stop / Close, Subscribe / Unsubscribe, Send(ctx, Envelope) (RequestID,
error) — over internal/ffi rather than exposing the raw FFI.

Events arrive on a single Events() <-chan Event with a sealed Event
interface: MessageReceivedEvent, MessageSentEvent, MessagePropagatedEvent,
MessageErrorEvent and ConnectionStatusEvent. Delivery never blocks the
library's event thread; an event is dropped when a consumer falls behind.
Config marshals to the layered configuration JSON (mode / preset /
messagingOverrides / channelsOverrides), with every field omitempty so it
can never be mistaken for the legacy flat blob.

Migrating internal/ffi to the current C ABI comes with it, because the
generated surface has moved on since the bridge was written and no longer
compiles: nim-ffi now generates the header from the {.ffi.} annotations,
argument-taking calls pass a per-call <Name>Req struct and a typed
<Name>ReplyFn, no-argument calls take a raw scalar callback, destroy is
synchronous, and the single set_event_callback has been replaced by a
per-event listener registry. The bridge now also copies every callback
string while it is still borrowed, and ignores the non-terminal
STALE_WARN progress code instead of settling the call on it.

pkg/kernel follows the same listener change, registering the three kernel
events it already consumed.

Verified against a liblogosdelivery built from logos-delivery master:
build / vet / golangci-lint / go mod tidy clean, unit tests green, and the
tagged integration test does a full create-start-subscribe-send round trip
on logos.dev, observing the message back and its propagation confirmation.

Closes #119.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CnzdnSMtHM5aLHLtDGBGR9

* review: address feedback on the MessagingClient API

- Send takes contentTopic / payload / ephemeral directly instead of an
  Envelope struct, which drops the Envelope type; ContentTopic and RequestID
  move to types.go.
- messagingEvents becomes a function returning the slice, so the set cannot
  be mutated by accident.
- Document what seals the Event interface and what that buys callers.
- Document why the received payload is decoded from a JSON integer array:
  base64 is only used on the send path and by the channel events, not by the
  messaging events.

* ci: stop golangci-lint's config verify from failing on a network timeout

golangci-lint-action runs `golangci-lint config verify` before linting, which
fetches the v2.4 JSON schema from golangci-lint.run on every run. That request
timed out on the runner and failed the gate with no lint finding behind it. An
invalid config still fails the lint run itself, so the pre-check only costs a
network dependency.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:53:36 +01:00
Igor SirotinandClaude Fable 5 4fd33b6121 refactor: adopt golang-standards/project-layout (#111)
* refactor: adopt golang-standards/project-layout

Move the legacy kernel wrapper `waku/*` to `pkg/kernel/*` and rename its
package `waku` -> `kernel`; nothing outside the package imported it, so this is
a mechanical import-path/prefix change. Update the relocated Makefile's
relative dep path, the legacy CI workflows (CI/endurance/repeated) build paths,
README, and .gitignore accordingly (preserving the libwaku-cache CI from #109).

Add scaffolding for the upcoming Messaging API work: `internal/ffi` (cgo
bridge), `pkg/messaging` (high-level Node API), and `examples/`. Document
`pkg/kernel` as legacy until logos-delivery#3851 consolidates the C libraries.

Also stop tracking the accidentally-committed `waku-bindings` build artifact
and gitignore the kernel build output.

No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: cleanup

* fix: repair references to removed utils package

nwaku_test_utils.go now uses pkg/kernel/utils.GetRSSKB; the memory_record
tool is self-contained (local helpers, missing mutex restored).

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 10:13:55 +01:00
Igor SirotinandClaude Opus 4.8 0a84f0fb7b ci: add PR-gate workflow + fix module path (#109)
* chore: rename module path to logos-delivery-go-bindings

The module path still read `logos-messaging-go-bindings`, mismatching the
repository name. Rename it to `github.com/logos-messaging/logos-delivery-go-bindings`
and update all in-repo imports. gofmt re-sorts a few import blocks as a result
(plus two files that were already unformatted on master).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: add PR-gate workflow and golangci-lint config

The repo had no `on: pull_request` CI (only workflow_dispatch + nightly
schedule), so nothing validated PRs. Add `.github/workflows/pr.yml` that
builds libwaku and runs `go build`, `go vet`, golangci-lint, and a test-compile
pass on every PR. Add a baseline `.golangci.yml` (standard linters + gofmt).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: scope golangci-lint to new code via new-from-merge-base

Run the full `standard` linter set but only report findings introduced since
the merge-base with master, so the legacy kernel wrapper's pre-existing issues
(unchecked defer-Close, dead helpers) don't drown the gate while new code still
gets full coverage. Fetch origin/master so the base ref is available in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: clone logos-delivery outside vendor/ and build in module mode

`go build` failed in CI because cloning logos-delivery into `vendor/` put Go
into vendor mode against an inconsistent `vendor/modules.txt`. Clone the
checkout into `.logos-delivery` instead and set `GOFLAGS=-mod=mod` so the gate
always builds in module mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: use golangci-lint-action@v7 for golangci-lint v2

v6 of the action rejects golangci-lint v2 versions ("v2 is not supported by
golangci-lint-action v6"). Bump to v7.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: cache libwaku, gate go mod tidy, rename LMN_DIR

- Rename LMN_DIR -> LOGOS_DELIVERY_DIR across the PR-gate and nightly
  workflows, the waku Makefile, and the build docs.
- Cache the built logos-delivery kernel keyed on its upstream HEAD SHA,
  skipping the clone + libwaku build while that commit is unchanged.
- Add a "go mod tidy is clean" step that fails if go.mod/go.sum drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 23:04:57 +01:00
Darshan ac6f8a5096 chore: align with logos-delivery rename and v0.38.0-beta (#105) 2026-02-27 21:47:05 +05:30
darshankabariya 97abc293cb chore: update accordings to rename 2025-12-22 14:29:52 +05:30
darshankabariya 20676f7d01 chore: update accordings to rename 2025-12-20 01:52:47 +05:30
darshankabariya cdad67ee80 chore: daily ci improvement 2025-12-20 00:14:00 +05:30
darshankabariya 01b58d79f0 chore: daily ci improvement 2025-12-19 15:58:52 +05:30
darshankabariya 099ca17868 chore: daily ci improvement 2025-12-19 14:43:52 +05:30
darshankabariya 433c4a90f4 chore: align with rename 2025-12-16 03:06:15 +05:30
Ivan Folgueira Bande 3d5e8e550b chore: waku-go-bindings -> logos-messaging-go-bindings 2025-12-12 22:48:53 +01:00
Igor SirotinandIvan FB aa64c47d2b chore: use externally provided nwaku (#95)
* chore: use externally provided nwaku

The fundamental idea is that the nwaku repository should be provided beforehand
before building waku-go-bindings

* fix: include libwaku with brackets

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2025-10-30 10:59:13 +00:00
Igor Sirotin 6887455b91 fix: Revert "chore: use externally provided nwaku" (#93) 2025-09-30 16:50:58 +01:00
Igor Sirotin 6a9b9ab231 docs: new library integration 2025-09-26 14:58:21 +01:00
gabrielmer b4f68a640c chore: adding link to example-go-bindings repo in readme (#54) 2025-03-26 16:29:51 +02:00
gabrielmer 6f95d51df4 chore: updating README (#52) 2025-03-13 15:22:58 +02:00
Vaclav Pavlin b33e5b5431 avoid using sudo for make (#48) 2025-03-11 11:57:48 +02:00
gabrielmer 9c78421cd0 updating readme (#18) 2025-01-22 18:58:40 +01:00
gabrielmer db4348d311 chore: improve package structure (#20) 2025-01-22 18:58:23 +01:00
Gabriel mermelstein 22c28a243a feat: initial working implementation 2024-12-03 11:54:57 +01:00
richΛrd 1724dce4f3 Initial commit 2024-02-20 16:13:10 -04:00