261 Commits

Author SHA1 Message Date
Igor Sirotin
8c7daca481
feat: add Messaging API (pkg/messaging)
The high-level, idiomatic MessagingClient mirroring the Nim MessagingClient, on
top of the internal/ffi/liblogosdelivery bridge (single library).

- MessagingClient: New/Start/Stop/Close, Subscribe/Unsubscribe,
  Send -> RequestID.
- Unified Events() <-chan Event with a sealed Event interface
  (MessageReceived/Sent/Propagated/Error, ConnectionStatus). Events are dropped
  (never block) if a consumer falls behind.
- Event decoding handles liblogosdelivery's std/json wire format: received
  payload/meta arrive as JSON byte-int arrays (not base64), with base64 + null
  fallbacks; connectionStatus as an enum-name string. Unit-tested.
- Config aliases the kernel WakuNodeConf.
- examples/messaging: runnable demo.

Part of #106. Stacked on the single-library migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 18:28:03 +01:00
Igor Sirotin
c653002984
test(kernel): add a two-node relay send/receive integration test
TestRelaySendReceive connects two relay nodes, publishes a random payload from
one and requires the other to receive it — end-to-end over the single library.
Compiled by the PR gate; run under `make test` / locally against a built
liblogosdelivery. (Replaces the former examples/kernel, removed alongside the
ffi flatten.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 18:27:12 +01:00
Igor Sirotin
da006e9b72
refactor(ffi): flatten internal/ffi/liblogosdelivery into internal/ffi
With a single library there is no bridge to choose between, so the extra
subpackage adds nothing: move the bridge to internal/ffi (package ffi) and drop
the umbrella doc. pkg/kernel now imports internal/ffi and calls ffi.*.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 17:01:23 +01:00
Igor Sirotin
a3ee8ab0ec
ci: build against logos-delivery master (unpin #4012)
logos-delivery#4012 merged, so drop the LOGOS_DELIVERY_REF pin and clone the
default branch; the cache key tracks master's HEAD again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:45:41 +01:00
Igor Sirotin
b173a620a4
fix(kernel): correct RelayPublish wire format; verify send/receive
RelayPublish marshalled the generated protobuf (content_topic), but the library
requires the WakuMessage wire format (contentTopic) and rejected it with
"Missing required field: contentTopic". Marshal the wire shape explicitly.

Turn examples/kernel into an end-to-end send/receive check: two relay nodes on
cluster 16 / shard 64, connected via the listen multiaddr, one publishes and the
other receives it off MsgChan. Verified against a locally-built liblogosdelivery:
prints "send/receive OK".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 15:07:16 +01:00
Igor Sirotin
3e7d1a41dd
fix(kernel): drop removed config keys + add a runnable example
Running against the single liblogosdelivery library surfaced a config drift:
the consolidated WakuNodeConf strictly rejects unknown keys, and
common.WakuConfig still emitted `legacyStore` (removed upstream, and sent
unconditionally) and `host` (renamed to `listenAddress`). That failed node
creation, so every kernel test that starts a node failed. Reconcile the config:

- drop the LegacyStore field (and its two obsolete test references; the
  already-skipped TestCheckLegacyStore keeps compiling);
- map Host to the `listenAddress` JSON key.

Add examples/kernel: a small runnable check that drives the unified lifecycle
(logosdelivery_create_node/start/stop/destroy) and a few kernel ops (version,
listen addresses, is-online, relay subscribe/unsubscribe) over the single
library. `go run ./examples/kernel` prints OK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 14:49:45 +01:00
Igor Sirotin
d5d5a215ed refactor: build against the single liblogosdelivery library
logos-delivery#4012 unifies the node lifecycle on logosdelivery_* and ships the
full API — Messaging, Reliable Channels, and the low-level Kernel (waku_*) tier
— in one liblogosdelivery library, retiring the separate libwaku. Migrate the
bindings onto it.

- internal/ffi: collapse the two bridges into one internal/ffi/liblogosdelivery
  over the single library. The kernel wrappers keep calling waku_* (kernel
  header), the lifecycle now uses logosdelivery_create_node/start_node/
  stop_node/destroy (waku_new/start/stop/destroy are gone), events use
  logosdelivery_set_event_callback. Include liblogosdelivery_kernel.h (which
  re-exports the stable header) and link -llogosdelivery. Remove
  internal/ffi/libwaku.
- pkg/kernel: repoint at internal/ffi/liblogosdelivery; the Makefile links
  -llogosdelivery.
- CI: build only `make liblogosdelivery`, headers from library/, single
  -llogosdelivery. Pinned to logos-delivery#4012 until it merges (see the
  TODO/LOGOS_DELIVERY_REF in pr.yml).

The high-level MessagingClient (pkg/messaging) lands in a follow-up PR on top.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 17:28:50 +01:00
Igor Sirotin
5da314e0f7
feat: add liblogosdelivery cgo bridge (internal/ffi/liblogosdelivery) (#113)
Add internal/ffi/liblogosdelivery, the cgo bridge over liblogosdelivery
(Messaging API), mirroring the libwaku subpackage from #114: synchronous
request/response plumbing, a shared async event callback, and a handle->handler
registry, exposing Go-typed primitives (New/Start/Stop/Destroy,
Subscribe/Unsubscribe/Send, SetEventHandler, Handle, RetOK, EventHandler).

It self-links liblogosdelivery via a #cgo directive. For symmetry — and so the
two bridges never need a shared global -l flag — add the same #cgo LDFLAGS:
-lwaku to the libwaku subpackage. Each subpackage now links exactly its own
library; no binary links both (until logos-delivery#3851).

Extend the PR gate to build liblogosdelivery, set CGO_CFLAGS for both headers
with no -l (each package self-links), run the messaging unit tests, and compile
the kernel tests.

Part of #106.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 21:19:41 +01:00
Igor Sirotin
1dc549d1d7
refactor: extract libwaku cgo bridge into internal/ffi (#114)
* refactor: extract libwaku cgo bridge into internal/ffi

Move the C preamble, cgo shims, and callback plumbing from pkg/kernel/nwaku.go
into internal/ffi/libwaku.go, where #111 scaffolded them to live. The bridge
exposes Go-typed Waku* primitives (handle in, strings out) and owns the
handle->event-handler registry, so pkg/kernel is now pure Go: WakuNode keeps
its full API, logging, and error texts, and just calls ffi.

Behavior is unchanged. Dropped four C shims that had no Go callers
(cGoWakuContentTopic, cGoWakuPubsubTopic, cGoWakuDefaultPubsubTopic,
cGoWakuLightpushPublish). CGO flags still come from the environment
(Makefile/CI untouched).

Part of #106.

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

* refactor: move libwaku bridge into internal/ffi/libwaku subpackage

One subpackage per C library so a binary links exactly the libraries it
imports: libwaku and liblogosdelivery carry overlapping symbols and must never
link together (until logos-delivery#3851). With the package named libwaku the
Waku* prefixes became stutter, so the exported primitives drop them
(libwaku.New/Start/RelayPublish/...). internal/ffi keeps an umbrella doc.go
stating the rule.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 19:54:36 +01:00
Igor Sirotin
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 Sirotin
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
Igor Sirotin
95be7e9319
chore: update license files to comply with Logos licensing requirements (#104) 2026-02-06 10:37:23 +01:00
Darshan
d29cc2c463
Merge pull request #102 from logos-messaging/daily_ci
fix: local build, tests, and daily CI
2026-01-08 23:28:26 +05:30
darshankabariya
2f6904edd1
update accordingl to suggestion 2026-01-08 23:27:46 +05:30
darshankabariya
4c6f87e62d
chore: deprecated go-waku 2025-12-23 02:40:09 +05:30
darshankabariya
c500c6d247
chore: deprecated go-waku 2025-12-23 02:21:12 +05:30
darshankabariya
79f94a234a
chore: deprecated go-waku 2025-12-23 01:46:21 +05:30
darshankabariya
0f47d57aa8
chore: deprecated go-waku 2025-12-23 01:23:45 +05:30
darshankabariya
56383131f2
chore: deprecated go-waku 2025-12-22 18:52:43 +05:30
darshankabariya
9f6e9ac839
chore: update accordings to rename 2025-12-22 18:23:02 +05:30
darshankabariya
cc70f9b695
chore: update accordings to rename 2025-12-22 17:55:04 +05:30
darshankabariya
284bbbc798
chore: update accordings to rename 2025-12-22 17:37:36 +05:30
darshankabariya
e774350a9e
chore: update accordings to rename 2025-12-22 17:21:52 +05:30
darshankabariya
4f38e24337
chore: update accordings to rename 2025-12-22 17:16:51 +05:30
darshankabariya
a600695118
chore: update accordings to rename 2025-12-22 15:13:25 +05:30
darshankabariya
3b704e93c4
chore: update accordings to rename 2025-12-22 14:45:12 +05:30
darshankabariya
97abc293cb
chore: update accordings to rename 2025-12-22 14:29:52 +05:30
darshankabariya
c4037c9289
chore: deprecated go-waku 2025-12-22 14:15:00 +05:30
darshankabariya
d698a6d1ff
chore: update accordings to rename 2025-12-22 13:32:40 +05:30
darshankabariya
0f4edc1143
chore: update accordings to rename 2025-12-22 12:53:49 +05:30
darshankabariya
bb454ae748
chore: update accordings to rename 2025-12-20 02:08:25 +05:30
darshankabariya
9ba1263350
chore: update accordings to rename 2025-12-20 02:05:09 +05:30
darshankabariya
20676f7d01
chore: update accordings to rename 2025-12-20 01:52:47 +05:30
darshankabariya
02c9a6afa6
chore: update accordings to rename 2025-12-20 01:11:10 +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
576c379ab2
chore: update accordings to rename 2025-12-19 14:09:28 +05:30
darshankabariya
300b4fbed5
chore: daily ci improvement 2025-12-16 18:28:51 +05:30
darshankabariya
4ca0da806c
chore: daily ci improvement 2025-12-16 17:33:52 +05:30
darshankabariya
c50de8cbc0
chore: daily ci improvement 2025-12-16 17:15:06 +05:30
Darshan
555b747d26
Merge pull request #101 from logos-messaging/rename_alignment 2025-12-16 16:12:34 +05:30
darshankabariya
433c4a90f4
chore: align with rename 2025-12-16 03:06:15 +05:30
Ivan FB
57155dfe6e
Merge pull request #100 from logos-messaging/unittest_
chore: unittest failure & align renames
2025-12-15 19:00:34 +01:00
darshankabariya
48758bec78
chore: resolved TestConnectedPeersInfo 2025-12-15 01:09:46 +05:30
Darshan
c1dfce50bf
Merge pull request #98 from logos-messaging/adapt-for-nim-ffi
adapt nwaku.go to latest nim-ffi ctx callback and userData go first
2025-12-14 01:37:35 +05:30
Ivan Folgueira Bande
de7d4cf3c9
chore: waku-go-bindings -> logos-messaging-go-bindings 2025-12-12 22:56:00 +01:00
Ivan Folgueira Bande
3a7b42d93c
rm ntp and wall from timesource 2025-12-12 22:54:35 +01:00
Ivan Folgueira Bande
00a74606d3
adding timesource package 2025-12-12 22:54:28 +01:00