2026-06-25 11:54:47 +02:00
|
|
|
## 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.
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc version*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok(self.waku.version())
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc listen_addresses*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok(self.waku.listenAddresses().join(","))
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc get_my_enr*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok(self.waku.myEnr())
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc get_my_peerid*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok(self.waku.myPeerId())
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc get_metrics*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok(self.waku.metrics())
|
2025-12-19 17:00:43 +01:00
|
|
|
|
2026-06-25 11:54:47 +02:00
|
|
|
proc is_online*(
|
|
|
|
|
self: LogosDelivery
|
|
|
|
|
): Future[Result[string, string]] {.ffi.} =
|
|
|
|
|
return ok($self.waku.isOnline())
|