mirror of https://github.com/waku-org/nwaku.git
adding initial procs
This commit is contained in:
parent
edcb0e15f2
commit
bbc008ec94
|
@ -180,6 +180,9 @@ int waku_peer_exchange_request(void* ctx,
|
|||
int numPeers,
|
||||
WakuCallBack callback,
|
||||
void* userData);
|
||||
int waku_get_health_report(void* ctx,
|
||||
WakuCallBack callback,
|
||||
void* userData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -672,5 +672,18 @@ proc waku_peer_exchange_request(
|
|||
)
|
||||
.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
|
||||
################################################################################
|
||||
|
|
|
@ -6,6 +6,7 @@ type DebugNodeMsgType* = enum
|
|||
RETRIEVE_LISTENING_ADDRESSES
|
||||
RETRIEVE_MY_ENR
|
||||
RETRIEVE_MY_PEER_ID
|
||||
GET_HEALTH_REPORT
|
||||
|
||||
type DebugNodeRequest* = object
|
||||
operation: DebugNodeMsgType
|
||||
|
@ -35,6 +36,8 @@ proc process*(
|
|||
return ok(waku.node.enr.toURI())
|
||||
of RETRIEVE_MY_PEER_ID:
|
||||
return ok($waku.node.peerId())
|
||||
of GET_HEALTH_REPORT:
|
||||
|
||||
|
||||
error "unsupported operation in DebugNodeRequest"
|
||||
return err("unsupported operation in DebugNodeRequest")
|
||||
|
|
Loading…
Reference in New Issue