2018-07-20 10:19:33 -07:00
|
|
|
#!/bin/bash -e
|
2018-05-27 18:19:07 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
here=$(dirname "$0")
|
|
|
|
# shellcheck source=multinode-demo/common.sh
|
|
|
|
source "$here"/common.sh
|
2018-05-27 18:19:07 -07:00
|
|
|
|
2018-08-31 00:10:39 -07:00
|
|
|
usage() {
|
|
|
|
if [[ -n $1 ]]; then
|
|
|
|
echo "$*"
|
|
|
|
echo
|
2018-07-13 23:37:56 -07:00
|
|
|
fi
|
2018-08-31 00:10:39 -07:00
|
|
|
echo "usage: $0 [network entry point] [extra args]"
|
|
|
|
echo
|
|
|
|
echo " Run bench-tps against the specified network"
|
|
|
|
echo
|
|
|
|
echo " extra args: additional arguments are pass along to solana-bench-tps"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# this is a little hacky
|
|
|
|
if [[ ${1:0:2} != "--" ]]; then
|
2018-08-31 00:18:00 -07:00
|
|
|
read -r _ leader_address shift < <(find_leader "${@:1:1}")
|
2018-07-23 16:10:33 -07:00
|
|
|
else
|
2018-08-31 00:18:00 -07:00
|
|
|
read -r _ leader_address shift < <(find_leader)
|
2018-07-20 10:19:33 -07:00
|
|
|
fi
|
2018-08-31 00:10:39 -07:00
|
|
|
shift "$shift"
|
2018-05-27 18:19:07 -07:00
|
|
|
|
2018-07-22 17:15:53 -07:00
|
|
|
|
2018-08-31 00:10:39 -07:00
|
|
|
client_json="$SOLANA_CONFIG_CLIENT_DIR"/client.json
|
|
|
|
[[ -r $client_json ]] || $solana_keygen -o "$client_json"
|
2018-06-26 16:46:17 -07:00
|
|
|
|
2018-08-09 17:42:25 -07:00
|
|
|
set -x
|
2018-08-31 00:10:39 -07:00
|
|
|
$solana_bench_tps \
|
|
|
|
--network "$leader_address" \
|
|
|
|
--keypair "$SOLANA_CONFIG_CLIENT_DIR"/client.json \
|
|
|
|
"$@"
|