feature/start-protocol-command (#209)

* started working

* fixes

* rename start -> mount

* started logging

* mounting relay

* Update wakunode2.nim

* start of fixe

* fix

* fix

* fixes

* Update waku/node/v2/wakunode2.nim

Co-authored-by: Oskar Thorén <ot@oskarthoren.com>

* removed comment

* fix

* update

* changed the default

Co-authored-by: Oskar Thorén <ot@oskarthoren.com>
This commit is contained in:
Dean Eigenmann
2020-10-20 10:36:27 +08:00
committed by GitHub
co-authored by Oskar Thorén
parent d6c48da071
commit b2edfe8dda
8 changed files with 108 additions and 55 deletions
+1
View File
@@ -25,6 +25,7 @@ proc runBackground() {.async.} =
Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort)
await node.start()
await node.mountRelay()
# Subscribe to a topic
let topic = cast[Topic]("foobar")
+4 -1
View File
@@ -160,10 +160,11 @@ proc processInput(rfd: AsyncFD, rng: ref BrHmacDrbgContext) {.async.} =
Port(uint16(conf.tcpPort) + conf.portsShift),
Port(uint16(conf.udpPort) + conf.portsShift))
node = WakuNode.init(conf.nodeKey, conf.libp2pAddress,
Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort, conf.topics.split(" "))
Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort)
# waitFor vs await
await node.start()
await node.mountRelay(conf.topics.split(" "))
var chat = Chat(node: node, transp: transp, subscribed: true, connected: false, started: true)
@@ -175,6 +176,8 @@ proc processInput(rfd: AsyncFD, rng: ref BrHmacDrbgContext) {.async.} =
echo &"Listening on\n {listenStr}"
if conf.storenode != "":
node.mountStore()
node.wakuStore.setPeer(parsePeer(conf.storenode))
proc storeHandler(response: HistoryResponse) {.gcsafe.} =