Fund solana-install deployments from the mint keypair to avoid airdrops (#4997)
This commit is contained in:
parent
0a949677f0
commit
32b55e6703
|
@ -34,4 +34,6 @@ loadConfigFile
|
|||
PATH="$HOME"/.cargo/bin:"$PATH"
|
||||
|
||||
set -x
|
||||
scripts/solana-install-deploy.sh localhost "$releaseChannel" "$updatePlatform"
|
||||
scripts/solana-install-deploy.sh \
|
||||
--keypair config-local/mint-keypair.json \
|
||||
localhost "$releaseChannel" "$updatePlatform"
|
||||
|
|
|
@ -5,6 +5,17 @@
|
|||
set -e
|
||||
SOLANA_ROOT="$(cd "$(dirname "$0")"/..; pwd)"
|
||||
|
||||
maybeKeypair=
|
||||
while [[ ${1:0:2} = -- ]]; do
|
||||
if [[ $1 = --keypair && -n $2 ]]; then
|
||||
maybeKeypair="$1 $2"
|
||||
shift 2
|
||||
else
|
||||
echo "Error: Unknown option: $1"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
URL=$1
|
||||
TAG=$2
|
||||
OS=${3:-linux}
|
||||
|
@ -60,8 +71,12 @@ esac
|
|||
PATH="$SOLANA_ROOT"/target/debug:$PATH
|
||||
|
||||
set -x
|
||||
balance=$(solana-wallet --url "$URL" balance)
|
||||
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
|
||||
balance=$(solana-wallet $maybeKeypair --url "$URL" balance)
|
||||
if [[ $balance = "0 lamports" ]]; then
|
||||
solana-wallet --url "$URL" airdrop 42
|
||||
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
|
||||
solana-wallet $maybeKeypair --url "$URL" airdrop 42
|
||||
fi
|
||||
solana-install deploy --url "$URL" "$DOWNLOAD_URL" update_manifest_keypair.json
|
||||
|
||||
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
|
||||
solana-install deploy $maybeKeypair --url "$URL" "$DOWNLOAD_URL" update_manifest_keypair.json
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Convenience script to easily deploy a software update to a testnet
|
||||
#
|
||||
# Prerequisites:
|
||||
# 1) The default keypair should have some lamports (eg, `solana-wallet airdrop 123`)
|
||||
# 2) The file update_manifest_keypair.json should exist if this script is not
|
||||
# run from the CI environment
|
||||
# Creates update_manifest_keypair.json based on the current platform and
|
||||
# environment
|
||||
#
|
||||
set -e
|
||||
|
||||
|
|
Loading…
Reference in New Issue