mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-28 04:19:29 +00:00
Convert the kernel_api operations — relay/filter/lightpush/store,
peer_manager, discovery, ping, debug/node-info — to typed {.ffi.} procs that
pass parameters directly and ride generic CBOR (no per-op request wrappers).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
902 B
Nim
33 lines
902 B
Nim
## The waku api getters are synchronous and can't fail, so the bodies just wrap
|
|
## the value; the `{.ffi.}` macro wraps it into the `Future` it must expose.
|
|
|
|
proc version*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok(self.waku.version())
|
|
|
|
proc listen_addresses*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok(self.waku.listenAddresses().join(","))
|
|
|
|
proc get_my_enr*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok(self.waku.myEnr())
|
|
|
|
proc get_my_peerid*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok(self.waku.myPeerId())
|
|
|
|
proc get_metrics*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok(self.waku.metrics())
|
|
|
|
proc is_online*(
|
|
self: LogosDelivery
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
return ok($self.waku.isOnline())
|