2020-02-14 20:58:03 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
SOLANA_ROOT="$(cd ../..; pwd)"
|
|
|
|
|
|
|
|
logDir="$PWD"/logs
|
|
|
|
rm -rf "$logDir"
|
|
|
|
mkdir "$logDir"
|
|
|
|
|
|
|
|
solanaInstallDataDir=$PWD/releases
|
|
|
|
solanaInstallGlobalOpts=(
|
|
|
|
--data-dir "$solanaInstallDataDir"
|
|
|
|
--config "$solanaInstallDataDir"/config.yml
|
|
|
|
--no-modify-path
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install all the solana versions
|
|
|
|
bootstrapInstall() {
|
|
|
|
declare v=$1
|
|
|
|
if [[ ! -h $solanaInstallDataDir/active_release ]]; then
|
|
|
|
sh "$SOLANA_ROOT"/install/solana-install-init.sh "$v" "${solanaInstallGlobalOpts[@]}"
|
|
|
|
fi
|
|
|
|
export PATH="$solanaInstallDataDir/active_release/bin/:$PATH"
|
|
|
|
}
|
|
|
|
|
|
|
|
bootstrapInstall "edge"
|
2020-04-23 11:46:12 -07:00
|
|
|
solana-install-init --version
|
|
|
|
solana-install-init edge
|
|
|
|
solana-gossip --version
|
|
|
|
solana-dos --version
|
2020-02-14 20:58:03 -08:00
|
|
|
|
|
|
|
killall solana-gossip || true
|
|
|
|
solana-gossip spy --gossip-port 8001 > "$logDir"/gossip.log 2>&1 &
|
|
|
|
solanaGossipPid=$!
|
|
|
|
echo "solana-gossip pid: $solanaGossipPid"
|
|
|
|
sleep 5
|
2020-04-21 16:58:30 -07:00
|
|
|
solana-dos --mode gossip --data-type random --data-size 1232 &
|
2020-03-20 12:55:38 -07:00
|
|
|
dosPid=$!
|
|
|
|
echo "solana-dos pid: $dosPid"
|
2020-02-14 20:58:03 -08:00
|
|
|
|
|
|
|
pass=true
|
|
|
|
|
|
|
|
SECONDS=
|
|
|
|
while ((SECONDS < 600)); do
|
|
|
|
if ! kill -0 $solanaGossipPid; then
|
|
|
|
echo "solana-gossip is no longer running after $SECONDS seconds"
|
|
|
|
pass=false
|
|
|
|
break
|
|
|
|
fi
|
2020-03-20 12:55:38 -07:00
|
|
|
if ! kill -0 $dosPid; then
|
|
|
|
echo "solana-dos is no longer running after $SECONDS seconds"
|
2020-02-14 20:58:03 -08:00
|
|
|
pass=false
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
kill $solanaGossipPid || true
|
2020-03-20 12:55:38 -07:00
|
|
|
kill $dosPid || true
|
2020-02-14 20:58:03 -08:00
|
|
|
wait || true
|
|
|
|
|
|
|
|
$pass && echo Pass
|