Preserve pre-existing vote/stake keypairs for bootstrap validator (#19405) (#19410)

(cherry picked from commit d559426373)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-08-24 23:44:06 +00:00
committed by GitHub
parent 5193ba2062
commit 8ab358ce78
2 changed files with 16 additions and 3 deletions

View File

@ -21,9 +21,16 @@ if [[ -f $BOOTSTRAP_VALIDATOR_IDENTITY_KEYPAIR ]]; then
else
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json
fi
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
if [[ -f $BOOTSTRAP_VALIDATOR_STAKE_KEYPAIR ]]; then
cp -f "$BOOTSTRAP_VALIDATOR_STAKE_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
else
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
fi
if [[ -f $BOOTSTRAP_VALIDATOR_VOTE_KEYPAIR ]]; then
cp -f "$BOOTSTRAP_VALIDATOR_VOTE_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
else
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
fi
args=(
"$@"

View File

@ -226,6 +226,12 @@ EOF
if [[ -f net/keypairs/bootstrap-validator-identity.json ]]; then
export BOOTSTRAP_VALIDATOR_IDENTITY_KEYPAIR=net/keypairs/bootstrap-validator-identity.json
fi
if [[ -f net/keypairs/bootstrap-validator-stake.json ]]; then
export BOOTSTRAP_VALIDATOR_STAKE_KEYPAIR=net/keypairs/bootstrap-validator-stake.json
fi
if [[ -f net/keypairs/bootstrap-validator-vote.json ]]; then
export BOOTSTRAP_VALIDATOR_VOTE_KEYPAIR=net/keypairs/bootstrap-validator-vote.json
fi
echo "remote-node.sh: Primordial stakes: $extraPrimordialStakes"
if [[ "$extraPrimordialStakes" -gt 0 ]]; then
if [[ "$extraPrimordialStakes" -gt "$numNodes" ]]; then