mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 05:17:58 +00:00
270540cf46
* Add check_bootnode script and github action * fix mktemp for linux machines * Update check_bootnodes.sh show logs to see what's going wrong * fix ephemeral ports and fetch polkadot * fix check-bootnodes.yml * increase node spawn holdoff * disable fail-fast * refactor, separate out check_bootnodes and make it posix-compliant * add new job for detecting new bootnodes * fix check-bootnodes.yml * only check all bootnodes on release * Add test bad bootnode REVERT ME before merging PR. Should cause the test to fail, then when we remove it, we should succeed. Sadly doesn't account for a new successful bootnode, should ask if we have one we can use for testing. * fix paths * fix paths and git... hopefully * this better work... * fix * test * last test * Revert "Add test bad bootnode" This reverts commit 540dd9754a1f8e2d3fef33f7f5a033b8c2aa4dcb. * Update check_bootnodes.sh * optimisations Begin polling the RPC node right after spawning, allowing us to break early on detecting peers * increase holdoff to 5 seconds * dont delete chainspec til we kill the node * Update check-bootnodes.yml * Remove checking bootnodes on pushing of this branch --------- Co-authored-by: parity-processbot <>
43 lines
1.7 KiB
Bash
Executable File
43 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
||
set -e
|
||
# shellcheck source=scripts/ci/common/lib.sh
|
||
source "$(dirname "${0}")/../common/lib.sh"
|
||
|
||
# This script checks any new bootnodes added since the last git commit
|
||
|
||
RUNTIMES=( kusama westend polkadot )
|
||
|
||
WAS_ERROR=0
|
||
|
||
for RUNTIME in "${RUNTIMES[@]}"; do
|
||
CHAINSPEC_FILE="node/service/chain-specs/$RUNTIME.json"
|
||
# Get the bootnodes from master's chainspec
|
||
git show origin/master:"$CHAINSPEC_FILE" | jq '{"oldNodes": .bootNodes}' > "$RUNTIME-old-bootnodes.json"
|
||
# Get the bootnodes from the current branch's chainspec
|
||
git show HEAD:"$CHAINSPEC_FILE" | jq '{"newNodes": .bootNodes}' > "$RUNTIME-new-bootnodes.json"
|
||
# Make a chainspec containing only the new bootnodes
|
||
jq ".bootNodes = $(jq -rs '.[0] * .[1] | .newNodes-.oldNodes' \
|
||
"$RUNTIME-new-bootnodes.json" "$RUNTIME-old-bootnodes.json")" \
|
||
< "node/service/chain-specs/$RUNTIME.json" \
|
||
> "$RUNTIME-new-chainspec.json"
|
||
# exit early if the new chainspec has no bootnodes
|
||
if [ "$(jq -r '.bootNodes | length' "$RUNTIME-new-chainspec.json")" -eq 0 ]; then
|
||
echo "[+] No new bootnodes for $RUNTIME"
|
||
# Clean up the temporary files
|
||
rm "$RUNTIME-new-chainspec.json" "$RUNTIME-old-bootnodes.json" "$RUNTIME-new-bootnodes.json"
|
||
continue
|
||
fi
|
||
# Check the new bootnodes
|
||
if ! "scripts/ci/github/check_bootnodes.sh" "$RUNTIME-new-chainspec.json"; then
|
||
WAS_ERROR=1
|
||
fi
|
||
# Clean up the temporary files
|
||
rm "$RUNTIME-new-chainspec.json" "$RUNTIME-old-bootnodes.json" "$RUNTIME-new-bootnodes.json"
|
||
done
|
||
|
||
|
||
if [ $WAS_ERROR -eq 1 ]; then
|
||
echo "[!] One of the new bootnodes failed to connect. Please check logs above."
|
||
exit 1
|
||
fi
|