test
This commit is contained in:
parent
c95e7db187
commit
d5d4c03003
|
@ -20,12 +20,13 @@ QtObject:
|
||||||
result.callResult = "Use this tool to call JSONRPC methods"
|
result.callResult = "Use this tool to call JSONRPC methods"
|
||||||
result.setup()
|
result.setup()
|
||||||
|
|
||||||
|
status.setSignalHandler(signalHandler)
|
||||||
|
|
||||||
status.setupNewAccount()
|
status.setupNewAccount()
|
||||||
discard status.addPeer("enode://2c8de3cbb27a3d30cbb5b3e003bc722b126f5aef82e2052aaef032ca94e0c7ad219e533ba88c70585ebd802de206693255335b100307645ab5170e88620d2a81@47.244.221.14:443")
|
discard status.addPeer("enode://2c8de3cbb27a3d30cbb5b3e003bc722b126f5aef82e2052aaef032ca94e0c7ad219e533ba88c70585ebd802de206693255335b100307645ab5170e88620d2a81@47.244.221.14:443")
|
||||||
echo status.callPrivateRPC("{\"jsonrpc\":\"2.0\", \"method\":\"wakuext_requestMessages\", \"params\":[{\"topics\": [\"0x7998f3c8\"]}], \"id\": 1}")
|
echo status.callPrivateRPC("{\"jsonrpc\":\"2.0\", \"method\":\"wakuext_requestMessages\", \"params\":[{\"topics\": [\"0x7998f3c8\"]}], \"id\": 1}")
|
||||||
|
|
||||||
# Experiment
|
status.subscribeToTest()
|
||||||
status.setSignalHandler(signalHandler)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,51 @@ proc recreateDir(dirname: string) =
|
||||||
proc setSignalHandler*(something: SignalCallback) =
|
proc setSignalHandler*(something: SignalCallback) =
|
||||||
libstatus.setSignalEventCallback(something)
|
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*() =
|
proc setupNewAccount*() =
|
||||||
# Deleting directories
|
# Deleting directories
|
||||||
recreateDir(datadir)
|
recreateDir(datadir)
|
||||||
|
|
Loading…
Reference in New Issue