solana/multinode-demo/validator.sh

33 lines
771 B
Bash
Raw Normal View History

#!/bin/bash
2018-06-23 11:52:12 -07:00
here=$(dirname "$0")
# shellcheck source=/dev/null
. "${here}"/myip.sh
2018-05-27 18:19:07 -07:00
leader=$1
[[ -z ${leader} ]] && {
echo "usage: $0 [network path to solana repo on leader machine]"
2018-05-27 18:19:07 -07:00
exit 1
}
2018-05-27 18:19:07 -07:00
myip=$(myip) || exit $?
2018-05-27 18:19:07 -07:00
[[ -f validator-"$myip".json ]] || {
echo "I can't find a matching validator config file for \"${myip}\"...
Please run ${here}/setup.sh first.
"
exit 1
}
2018-05-27 18:19:07 -07:00
rsync -vz "${leader}"/{mint-demo.json,leader.json,genesis.log,tx-*.log} . || exit $?
2018-05-27 18:19:07 -07:00
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null
2018-05-27 18:19:07 -07:00
# if RUST_LOG is unset, default to info
export RUST_LOG=${RUST_LOG:-solana=info}
cargo run --release --bin solana-fullnode -- \
-l validator-"${myip}".json -v leader.json \
< genesis.log tx-*.log