2021-04-28 11:13:34 +00:00
|
|
|
# libwaku
|
|
|
|
#
|
|
|
|
# Exposes a C API that can be used by other environment than C.
|
|
|
|
|
|
|
|
# TODO Start a node
|
|
|
|
# TODO Mock info call
|
|
|
|
# TODO Write header file
|
|
|
|
# TODO Write example C code file
|
|
|
|
# TODO Wrap info call
|
|
|
|
# TODO Init a node
|
|
|
|
|
|
|
|
# proc info*(node: WakuNode): WakuInfo =
|
2021-06-13 12:50:10 +00:00
|
|
|
proc info(foo: cstring): cstring {.exportc, dynlib.} =
|
2021-04-28 11:13:34 +00:00
|
|
|
echo "info about node"
|
|
|
|
echo foo
|
|
|
|
return foo
|
|
|
|
|
|
|
|
proc echo() {.exportc.} =
|
|
|
|
echo "echo"
|
|
|
|
|
|
|
|
# TODO Here at the moment, start the node
|
|
|
|
# Then do info call
|
|
|
|
# WIP
|
|
|
|
#proc main() {.async.} =
|
|
|
|
# let
|
|
|
|
# rng = crypto.newRng()
|
|
|
|
# conf = WakuNodeConf.load()
|
|
|
|
# (extIp, extTcpPort, extUdpPort) = setupNat(conf.nat, clientId,
|
|
|
|
# Port(uint16(conf.tcpPort) + conf.portsShift),
|
|
|
|
# Port(uint16(conf.udpPort) + conf.portsShift))
|
|
|
|
# node = WakuNode.init(conf.nodeKey, conf.listenAddress,
|
|
|
|
# Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort)
|
|
|
|
#
|
|
|
|
# await node.start()
|
|
|
|
#
|
|
|
|
#main()
|
2021-06-13 12:50:10 +00:00
|
|
|
|
|
|
|
# When main done stuff
|