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
parent e2871053bd
commit f93c9f052f

View File

@ -167,12 +167,12 @@ rsync_url() { # adds the 'rsync://` prefix to URLs that need it
rsync_leader_url=$(rsync_url "$leader")
set -ex
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
$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
}
cp -ra "$SOLANA_RSYNC_CONFIG_DIR"/ledger "$ledger_config_dir"
$solana_ledger_tool --ledger "$ledger_config_dir" verify
fi