This commit is contained in:
Richard Ramos 2020-05-07 16:02:22 -04:00
parent c95e7db187
commit d5d4c03003
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
2 changed files with 48 additions and 2 deletions

View File

@ -20,12 +20,13 @@ QtObject:
result.callResult = "Use this tool to call JSONRPC methods"
result.setup()
status.setSignalHandler(signalHandler)
status.setupNewAccount()
discard status.addPeer("enode://2c8de3cbb27a3d30cbb5b3e003bc722b126f5aef82e2052aaef032ca94e0c7ad219e533ba88c70585ebd802de206693255335b100307645ab5170e88620d2a81@47.244.221.14:443")
echo status.callPrivateRPC("{\"jsonrpc\":\"2.0\", \"method\":\"wakuext_requestMessages\", \"params\":[{\"topics\": [\"0x7998f3c8\"]}], \"id\": 1}")
# Experiment
status.setSignalHandler(signalHandler)
status.subscribeToTest()

View File

@ -14,6 +14,51 @@ proc recreateDir(dirname: string) =
proc setSignalHandler*(something: SignalCallback) =
libstatus.setSignalEventCallback(something)
proc subscribeToTest*() =
var payload = %* {
"jasonrpc": "2.0",
"id": 2,
"method": "waku_generateSymKeyFromPassword",
"params": ["test"]
}
var result = $libstatus.callPrivateRPC($payload)
let keyId = $result.parseJson()["result"]
var topic = "0x9c22ff5f"; #sha3 of test
payload = %* {
"jsonrpc": "2.0",
"id": 3,
"method": "wakuext_loadFilters",
"params": [
[{
"chatId": "test",
"symKeyId": keyId,
"topic": topic,
"discovery": false,
"negotiated": false,
"listen": true
}]
]
}
result = $libstatus.callPrivateRPC($payload)
echo result;
payload = %* {
"jsonrpc": "2.0",
"id": 3,
"method": "wakuext_startMessenger",
"params": []
}
result = $libstatus.callPrivateRPC($payload)
proc setupNewAccount*() =
# Deleting directories
recreateDir(datadir)