Script to run net-shaper on remote nodes (#6938)

* Script to run net-shaper on remote nodes

* fixes
This commit is contained in:
Pankaj Garg
2019-11-13 20:31:44 -08:00
committed by GitHub
parent 4fc767b3f6
commit c96b8c8d68
3 changed files with 65 additions and 20 deletions

View File

@ -80,6 +80,7 @@ BINS=(
solana-keygen
solana-ledger-tool
solana-log-analyzer
solana-net-shaper
solana-archiver
solana-validator
)

24
scripts/net-shaper.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# Start/Stop network shaper
#
set -e
[[ $(uname) == Linux ]] || exit 0
cd "$(dirname "$0")"
sudo=
if sudo true; then
sudo="sudo -n"
fi
set -x
iface="$(ifconfig | grep mtu | grep -iv loopback | grep -i running | awk 'BEGIN { FS = ":" } ; {print $1}')"
if [[ "$1" = cleanup ]]; then
$sudo ~solana/.cargo/bin/solana-net-shaper cleanup -f "$2" -s "$3" -p "$4" -i "$iface"
else
$sudo ~solana/.cargo/bin/solana-net-shaper shape -f "$2" -s "$3" -p "$4" -i "$iface"
fi