Skip to content

Commit 53c4fde

Browse files
authored
Hotfix: Update API source in node ping tester script (#6082)
1 parent 00cc54f commit 53c4fde

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

scripts/test-nodes-pings.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
API_URL="${API_URL:-https://validator.nymtech.net/api/v1/gateways/described}"
4+
API_URL="${API_URL:-https://validator.nymtech.net/api/v1/nym-nodes/described}"
55
CONCURRENCY="${CONCURRENCY:-64}" # how many pings in flight
66
PING_TIMEOUT="${PING_TIMEOUT:-7}" # seconds to wait for a single echo reply
77
PING_RETRIES="${PING_RETRIES:-1}" # additional attempts after the first failure
@@ -28,19 +28,13 @@ curl -fsSL --retry 3 --retry-delay 1 --compressed "$API_URL" -o "$tmp_json"
2828
# extract IPs
2929
ip_list="$(mktemp)"
3030
jq -r '
31-
.[]? as $g
32-
| (
33-
($g.self_described.host_information.ip_address? // [])
34-
+ (
35-
[ $g.bond.gateway.host ]
36-
| map(select(type=="string"))
37-
)
38-
)[]
31+
.data[]?
32+
| (.description.host_information.ip_address? // [])[]
3933
' "$tmp_json" \
4034
| awk '
4135
# very permissive IPv4/IPv6 syntax filters (we let ping validate the rest)
4236
function is_ipv4(s){ return (s ~ /^[0-9]{1,3}(\.[0-9]{1,3}){3}$/) }
43-
function is_ipv6(s){ return (index(s,":")>0) }
37+
function is_ipv6(s){ return (index(s,":") > 0) }
4438
{ if(is_ipv4($0) || is_ipv6($0)) print $0 }
4539
' \
4640
| sort -u > "$ip_list"
@@ -99,3 +93,4 @@ awk '{printf "%s,%s\n",$1,$2}' "$num_list" \
9993
echo "Done. Results:"
10094
echo " $(($(wc -l < "$OK_CSV") - 1)) reachable -> $OK_CSV"
10195
echo " $(($(wc -l < "$BAD_CSV") - 1)) not reachable -> $BAD_CSV"
96+

0 commit comments

Comments
 (0)