Ensure genesis ledger directory is populated on all validator nodes

This allows all nodes to serve the genesis ledger over rsync instead of
just the bootstrap leader
This commit is contained in:
Michael Vines 2019-03-21 15:27:09 -07:00 committed by Grimes
parent 3b5a9f512c
commit 437481853b
1 changed files with 6 additions and 7 deletions

View File

@ -167,14 +167,13 @@ rsync_url() { # adds the 'rsync://` prefix to URLs that need it
rsync_leader_url=$(rsync_url "$leader")
set -ex
if [[ ! -d "$ledger_config_dir" ]]; then
$rsync -vPr "$rsync_leader_url"/config/ledger/ "$ledger_config_dir"
[[ -d $ledger_config_dir ]] || {
echo "Unable to retrieve ledger from $rsync_leader_url"
exit 1
}
$solana_ledger_tool --ledger "$ledger_config_dir" verify
if [[ ! -d "$SOLANA_RSYNC_CONFIG_DIR"/ledger ]]; then
$rsync -vPr "$rsync_leader_url"/config/ledger "$SOLANA_RSYNC_CONFIG_DIR"/ledger
fi
if [[ ! -d "$ledger_config_dir" ]]; then
cp -a "$SOLANA_RSYNC_CONFIG_DIR"/ledger/ "$ledger_config_dir"
$solana_ledger_tool --ledger "$ledger_config_dir" verify
fi
trap 'kill "$pid" && wait "$pid"' INT TERM ERR