adding initial procs

This commit is contained in:
Gabriel mermelstein 2024-10-23 13:30:31 +03:00
parent edcb0e15f2
commit bbc008ec94
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D
3 changed files with 19 additions and 0 deletions

View File

@ -180,6 +180,9 @@ int waku_peer_exchange_request(void* ctx,
int numPeers, int numPeers,
WakuCallBack callback, WakuCallBack callback,
void* userData); void* userData);
int waku_get_health_report(void* ctx,
WakuCallBack callback,
void* userData);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -672,5 +672,18 @@ proc waku_peer_exchange_request(
) )
.handleRes(callback, userData) .handleRes(callback, userData)
proc waku_get_health_report(
ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer
): cint {.dynlib, exportc.} =
checkLibwakuParams(ctx, callback, userData)
waku_thread
.sendRequestToWakuThread(
ctx,
RequestType.DEBUG,
DebugNodeRequest.createShared(DebugNodeMsgType.GET_HEALTH_REPORT),
)
.handleRes(callback, userData)
### End of exported procs ### End of exported procs
################################################################################ ################################################################################

View File

@ -6,6 +6,7 @@ type DebugNodeMsgType* = enum
RETRIEVE_LISTENING_ADDRESSES RETRIEVE_LISTENING_ADDRESSES
RETRIEVE_MY_ENR RETRIEVE_MY_ENR
RETRIEVE_MY_PEER_ID RETRIEVE_MY_PEER_ID
GET_HEALTH_REPORT
type DebugNodeRequest* = object type DebugNodeRequest* = object
operation: DebugNodeMsgType operation: DebugNodeMsgType
@ -35,6 +36,8 @@ proc process*(
return ok(waku.node.enr.toURI()) return ok(waku.node.enr.toURI())
of RETRIEVE_MY_PEER_ID: of RETRIEVE_MY_PEER_ID:
return ok($waku.node.peerId()) return ok($waku.node.peerId())
of GET_HEALTH_REPORT:
error "unsupported operation in DebugNodeRequest" error "unsupported operation in DebugNodeRequest"
return err("unsupported operation in DebugNodeRequest") return err("unsupported operation in DebugNodeRequest")