From 34c1632ac5d1ce8af0c104211d0582b7a1bc622f Mon Sep 17 00:00:00 2001 From: alrevuelta Date: Fri, 11 Aug 2023 14:05:14 +0000 Subject: [PATCH] More changes --- run_nwaku.sh | 3 ++- run_test.sh | 24 ++++++++++++++++++++++++ run_wakupublisher.sh | 6 +++--- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 run_test.sh diff --git a/run_nwaku.sh b/run_nwaku.sh index 7d6a4c4..70d93f4 100755 --- a/run_nwaku.sh +++ b/run_nwaku.sh @@ -37,4 +37,5 @@ exec /usr/bin/wakunode\ --rln-relay-cred-password=password \ --rln-relay-cred-path=/rlnKeystore.json \ --rln-relay-eth-contract-address=0x39558059411112732d73997712b75a865a697330 \ - --rln-relay-eth-client-address=wss://sepolia.infura.io/ws/v3/4576482c0f474483ac709755f2663b20 \ + --rln-relay-eth-client-address=ws://linux-01.ih-eu-mda1.nimbus.sepolia.wg:9557 + #--rln-relay-eth-client-address=wss://sepolia.infura.io/ws/v3/4576482c0f474483ac709755f2663b20 \ diff --git a/run_test.sh b/run_test.sh new file mode 100644 index 0000000..5b5312c --- /dev/null +++ b/run_test.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +IP=$(ip a | grep "inet " | grep -Fv 127.0.0.1 | sed 's/.*inet \([^/]*\).*/\1/') + +echo "I testdiscv5 node" + +RETRIES=${RETRIES:=10} + +while [ -z "${BOOTSTRAP_ENR}" ] && [ ${RETRIES} -ge 0 ]; do + BOOTSTRAP_ENR=$(wget -O - --post-data='{"jsonrpc":"2.0","method":"get_waku_v2_debug_v1_info","params":[],"id":1}' --header='Content-Type:application/json' http://bootstrap:8545/ 2> /dev/null | sed 's/.*"enrUri":"\([^"]*\)".*/\1/'); + echo "Bootstrap node not ready, retrying (retries left: ${RETRIES})" + sleep 1 + RETRIES=$(( $RETRIES - 1 )) +done + +if [ -z "${BOOTSTRAP_ENR}" ]; then + echo "Could not get BOOTSTRAP_ENR and none provided. Failing" + exit 1 +fi + +echo "Using bootstrap node: ${BOOTSTRAP_ENR}" +exec /usr/bin/discv5\ + --bootnodes=${BOOTSTRAP_ENR} + #--bootnodes="enr:-M-4QLOTEs_ZFxCb09FgIezZd5KeTru5CWWyEtMWMN-yUABrerWxckU-pMIh3yO8VjxHpgZ4jU2WSXuK3goW4uYb6c4BgmlkgnY0gmlwhI_G-a6KbXVsdGlhZGRyc7EALzYobm9kZS0wMS5kby1hbXMzLnN0YXR1cy5wcm9kLnN0YXR1c2ltLm5ldAYBu94DiXNlY3AyNTZrMaECoVyonsTGEQvVioM562Q1fjzTb_vKD152PPIdsV7sM6SDdGNwgnZfg3VkcIIjKIV3YWt1MgM"\ diff --git a/run_wakupublisher.sh b/run_wakupublisher.sh index a99136b..449e9cf 100755 --- a/run_wakupublisher.sh +++ b/run_wakupublisher.sh @@ -21,8 +21,8 @@ fi echo "Using bootstrap node: ${BOOTSTRAP_ENR}" exec /main\ --pubsub-topic="/waku/2/default-waku/proto"\ - --content-topic="my-ctopic"\ - --msg-per-second=${MSG_PER_SECOND}\ - --msg-size-kb=${MSG_SIZE_KBYTES}\ + --content-topic="/toy-chat/3/mingde/proto"\ + --msg-per-second=200\ + --msg-size-kb=2\ --bootstrap-node=${BOOTSTRAP_ENR}\ --max-peers=50