run.sh: Use default client keypair for the faucet (bp #13614) (#13618)

* Use default client keypair if --keypair argument is not provided

(cherry picked from commit e9e5ee4362)

# Conflicts:
#	faucet/Cargo.toml

* Use default client keypair if --faucet-keypair is not provided

(cherry picked from commit 4069e7b663)

# Conflicts:
#	genesis/Cargo.toml

* Cargo.lock

(cherry picked from commit ab5814cd90)

# Conflicts:
#	Cargo.lock

* Use default client keypair for faucet to avoid the need for airdrops

(cherry picked from commit b5820f9325)

* Fix conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
mergify[bot]
2020-11-17 02:23:01 +00:00
committed by GitHub
parent 719f162229
commit a77fce465a
7 changed files with 34 additions and 20 deletions

13
run.sh
View File

@@ -37,6 +37,10 @@ ledgerDir=$PWD/config/ledger
SOLANA_RUN_SH_CLUSTER_TYPE=${SOLANA_RUN_SH_CLUSTER_TYPE:-development}
set -x
if ! solana address; then
echo Generating default keypair
solana-keygen new --no-passphrase
fi
validator_identity="$dataDir/validator-identity.json"
if [[ -e $validator_identity ]]; then
echo "Use existing validator keypair"
@@ -55,12 +59,6 @@ if [[ -e $validator_stake_account ]]; then
else
solana-keygen new --no-passphrase -so "$validator_stake_account"
fi
faucet="$dataDir"/faucet.json
if [[ -e $faucet ]]; then
echo "Use existing faucet keypair"
else
solana-keygen new --no-passphrase -fso "$faucet"
fi
if [[ -e "$ledgerDir"/genesis.bin || -e "$ledgerDir"/genesis.tar.bz2 ]]; then
echo "Use existing genesis"
@@ -73,7 +71,6 @@ else
# shellcheck disable=SC2086
solana-genesis \
--hashes-per-tick sleep \
--faucet-pubkey "$dataDir"/faucet.json \
--faucet-lamports 500000000000000000 \
--bootstrap-validator \
"$dataDir"/validator-identity.json \
@@ -92,7 +89,7 @@ abort() {
}
trap abort INT TERM EXIT
solana-faucet --keypair "$dataDir"/faucet.json &
solana-faucet &
faucet=$!
args=(