Show wallet commands for better log debugging
This commit is contained in:
parent
6969ece2dd
commit
9d2940d487
|
@ -85,30 +85,46 @@ setup_validator_accounts() {
|
||||||
echo "Vote and stake accounts have already been configured"
|
echo "Vote and stake accounts have already been configured"
|
||||||
else
|
else
|
||||||
if ((airdrops_enabled)); then
|
if ((airdrops_enabled)); then
|
||||||
# Fund the node with enough tokens to fund its Vote, Staking, and Storage accounts
|
echo "Fund the node with enough tokens to fund its Vote, Staking, and Storage accounts"
|
||||||
|
(
|
||||||
declare fees=100 # TODO: No hardcoded transaction fees, fetch the current cluster fees
|
declare fees=100 # TODO: No hardcoded transaction fees, fetch the current cluster fees
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" airdrop $((node_lamports+stake_lamports+fees)) || return $?
|
set -x
|
||||||
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
|
airdrop $((node_lamports+stake_lamports+fees))
|
||||||
|
) || return $?
|
||||||
else
|
else
|
||||||
echo "current account balance is "
|
echo "current account balance is "
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" balance || return $?
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" balance || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fund the vote account from the node, with the node as the identity_pubkey
|
echo "Fund the vote account from the node's identity pubkey"
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-vote-account "$vote_pubkey" "$identity_pubkey" 1 --commission 127 || return $?
|
create-vote-account "$vote_pubkey" "$identity_pubkey" 1 --commission 127
|
||||||
|
) || return $?
|
||||||
|
|
||||||
# Fund the stake account from the node, with the node as the identity_pubkey
|
echo "Fund the stake account from the node's identity pubkey"
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-stake-account "$stake_pubkey" "$stake_lamports" || return $?
|
create-stake-account "$stake_pubkey" "$stake_lamports"
|
||||||
|
) || return $?
|
||||||
|
|
||||||
# Delegate the stake. The transaction fee is paid by the node but the
|
echo "Delegate the stake account to the node's vote account"
|
||||||
# transaction must be signed by the stake_keypair
|
# transaction must be signed by the stake_keypair
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
delegate-stake "$stake_keypair_path" "$vote_pubkey" "$stake_lamports" || return $?
|
delegate-stake "$stake_keypair_path" "$vote_pubkey" "$stake_lamports"
|
||||||
|
) || return $?
|
||||||
|
|
||||||
# Setup validator storage account
|
echo "Create validator storage account"
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-validator-storage-account "$identity_pubkey" "$storage_pubkey" || return $?
|
create-validator-storage-account "$identity_pubkey" "$storage_pubkey"
|
||||||
|
) || return $?
|
||||||
|
|
||||||
touch "$configured_flag"
|
touch "$configured_flag"
|
||||||
fi
|
fi
|
||||||
|
@ -135,21 +151,31 @@ setup_replicator_account() {
|
||||||
echo "Replicator account has already been configured"
|
echo "Replicator account has already been configured"
|
||||||
else
|
else
|
||||||
if ((airdrops_enabled)); then
|
if ((airdrops_enabled)); then
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" airdrop "$node_lamports" || return $?
|
(
|
||||||
|
set -x
|
||||||
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899"
|
||||||
|
airdrop "$node_lamports"
|
||||||
|
) || return $?
|
||||||
else
|
else
|
||||||
echo "current account balance is "
|
echo "current account balance is "
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" balance || return $?
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" balance || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup replicator storage account
|
echo "Create replicator storage account"
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-replicator-storage-account "$identity_pubkey" "$storage_pubkey" || return $?
|
create-replicator-storage-account "$identity_pubkey" "$storage_pubkey"
|
||||||
|
) || return $?
|
||||||
|
|
||||||
touch "$configured_flag"
|
touch "$configured_flag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
set -x
|
||||||
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$identity_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
show-storage-account "$storage_pubkey"
|
show-storage-account "$storage_pubkey"
|
||||||
|
)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue