Fix validator keys path (#13772)
This commit is contained in:
parent
d18b417346
commit
008b56e535
|
@ -29,6 +29,8 @@ OPTIONS:
|
|||
--no-airdrop - Do not attempt to airdrop the stake
|
||||
--keypair FILE - Keypair to fund the stake from
|
||||
--force - Override delegate-stake sanity checks
|
||||
--vote-account - Path to vote-account keypair file
|
||||
--stake-account - Path to stake-account keypair file
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
|
@ -55,6 +57,12 @@ while [[ -n $1 ]]; do
|
|||
elif [[ $1 = --url || $1 = -u ]]; then
|
||||
url=$2
|
||||
shift 2
|
||||
elif [[ $1 = --vote-account ]]; then
|
||||
vote_account=$2
|
||||
shift 2
|
||||
elif [[ $1 = --stake-account ]]; then
|
||||
stake_account=$2
|
||||
shift 2
|
||||
elif [[ $1 = --no-airdrop ]]; then
|
||||
airdrops_enabled=0
|
||||
shift
|
||||
|
@ -80,9 +88,9 @@ if [[ -n ${positional_args[0]} ]]; then
|
|||
stake_sol=${positional_args[0]}
|
||||
fi
|
||||
|
||||
config_dir="$SOLANA_CONFIG_DIR/validator$label"
|
||||
vote_account="$config_dir"/vote-account.json
|
||||
stake_account="$config_dir"/stake-account.json
|
||||
VALIDATOR_KEYS_DIR=$SOLANA_CONFIG_DIR/validator$label
|
||||
vote_account="${vote_account:-$VALIDATOR_KEYS_DIR/vote-account.json}"
|
||||
stake_account="${stake_account:-$VALIDATOR_KEYS_DIR/stake-account.json}"
|
||||
|
||||
if [[ ! -f $vote_account ]]; then
|
||||
echo "Error: $vote_account not found"
|
||||
|
|
27
net/net.sh
27
net/net.sh
|
@ -196,24 +196,29 @@ build() {
|
|||
echo "Build took $SECONDS seconds"
|
||||
}
|
||||
|
||||
SOLANA_HOME="\$HOME/solana"
|
||||
CARGO_BIN="\$HOME/.cargo/bin"
|
||||
|
||||
startCommon() {
|
||||
declare ipAddress=$1
|
||||
test -d "$SOLANA_ROOT"
|
||||
if $skipSetup; then
|
||||
# shellcheck disable=SC2029
|
||||
ssh "${sshOptions[@]}" "$ipAddress" "
|
||||
set -x;
|
||||
mkdir -p ~/solana/config;
|
||||
mkdir -p $SOLANA_HOME/config;
|
||||
rm -rf ~/config;
|
||||
mv ~/solana/config ~;
|
||||
rm -rf ~/solana;
|
||||
mkdir -p ~/solana ~/.cargo/bin;
|
||||
mv ~/config ~/solana/
|
||||
mv $SOLANA_HOME/config ~;
|
||||
rm -rf $SOLANA_HOME;
|
||||
mkdir -p $SOLANA_HOME $CARGO_BIN;
|
||||
mv ~/config $SOLANA_HOME/
|
||||
"
|
||||
else
|
||||
# shellcheck disable=SC2029
|
||||
ssh "${sshOptions[@]}" "$ipAddress" "
|
||||
set -x;
|
||||
rm -rf ~/solana;
|
||||
mkdir -p ~/.cargo/bin
|
||||
rm -rf $SOLANA_HOME;
|
||||
mkdir -p $CARGO_BIN
|
||||
"
|
||||
fi
|
||||
[[ -z "$externalNodeSshKey" ]] || ssh-copy-id -f -i "$externalNodeSshKey" "${sshOptions[@]}" "solana@$ipAddress"
|
||||
|
@ -226,7 +231,7 @@ syncScripts() {
|
|||
rsync -vPrc -e "ssh ${sshOptions[*]}" \
|
||||
--exclude 'net/log*' \
|
||||
"$SOLANA_ROOT"/{fetch-perf-libs.sh,fetch-spl.sh,scripts,net,multinode-demo} \
|
||||
"$ipAddress":~/solana/ > /dev/null
|
||||
"$ipAddress":"$SOLANA_HOME"/ > /dev/null
|
||||
}
|
||||
|
||||
# Deploy local binaries to bootstrap validator. Other validators and clients later fetch the
|
||||
|
@ -237,11 +242,11 @@ deployBootstrapValidator() {
|
|||
echo "Deploying software to bootstrap validator ($ipAddress)"
|
||||
case $deployMethod in
|
||||
tar)
|
||||
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:~/.cargo/bin/"
|
||||
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:$CARGO_BIN/"
|
||||
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/version.yml "$ipAddress:~/"
|
||||
;;
|
||||
local)
|
||||
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/farf/bin/* "$ipAddress:~/.cargo/bin/"
|
||||
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/farf/bin/* "$ipAddress:$CARGO_BIN/"
|
||||
ssh "${sshOptions[@]}" -n "$ipAddress" "rm -f ~/version.yml; touch ~/version.yml"
|
||||
;;
|
||||
skip)
|
||||
|
@ -1096,7 +1101,7 @@ netem)
|
|||
remoteNetemConfigFile="$(basename "$netemConfigFile")"
|
||||
if [[ $netemCommand = "add" ]]; then
|
||||
for ipAddress in "${validatorIpList[@]}"; do
|
||||
"$here"/scp.sh "$netemConfigFile" solana@"$ipAddress":~/solana
|
||||
"$here"/scp.sh "$netemConfigFile" solana@"$ipAddress":"$SOLANA_HOME"
|
||||
done
|
||||
fi
|
||||
for i in "${!validatorIpList[@]}"; do
|
||||
|
|
|
@ -306,30 +306,30 @@ EOF
|
|||
|
||||
if [[ $nodeType = blockstreamer ]]; then
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/blockstreamer-identity.json config/validator-identity.json
|
||||
"$entrypointIp":~/solana/config/blockstreamer-identity.json "$SOLANA_CONFIG_DIR"/validator-identity.json
|
||||
else
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/validator-identity-"$nodeIndex".json config/validator-identity.json
|
||||
"$entrypointIp":~/solana/config/validator-identity-"$nodeIndex".json "$SOLANA_CONFIG_DIR"/validator-identity.json
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/validator-stake-"$nodeIndex".json config/stake-account.json
|
||||
"$entrypointIp":~/solana/config/validator-stake-"$nodeIndex".json "$SOLANA_CONFIG_DIR"/stake-account.json
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/validator-vote-"$nodeIndex".json config/vote-account.json
|
||||
"$entrypointIp":~/solana/config/validator-vote-"$nodeIndex".json "$SOLANA_CONFIG_DIR"/vote-account.json
|
||||
fi
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/shred-version config/shred-version
|
||||
"$entrypointIp":~/solana/config/shred-version "$SOLANA_CONFIG_DIR"/shred-version
|
||||
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/bank-hash config/bank-hash || true
|
||||
"$entrypointIp":~/solana/config/bank-hash "$SOLANA_CONFIG_DIR"/bank-hash || true
|
||||
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/config/faucet.json config/faucet.json
|
||||
"$entrypointIp":~/solana/config/faucet.json "$SOLANA_CONFIG_DIR"/faucet.json
|
||||
fi
|
||||
|
||||
args=(
|
||||
--entrypoint "$entrypointIp:8001"
|
||||
--gossip-port 8001
|
||||
--rpc-port 8899
|
||||
--expected-shred-version "$(cat config/shred-version)"
|
||||
--expected-shred-version "$(cat "$SOLANA_CONFIG_DIR"/shred-version)"
|
||||
)
|
||||
if [[ $nodeType = blockstreamer ]]; then
|
||||
args+=(
|
||||
|
@ -344,27 +344,27 @@ EOF
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f config/validator-identity.json ]]; then
|
||||
solana-keygen new --no-passphrase -so config/validator-identity.json
|
||||
if [[ ! -f "$SOLANA_CONFIG_DIR"/validator-identity.json ]]; then
|
||||
solana-keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/validator-identity.json
|
||||
fi
|
||||
args+=(--identity config/validator-identity.json)
|
||||
if [[ ! -f config/vote-account.json ]]; then
|
||||
solana-keygen new --no-passphrase -so config/vote-account.json
|
||||
args+=(--identity "$SOLANA_CONFIG_DIR"/validator-identity.json)
|
||||
if [[ ! -f "$SOLANA_CONFIG_DIR"/vote-account.json ]]; then
|
||||
solana-keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/vote-account.json
|
||||
fi
|
||||
args+=(--vote-account config/vote-account.json)
|
||||
args+=(--vote-account "$SOLANA_CONFIG_DIR"/vote-account.json)
|
||||
|
||||
if [[ $airdropsEnabled != true ]]; then
|
||||
args+=(--no-airdrop)
|
||||
fi
|
||||
|
||||
if [[ -r config/bank-hash ]]; then
|
||||
args+=(--expected-bank-hash "$(cat config/bank-hash)")
|
||||
if [[ -r "$SOLANA_CONFIG_DIR"/bank-hash ]]; then
|
||||
args+=(--expected-bank-hash "$(cat "$SOLANA_CONFIG_DIR"/bank-hash)")
|
||||
fi
|
||||
|
||||
set -x
|
||||
# Add the faucet keypair to validators for convenient access from tools
|
||||
# like bench-tps and add to blocktreamers to run a faucet
|
||||
scp "$entrypointIp":~/solana/config/faucet.json config/
|
||||
scp "$entrypointIp":~/solana/config/faucet.json "$SOLANA_CONFIG_DIR"/
|
||||
if [[ $nodeType = blockstreamer ]]; then
|
||||
# Run another faucet with the same keypair on the blockstreamer node.
|
||||
# Typically the blockstreamer node has a static IP/DNS name for hosting
|
||||
|
@ -422,7 +422,9 @@ EOF
|
|||
|
||||
if [[ ${extraPrimordialStakes} -eq 0 ]]; then
|
||||
echo "0 Primordial stakes, staking with $internalNodesStakeLamports"
|
||||
multinode-demo/delegate-stake.sh "${args[@]}" "$internalNodesStakeLamports"
|
||||
multinode-demo/delegate-stake.sh --vote-account "$SOLANA_CONFIG_DIR"/vote-account.json \
|
||||
--stake-account "$SOLANA_CONFIG_DIR"/stake-account.json \
|
||||
"${args[@]}" "$internalNodesStakeLamports"
|
||||
else
|
||||
echo "Skipping staking with extra stakes: ${extraPrimordialStakes}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue