mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
Test/waku canary (#3597)
* Adding waku canary test scripts * Update README file note: The real author of this commit is Aya. I just resubmitted her PR after a deep nwaku history cleanup --------- Co-authored-by: aya <ayahassan2877@gmail.com>
This commit is contained in:
parent
74b3770f6c
commit
682c76c714
@ -32,21 +32,31 @@ $ make wakucanary
|
||||
And used as follows. A reachable node that supports both `store` and `filter` protocols.
|
||||
|
||||
```console
|
||||
$ ./build/wakucanary --address=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV --protocol=store --protocol=filter
|
||||
$ ./build/wakucanary \
|
||||
--address=/dns4/store-01.do-ams3.status.staging.status.im/tcp/30303/p2p/16Uiu2HAm3xVDaz6SRJ6kErwC21zBJEZjavVXg7VSkoWzaV1aMA3F \
|
||||
--protocol=store \
|
||||
--protocol=filter \
|
||||
--cluster-id=16 \
|
||||
--shard=64
|
||||
$ echo $?
|
||||
0
|
||||
```
|
||||
|
||||
A node that can't be reached.
|
||||
```console
|
||||
$ ./build/wakucanary --address=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/1000/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV --protocol=store --protocol=filter
|
||||
$ ./build/wakucanary \
|
||||
--address=/dns4/store-01.do-ams3.status.staging.status.im/tcp/1000/p2p/16Uiu2HAm3xVDaz6SRJ6kErwC21zBJEZjavVXg7VSkoWzaV1aMA3F \
|
||||
--protocol=store \
|
||||
--protocol=filter \
|
||||
--cluster-id=16 \
|
||||
--shard=64
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
Note that a domain name can also be used.
|
||||
```console
|
||||
$ ./build/wakucanary --address=/dns4/node-01.do-ams3.status.test.status.im/tcp/30303/p2p/16Uiu2HAkukebeXjTQ9QDBeNDWuGfbaSg79wkkhK4vPocLgR6QFDf --protocol=store --protocol=filter
|
||||
--- not defined yet
|
||||
$ echo $?
|
||||
0
|
||||
```
|
||||
|
||||
50
apps/wakucanary/scripts/run_waku_canary.sh
Executable file
50
apps/wakucanary/scripts/run_waku_canary.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
#this script build the canary app and make basic run to connect to well-known peer via TCP .
|
||||
set -e
|
||||
|
||||
PEER_ADDRESS="/dns4/store-01.do-ams3.status.staging.status.im/tcp/30303/p2p/16Uiu2HAm3xVDaz6SRJ6kErwC21zBJEZjavVXg7VSkoWzaV1aMA3F"
|
||||
PROTOCOL="relay"
|
||||
LOG_DIR="logs"
|
||||
CLUSTER="16"
|
||||
SHARD="64"
|
||||
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
LOG_FILE="$LOG_DIR/canary_run_$TIMESTAMP.log"
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
echo "Building Waku Canary app..."
|
||||
( cd ../../../ && make wakucanary ) >> "$LOG_FILE" 2>&1
|
||||
|
||||
echo "Running Waku Canary against:"
|
||||
echo " Peer : $PEER_ADDRESS"
|
||||
echo " Protocol: $PROTOCOL"
|
||||
echo "Log file : $LOG_FILE"
|
||||
echo "-----------------------------------"
|
||||
|
||||
{
|
||||
echo "=== Canary Run: $TIMESTAMP ==="
|
||||
echo "Peer : $PEER_ADDRESS"
|
||||
echo "Protocol : $PROTOCOL"
|
||||
echo "LogLevel : DEBUG"
|
||||
echo "-----------------------------------"
|
||||
../../../build/wakucanary \
|
||||
--address="$PEER_ADDRESS" \
|
||||
--protocol="$PROTOCOL" \
|
||||
--cluster-id="$CLUSTER"\
|
||||
--shard="$SHARD"\
|
||||
--log-level=DEBUG
|
||||
echo "-----------------------------------"
|
||||
echo "Exit code: $?"
|
||||
} 2>&1 | tee "$LOG_FILE"
|
||||
|
||||
EXIT_CODE=${PIPESTATUS[0]}
|
||||
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "SUCCESS: Connected to peer and protocol '$PROTOCOL' is supported."
|
||||
else
|
||||
echo "FAILURE: Could not connect or protocol '$PROTOCOL' is unsupported."
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
46
apps/wakucanary/scripts/test_protocols.sh
Executable file
46
apps/wakucanary/scripts/test_protocols.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# === Configuration ===
|
||||
WAKUCANARY_BINARY="../../../build/wakucanary"
|
||||
PEER_ADDRESS="/dns4/store-01.do-ams3.status.staging.status.im/tcp/30303/p2p/16Uiu2HAm3xVDaz6SRJ6kErwC21zBJEZjavVXg7VSkoWzaV1aMA3F"
|
||||
TIMEOUT=5
|
||||
LOG_LEVEL="info"
|
||||
PROTOCOLS=("store" "relay" "lightpush" "filter")
|
||||
|
||||
# === Logging Setup ===
|
||||
LOG_DIR="logs"
|
||||
mkdir -p "$LOG_DIR"
|
||||
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
LOG_FILE="$LOG_DIR/ping_test_$TIMESTAMP.log"
|
||||
|
||||
echo "Building Waku Canary app..."
|
||||
( cd ../../../ && make wakucanary ) >> "$LOG_FILE" 2>&1
|
||||
|
||||
echo "Protocol Support Test - $TIMESTAMP" | tee -a "$LOG_FILE"
|
||||
echo "Peer: $PEER_ADDRESS" | tee -a "$LOG_FILE"
|
||||
echo "---------------------------------------" | tee -a "$LOG_FILE"
|
||||
|
||||
# === Protocol Testing Loop ===
|
||||
for PROTOCOL in "${PROTOCOLS[@]}"; do
|
||||
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
LOG_FILE="$LOG_DIR/ping_test_${PROTOCOL}_$TIMESTAMP.log"
|
||||
|
||||
{
|
||||
echo "=== Canary Run: $TIMESTAMP ==="
|
||||
echo "Peer : $PEER_ADDRESS"
|
||||
echo "Protocol : $PROTOCOL"
|
||||
echo "LogLevel : DEBUG"
|
||||
echo "-----------------------------------"
|
||||
$WAKUCANARY_BINARY \
|
||||
--address="$PEER_ADDRESS" \
|
||||
--protocol="$PROTOCOL" \
|
||||
--log-level=DEBUG
|
||||
echo "-----------------------------------"
|
||||
echo "Exit code: $?"
|
||||
} 2>&1 | tee "$LOG_FILE"
|
||||
|
||||
echo "✅ Log saved to: $LOG_FILE"
|
||||
echo ""
|
||||
done
|
||||
|
||||
echo "All protocol checks completed. Log saved to: $LOG_FILE"
|
||||
51
apps/wakucanary/scripts/web_socket.sh
Executable file
51
apps/wakucanary/scripts/web_socket.sh
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
#this script build the canary app and make basic run to connect to well-known peer via TCP .
|
||||
set -e
|
||||
|
||||
PEER_ADDRESS="/ip4/127.0.0.1/tcp/7777/ws/p2p/16Uiu2HAm4ng2DaLPniRoZtMQbLdjYYWnXjrrJkGoXWCoBWAdn1tu"
|
||||
PROTOCOL="relay"
|
||||
LOG_DIR="logs"
|
||||
CLUSTER="16"
|
||||
SHARD="64"
|
||||
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
LOG_FILE="$LOG_DIR/canary_run_$TIMESTAMP.log"
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
echo "Building Waku Canary app..."
|
||||
( cd ../../../ && make wakucanary ) >> "$LOG_FILE" 2>&1
|
||||
|
||||
|
||||
echo "Running Waku Canary against:"
|
||||
echo " Peer : $PEER_ADDRESS"
|
||||
echo " Protocol: $PROTOCOL"
|
||||
echo "Log file : $LOG_FILE"
|
||||
echo "-----------------------------------"
|
||||
|
||||
{
|
||||
echo "=== Canary Run: $TIMESTAMP ==="
|
||||
echo "Peer : $PEER_ADDRESS"
|
||||
echo "Protocol : $PROTOCOL"
|
||||
echo "LogLevel : DEBUG"
|
||||
echo "-----------------------------------"
|
||||
../../../build/wakucanary \
|
||||
--address="$PEER_ADDRESS" \
|
||||
--protocol="$PROTOCOL" \
|
||||
--cluster-id="$CLUSTER"\
|
||||
--shard="$SHARD"\
|
||||
--log-level=DEBUG
|
||||
echo "-----------------------------------"
|
||||
echo "Exit code: $?"
|
||||
} 2>&1 | tee "$LOG_FILE"
|
||||
|
||||
EXIT_CODE=${PIPESTATUS[0]}
|
||||
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "SUCCESS: Connected to peer and protocol '$PROTOCOL' is supported."
|
||||
else
|
||||
echo "FAILURE: Could not connect or protocol '$PROTOCOL' is unsupported."
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
43
apps/wakucanary/scripts/web_socket_certitficate.sh
Normal file
43
apps/wakucanary/scripts/web_socket_certitficate.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
WAKUCANARY_BINARY="../../../build/wakucanary"
|
||||
NODE_PORT=60000
|
||||
WSS_PORT=$((NODE_PORT + 1000))
|
||||
PEER_ID="16Uiu2HAmB6JQpewXScGoQ2syqmimbe4GviLxRwfsR8dCpwaGBPSE"
|
||||
PROTOCOL="relay"
|
||||
KEY_PATH="./certs/client.key"
|
||||
CERT_PATH="./certs/client.crt"
|
||||
LOG_DIR="logs"
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
PEER_ADDRESS="/ip4/127.0.0.1/tcp/$WSS_PORT/wss/p2p/$PEER_ID"
|
||||
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
LOG_FILE="$LOG_DIR/wss_cert_test_$TIMESTAMP.log"
|
||||
|
||||
echo "Building Waku Canary app..."
|
||||
( cd ../../../ && make wakucanary ) >> "$LOG_FILE" 2>&1
|
||||
|
||||
{
|
||||
echo "=== Canary WSS + Cert Test ==="
|
||||
echo "Timestamp : $TIMESTAMP"
|
||||
echo "Node Port : $NODE_PORT"
|
||||
echo "WSS Port : $WSS_PORT"
|
||||
echo "Peer ID : $PEER_ID"
|
||||
echo "Protocol : $PROTOCOL"
|
||||
echo "Key Path : $KEY_PATH"
|
||||
echo "Cert Path : $CERT_PATH"
|
||||
echo "Address : $PEER_ADDRESS"
|
||||
echo "------------------------------------------"
|
||||
|
||||
$WAKUCANARY_BINARY \
|
||||
--address="$PEER_ADDRESS" \
|
||||
--protocol="$PROTOCOL" \
|
||||
--log-level=DEBUG \
|
||||
--websocket-secure-key-path="$KEY_PATH" \
|
||||
--websocket-secure-cert-path="$CERT_PATH"
|
||||
|
||||
echo "------------------------------------------"
|
||||
echo "Exit code: $?"
|
||||
} 2>&1 | tee "$LOG_FILE"
|
||||
|
||||
echo "✅ Log saved to: $LOG_FILE"
|
||||
Loading…
x
Reference in New Issue
Block a user