From 8ab358ce78b28cf8b0296125eb01a0790bb716fb Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 24 Aug 2021 23:44:06 +0000 Subject: [PATCH] Preserve pre-existing vote/stake keypairs for bootstrap validator (#19405) (#19410) (cherry picked from commit d5594263730ae3164af8c1f10f0cf5d3f4864d3e) Co-authored-by: Tyera Eulberg --- multinode-demo/setup.sh | 13 ++++++++++--- net/remote/remote-node.sh | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/multinode-demo/setup.sh b/multinode-demo/setup.sh index ac2b26243e..306c246ad9 100755 --- a/multinode-demo/setup.sh +++ b/multinode-demo/setup.sh @@ -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=( "$@" diff --git a/net/remote/remote-node.sh b/net/remote/remote-node.sh index d302a0d6e3..6670977fb8 100755 --- a/net/remote/remote-node.sh +++ b/net/remote/remote-node.sh @@ -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