status-go/_assets/scripts/update-fleet-config.sh
Jakub Sokołowski 5ac8b873b8 config/cli/fleet: disable Rendezvous, drop nodes
Since we've broken LibP2P communication with our Rendezvous nodes
somewhere after `v0.79.11` we should not enable it by defaults since it
generates errors like these:
```
failed to dial 16Uiu2...d687e4: all dials failed
failed to negotiate security protocol: protocol not supported
```
Since normal bootnodes are defined as well as a list of static nodes
there should not be a need for using Rendezvous as well.

Resolves: https://github.com/status-im/status-go/issues/2309

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-08-13 16:22:17 +02:00

53 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
DIR="$(cd $(dirname "$0")/../../config/cli; pwd)"
echo "Downloading https://fleets.status.im/"
json=$(curl --silent https://fleets.status.im/)
fleets=(
'eth.prod'
'eth.staging'
'eth.test'
)
wakufleets=(
'wakuv2.test'
'wakuv2.prod'
)
for fleet in ${fleets[@]}; do
echo "Processing $fleet fleet..."
fleetJSON=$(echo $json | jq ".fleets.\"$fleet\"")
boot=$(echo $fleetJSON | jq ".boot | map(.)" -r)
mail=$(echo $fleetJSON | jq ".mail | map(.)" -r)
# Get random nodes from whisper node list
maxStaticNodeCount=2
staticNodeCount=$(echo $fleetJSON | jq ".whisper | length")
index=$(($RANDOM % ($staticNodeCount - ($maxStaticNodeCount - 1))))
whisper=$(echo $fleetJSON | jq ".whisper | map(.) | .[$index:($index + $maxStaticNodeCount)]" -r)
git checkout $DIR/fleet-$fleet.json \
&& jq \
".ClusterConfig.BootNodes = $boot \
| .ClusterConfig.TrustedMailServers = $mail \
| .ClusterConfig.StaticNodes = $whisper" \
$DIR/fleet-$fleet.json \
| tee "$DIR/tmp.json" >/dev/null \
&& mv $DIR/tmp.json $DIR/fleet-$fleet.json
done
for fleet in ${wakufleets[@]}; do
echo "Processing $fleet fleet..."
fleetJSON=$(echo $json | jq ".fleets.\"$fleet\"")
waku=$(echo $fleetJSON | jq ".waku | map(.)" -r)
git checkout $DIR/fleet-$fleet.json \
&& jq \
".ClusterConfig.WakuNodes = $waku" \
$DIR/fleet-$fleet.json \
| tee "$DIR/tmp.json" >/dev/null \
&& mv $DIR/tmp.json $DIR/fleet-$fleet.json
done