2020-09-10 04:18:35 +00:00
|
|
|
import
|
2021-02-04 08:39:55 +00:00
|
|
|
os, strutils, chronicles, json_rpc/[rpcclient, rpcserver], nimcrypto/sysrand,
|
2020-09-10 04:18:35 +00:00
|
|
|
libp2p/protobuf/minprotobuf,
|
|
|
|
eth/common as eth_common, eth/keys,
|
|
|
|
system,
|
2022-10-12 19:41:25 +00:00
|
|
|
options
|
|
|
|
import
|
|
|
|
../../waku/v2/node/wakunode2,
|
|
|
|
../../waku/v2/node/waku_payload,
|
|
|
|
../../waku/v2/node/jsonrpc/jsonrpc_types,
|
|
|
|
../../waku/v2/protocol/waku_filter,
|
|
|
|
../../waku/v2/protocol/waku_store,
|
|
|
|
../../waku/v1/node/rpc/hexstrings
|
|
|
|
|
|
|
|
|
2020-09-10 04:18:35 +00:00
|
|
|
|
|
|
|
from strutils import rsplit
|
|
|
|
template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0]
|
|
|
|
|
2021-02-04 08:39:55 +00:00
|
|
|
const sigWakuPath = sourceDir / "../jsonrpc/jsonrpc_callsigs.nim"
|
2020-09-10 04:18:35 +00:00
|
|
|
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
|
2021-02-04 08:39:55 +00:00
|
|
|
var res = waitFor client.post_waku_v2_relay_v1_subscriptions(@["/waku/2/default-waku/proto"])
|
2020-09-10 04:18:35 +00:00
|
|
|
echo res
|