2018-05-23 13:03:19 -07:00
|
|
|
#!/bin/bash
|
2018-06-23 11:52:12 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
here=$(dirname "$0")
|
|
|
|
# shellcheck source=multinode-demo/common.sh
|
|
|
|
source "$here"/common.sh
|
2018-06-22 18:18:09 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
if [[ -d "$SNAP" ]]; then
|
|
|
|
# Exit if mode is not yet configured
|
|
|
|
# (typically the case after the Snap is first installed)
|
|
|
|
[[ -n "$(snapctl get mode)" ]] || exit 0
|
|
|
|
fi
|
2018-06-22 18:18:09 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
[[ -f "$SOLANA_CONFIG_DIR"/leader.json ]] || {
|
|
|
|
echo "$SOLANA_CONFIG_DIR/leader.json not found, run ${here}/setup.sh first"
|
2018-06-22 18:18:09 -07:00
|
|
|
exit 1
|
|
|
|
}
|
2018-06-14 17:11:55 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
if [[ -n "$SOLANA_CUDA" ]]; then
|
|
|
|
program="$solana_fullnode_cuda"
|
|
|
|
else
|
|
|
|
program="$solana_fullnode"
|
|
|
|
fi
|
2018-06-22 11:37:42 -07:00
|
|
|
|
2018-06-24 10:10:55 -07:00
|
|
|
# shellcheck disable=SC2086 # $program should not be quoted
|
|
|
|
exec $program \
|
|
|
|
-l "$SOLANA_CONFIG_DIR"/leader.json \
|
|
|
|
< "$SOLANA_CONFIG_DIR"/genesis.log "$SOLANA_CONFIG_DIR"/tx-*.log \
|
|
|
|
> "$SOLANA_CONFIG_DIR"/tx-"$(date -u +%Y%m%d%H%M%S%N)".log
|