mirror of https://github.com/waku-org/nwaku.git
28 lines
679 B
Nim
28 lines
679 B
Nim
import
|
|
os, strutils, strformat, chronicles, json_rpc/[rpcclient, rpcserver], nimcrypto/sysrand,
|
|
libp2p/protobuf/minprotobuf,
|
|
eth/common as eth_common, eth/keys,
|
|
system,
|
|
options
|
|
|
|
from strutils import rsplit
|
|
template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0]
|
|
|
|
const sigWakuPath = sourceDir / "wakucallsigs.nim"
|
|
createRpcSigs(RpcHttpClient, sigWakuPath)
|
|
|
|
if paramCount() < 1:
|
|
echo "Please provide rpcPort as argument."
|
|
quit(1)
|
|
|
|
let rpcPort = Port(parseInt(paramStr(1)))
|
|
|
|
var client = newRpcHttpClient()
|
|
waitfor client.connect("localhost", rpcPort)
|
|
|
|
echo "Subscribing"
|
|
|
|
# Subscribe to waku topic
|
|
var res = waitFor client.wakuSubscribe("waku")
|
|
echo res
|