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,
|
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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue