Move wallet airdrop retries into fullnode start script
This commit is contained in:
@ -18,12 +18,6 @@ for cmd in $backgroundCommands; do
|
|||||||
echo "--- Start $cmd"
|
echo "--- Start $cmd"
|
||||||
rm -f log-"$cmd".txt
|
rm -f log-"$cmd".txt
|
||||||
multinode-demo/"$cmd".sh > log-"$cmd".txt 2>&1 &
|
multinode-demo/"$cmd".sh > log-"$cmd".txt 2>&1 &
|
||||||
if [[ $cmd = drone ]]; then
|
|
||||||
# Give the drone time to startup before the fullnodes attempt to airdrop
|
|
||||||
# from it (TODO: alternatively adjust `solana-wallet airdrop` to retry on
|
|
||||||
# "Connection refused" errors)
|
|
||||||
sleep 2
|
|
||||||
fi
|
|
||||||
declare pid=$!
|
declare pid=$!
|
||||||
pids+=("$pid")
|
pids+=("$pid")
|
||||||
echo "pid: $pid"
|
echo "pid: $pid"
|
||||||
|
@ -184,15 +184,29 @@ $rsync -vPr "$rsync_leader_url"/config/ "$ledger_config_dir"
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$solana_wallet --keypair "$fullnode_id_path" address
|
||||||
|
|
||||||
# A fullnode requires 3 tokens to function:
|
# A fullnode requires 3 tokens to function:
|
||||||
# - one token to create an instance of the vote_program with
|
# - one token to create an instance of the vote_program with
|
||||||
# - one token for the transaction fee
|
# - one token for the transaction fee
|
||||||
# - one token to keep the node identity public key valid.
|
# - one token to keep the node identity public key valid.
|
||||||
$solana_wallet --keypair "$fullnode_id_path" address
|
retries=5
|
||||||
$solana_wallet \
|
while true; do
|
||||||
--keypair "$fullnode_id_path" \
|
$solana_wallet \
|
||||||
--network "$leader_address" \
|
--keypair "$fullnode_id_path" \
|
||||||
airdrop 3
|
--network "$leader_address" \
|
||||||
|
airdrop 3 \
|
||||||
|
&& break
|
||||||
|
|
||||||
|
# TODO: Consider moving this retry logic into `solana-wallet airdrop` itself,
|
||||||
|
# currently it does not retry on "Connection refused" errors.
|
||||||
|
retries=$((retries - 1))
|
||||||
|
if [[ $retries -le 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Airdrop failed. Remaining retries: $retries"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||||
$program \
|
$program \
|
||||||
|
Reference in New Issue
Block a user