Avoid airdropping to a validator that's already configured
This commit is contained in:
@ -272,18 +272,12 @@ wallet() {
|
|||||||
setup_validator_accounts() {
|
setup_validator_accounts() {
|
||||||
declare node_lamports=$1
|
declare node_lamports=$1
|
||||||
|
|
||||||
if ((airdrops_enabled)); then
|
|
||||||
echo "Adding $node_lamports to validator identity account:"
|
|
||||||
(
|
|
||||||
declare fees=100 # TODO: No hardcoded transaction fees, fetch the current cluster fees
|
|
||||||
wallet airdrop $((node_lamports+fees)) lamports
|
|
||||||
) || return $?
|
|
||||||
else
|
|
||||||
echo "Validator identity account balance:"
|
|
||||||
wallet balance --lamports || return $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! wallet show-vote-account "$voting_keypair_path"; then
|
if ! wallet show-vote-account "$voting_keypair_path"; then
|
||||||
|
if ((airdrops_enabled)); then
|
||||||
|
echo "Adding $node_lamports to validator identity account:"
|
||||||
|
wallet airdrop "$node_lamports" lamports || return $?
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Creating validator vote account"
|
echo "Creating validator vote account"
|
||||||
wallet create-vote-account "$voting_keypair_path" "$identity_keypair_path" 1 --commission 127 || return $?
|
wallet create-vote-account "$voting_keypair_path" "$identity_keypair_path" 1 --commission 127 || return $?
|
||||||
fi
|
fi
|
||||||
@ -295,6 +289,9 @@ setup_validator_accounts() {
|
|||||||
fi
|
fi
|
||||||
echo "Validator storage account configured"
|
echo "Validator storage account configured"
|
||||||
|
|
||||||
|
echo "Validator identity account balance:"
|
||||||
|
wallet balance --lamports || return $?
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user