diff --git a/ci/testnet-deploy.sh b/ci/testnet-deploy.sh index bef14e7f41..22d9418037 100755 --- a/ci/testnet-deploy.sh +++ b/ci/testnet-deploy.sh @@ -262,6 +262,11 @@ trap shutdown EXIT INT set -x +# Fetch reusable testnet keypairs +if [[ ! -d net/keypairs ]]; then + git clone git@github.com:solana-labs/testnet-keypairs.git net/keypairs +fi + # Build a string to pass zone opts to $cloudProvider.sh: "-z zone1 -z zone2 ..." zone_args=() for val in "${zone[@]}"; do diff --git a/multinode-demo/setup.sh b/multinode-demo/setup.sh index beff65a9b9..a9be30e39f 100755 --- a/multinode-demo/setup.sh +++ b/multinode-demo/setup.sh @@ -10,9 +10,18 @@ rm -rf "$SOLANA_CONFIG_DIR"/bootstrap-leader mkdir -p "$SOLANA_CONFIG_DIR"/bootstrap-leader # Create genesis ledger -$solana_keygen new -f -o "$SOLANA_CONFIG_DIR"/mint-keypair.json +if [[ -r $MINT_KEYPAIR ]]; then + cp -f "$MINT_KEYPAIR" "$SOLANA_CONFIG_DIR"/mint-keypair.json +else + $solana_keygen new -f -o "$SOLANA_CONFIG_DIR"/mint-keypair.json +fi + +if [[ -f $BOOTSTRAP_LEADER_IDENTITY_KEYPAIR ]]; then + cp -f "$BOOTSTRAP_LEADER_IDENTITY_KEYPAIR" "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json +else + $solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json +fi -$solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/identity-keypair.json $solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/vote-keypair.json $solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/stake-keypair.json $solana_keygen new -o "$SOLANA_CONFIG_DIR"/bootstrap-leader/storage-keypair.json diff --git a/net/remote/remote-node.sh b/net/remote/remote-node.sh index b6c462bf93..74535764ca 100755 --- a/net/remote/remote-node.sh +++ b/net/remote/remote-node.sh @@ -163,9 +163,18 @@ EOF if [[ -n $internalNodesLamports ]]; then echo "---" >> config/validator-balances.yml - for i in $(seq 0 "$numNodes"); do - solana-keygen new -o config/validator-"$i"-identity.json - pubkey="$(solana-keygen pubkey config/validator-"$i"-identity.json)" + fi + + setupValidatorKeypair() { + declare name=$1 + if [[ -f net/keypairs/"$name".json ]]; then + cp net/keypairs/"$name".json config/"$name".json + else + solana-keygen new -o config/"$name".json + fi + if [[ -n $internalNodesLamports ]]; then + declare pubkey + pubkey="$(solana-keygen pubkey config/"$name".json)" cat >> config/validator-balances.yml <