Hardcode all six nodes listen topic, flooding

This commit is contained in:
Oskar Thoren 2020-05-28 11:52:57 +08:00
parent a8e791ab8c
commit dcbd0c617a
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
1 changed files with 16 additions and 3 deletions

View File

@ -15,18 +15,31 @@ const topicAmount = 100
let node1 = newRpcHttpClient() let node1 = newRpcHttpClient()
let node2 = newRpcHttpClient() let node2 = newRpcHttpClient()
let node3 = newRpcHttpClient()
let node4 = newRpcHttpClient()
let node5 = newRpcHttpClient()
let node6 = newRpcHttpClient()
waitFor node1.connect("localhost", Port(8547)) waitFor node1.connect("localhost", Port(8547))
waitFor node2.connect("localhost", Port(8548)) waitFor node2.connect("localhost", Port(8548))
waitFor node3.connect("localhost", Port(8549))
waitFor node4.connect("localhost", Port(8550))
waitFor node5.connect("localhost", Port(8551))
waitFor node6.connect("localhost", Port(8552))
#let version = waitFor node1.wakuVersion() let version = waitFor node6.wakuVersion()
#info "Version is", version info "Version is", version
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} = proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
debug "Hit handler", topic=topic, data=data debug "Hit handler", topic=topic, data=data
# TODO: Implement handler logic # TODO: Implement handler logic
let res1 = waitFor node2.wakuSubscribe("foobar") # All subscribing to foobar topic
let res2 = waitFor node2.wakuSubscribe("foobar")
let res3 = waitFor node3.wakuSubscribe("foobar")
let res4 = waitFor node4.wakuSubscribe("foobar")
let res5 = waitFor node5.wakuSubscribe("foobar")
let res6 = waitFor node6.wakuSubscribe("foobar")
os.sleep(2000) os.sleep(2000)
# info "Posting envelopes on all subscribed topics" # info "Posting envelopes on all subscribed topics"