2018-11-11 08:02:50 -08:00
|
|
|
#!/usr/bin/env bash
|
2018-06-24 10:10:55 -07:00
|
|
|
#
|
2018-08-27 09:13:53 -07:00
|
|
|
# Starts an instance of solana-drone
|
|
|
|
#
|
2018-06-24 10:10:55 -07:00
|
|
|
here=$(dirname "$0")
|
2018-08-31 00:10:39 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
# shellcheck source=multinode-demo/common.sh
|
|
|
|
source "$here"/common.sh
|
|
|
|
|
2018-08-31 00:10:39 -07:00
|
|
|
usage() {
|
|
|
|
if [[ -n $1 ]]; then
|
|
|
|
echo "$*"
|
|
|
|
echo
|
2018-06-24 10:10:55 -07:00
|
|
|
fi
|
2018-11-14 18:57:34 -08:00
|
|
|
echo "usage: $0]"
|
2018-08-31 00:10:39 -07:00
|
|
|
echo
|
2018-11-14 18:57:34 -08:00
|
|
|
echo " Run an airdrop drone"
|
2018-08-31 00:10:39 -07:00
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2018-12-06 13:38:45 -08:00
|
|
|
[[ -f "$SOLANA_CONFIG_DIR"/mint-id.json ]] || {
|
|
|
|
echo "$SOLANA_CONFIG_DIR/mint-id.json not found, create it by running:"
|
2018-07-02 16:10:55 -07:00
|
|
|
echo
|
2018-12-06 13:38:45 -08:00
|
|
|
echo " ${here}/setup.sh"
|
2018-07-02 16:10:55 -07:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
set -ex
|
2018-07-30 14:29:34 -07:00
|
|
|
|
|
|
|
trap 'kill "$pid" && wait "$pid"' INT TERM
|
2018-07-17 13:31:24 -07:00
|
|
|
$solana_drone \
|
2018-12-06 13:38:45 -08:00
|
|
|
--keypair "$SOLANA_CONFIG_DIR"/mint-id.json \
|
2018-07-30 14:29:34 -07:00
|
|
|
> >($drone_logger) 2>&1 &
|
|
|
|
pid=$!
|
|
|
|
wait "$pid"
|