solana/multinode-demo/bootstrap-leader.sh

42 lines
1.1 KiB
Bash
Raw Normal View History

2018-12-07 10:00:35 -08:00
#!/usr/bin/env bash
#
# Start the bootstrap leader node
#
here=$(dirname "$0")
# shellcheck source=multinode-demo/common.sh
source "$here"/common.sh
# shellcheck source=scripts/oom-score-adj.sh
source "$here"/../scripts/oom-score-adj.sh
2019-03-04 14:27:06 -08:00
[[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json ]] || {
echo "$SOLANA_CONFIG_DIR/bootstrap-leader-id.json not found, create it by running:"
2018-12-07 10:00:35 -08:00
echo
echo " ${here}/setup.sh"
exit 1
}
if [[ -n "$SOLANA_CUDA" ]]; then
program="$solana_fullnode_cuda"
else
program="$solana_fullnode"
fi
tune_system
2018-12-07 10:00:35 -08:00
trap 'kill "$pid" && wait "$pid"' INT TERM
$solana_ledger_tool --ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger verify
2019-02-21 15:16:09 -08:00
# shellcheck disable=SC2086 # Don't want to double quote maybe_blockstream or maybe_init_complete_file
2018-12-07 10:00:35 -08:00
$program \
2019-03-04 14:27:06 -08:00
--identity "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json \
2018-12-07 10:00:35 -08:00
--ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger \
--accounts "$SOLANA_CONFIG_DIR"/bootstrap-leader-accounts \
--rpc-port 8899 \
2019-03-04 14:27:06 -08:00
"$@" \
2018-12-07 10:00:35 -08:00
> >($bootstrap_leader_logger) 2>&1 &
pid=$!
oom_score_adj "$pid" 1000
wait "$pid"