Provision bench client accounts in genesis block (#4648)
* fixes to script * shellcheck * address review comments
This commit is contained in:
@@ -340,6 +340,8 @@ startBootstrapLeader() {
|
||||
\"$externalPrimordialAccountsFile\" \
|
||||
\"$stakeNodesInGenesisBlock\" \
|
||||
$nodeIndex \
|
||||
$numBenchTpsClients \"$benchTpsExtraArgs\" \
|
||||
$numBenchExchangeClients \"$benchExchangeExtraArgs\" \
|
||||
\"$genesisOptions\" \
|
||||
"
|
||||
) >> "$logFile" 2>&1 || {
|
||||
@@ -383,6 +385,7 @@ startNode() {
|
||||
startClient() {
|
||||
declare ipAddress=$1
|
||||
declare clientToRun="$2"
|
||||
declare clientIndex="$3"
|
||||
declare logFile="$netLogDir/client-$clientToRun-$ipAddress.log"
|
||||
echo "--- Starting client: $ipAddress - $clientToRun"
|
||||
echo "start log: $logFile"
|
||||
@@ -391,7 +394,7 @@ startClient() {
|
||||
startCommon "$ipAddress"
|
||||
ssh "${sshOptions[@]}" -f "$ipAddress" \
|
||||
"./solana/net/remote/remote-client.sh $deployMethod $entrypointIp \
|
||||
$clientToRun \"$RUST_LOG\" \"$benchTpsExtraArgs\" \"$benchExchangeExtraArgs\""
|
||||
$clientToRun \"$RUST_LOG\" \"$benchTpsExtraArgs\" \"$benchExchangeExtraArgs\" $clientIndex"
|
||||
) >> "$logFile" 2>&1 || {
|
||||
cat "$logFile"
|
||||
echo "^^^ +++"
|
||||
@@ -562,9 +565,9 @@ start() {
|
||||
SECONDS=0
|
||||
for ((i=0; i < "$numClients" && i < "$numClientsRequested"; i++)) do
|
||||
if [[ $i -lt "$numBenchTpsClients" ]]; then
|
||||
startClient "${clientIpList[$i]}" "solana-bench-tps"
|
||||
startClient "${clientIpList[$i]}" "solana-bench-tps" "$i"
|
||||
else
|
||||
startClient "${clientIpList[$i]}" "solana-bench-exchange"
|
||||
startClient "${clientIpList[$i]}" "solana-bench-exchange" "$i"
|
||||
fi
|
||||
done
|
||||
clientDeployTime=$SECONDS
|
||||
|
@@ -11,6 +11,7 @@ clientToRun="$3"
|
||||
RUST_LOG="$4"
|
||||
benchTpsExtraArgs="$5"
|
||||
benchExchangeExtraArgs="$6"
|
||||
clientIndex="$7"
|
||||
export RUST_LOG=${RUST_LOG:-solana=info} # if RUST_LOG is unset, default to info
|
||||
|
||||
missing() {
|
||||
@@ -54,6 +55,8 @@ scripts/net-stats.sh > net-stats.log 2>&1 &
|
||||
|
||||
case $clientToRun in
|
||||
solana-bench-tps)
|
||||
net/scripts/rsync-retry.sh -vPrc \
|
||||
"$entrypointIp":~/solana/solana-client-accounts/bench-tps"$clientIndex".yml ./client-accounts.yml
|
||||
clientCommand="\
|
||||
solana-bench-tps \
|
||||
--entrypoint $entrypointIp:8001 \
|
||||
@@ -62,6 +65,7 @@ solana-bench-tps)
|
||||
--sustained \
|
||||
--threads $threadCount \
|
||||
$benchTpsExtraArgs \
|
||||
--read-client-keys ./client-accounts.yml \
|
||||
"
|
||||
;;
|
||||
solana-bench-exchange)
|
||||
|
@@ -14,7 +14,11 @@ failOnValidatorBootupFailure="$7"
|
||||
externalPrimordialAccountsFile="$8"
|
||||
stakeNodesInGenesisBlock="$9"
|
||||
nodeIndex="${10}"
|
||||
genesisOptions="${11}"
|
||||
numBenchTpsClients="${11}"
|
||||
benchTpsExtraArgs="${12}"
|
||||
numBenchExchangeClients="${13}"
|
||||
benchExchangeExtraArgs="${14}"
|
||||
genesisOptions="${15}"
|
||||
set +x
|
||||
export RUST_LOG
|
||||
|
||||
@@ -90,9 +94,25 @@ local|tar)
|
||||
echo "${pubkey}: $stakeNodesInGenesisBlock" >> ./solana-node-stakes/fullnode-stakes.yml
|
||||
done
|
||||
fi
|
||||
rm -rf ./solana-client-accounts
|
||||
mkdir ./solana-client-accounts
|
||||
for i in $(seq 0 $((numBenchTpsClients-1))); do
|
||||
# shellcheck disable=SC2086 # Do not want to quote $benchTpsExtraArgs
|
||||
solana-bench-tps --write-client-keys ./solana-client-accounts/bench-tps"$i".yml $benchTpsExtraArgs
|
||||
# Skip first line, as it contains header
|
||||
tail -n +2 -q ./solana-client-accounts/bench-tps"$i".yml >> ./solana-client-accounts/client-accounts.yml
|
||||
echo "" >> ./solana-client-accounts/client-accounts.yml
|
||||
done
|
||||
for i in $(seq "$numBenchTpsClients" "$numBenchExchangeClients"); do
|
||||
# shellcheck disable=SC2086 # Do not want to quote $benchExchangeExtraArgs
|
||||
echo $benchExchangeExtraArgs
|
||||
# solana-bench-exchange -w ./solana-client-accounts/bench-exchange"$i".yml $benchExchangeExtraArgs
|
||||
# tail -n +2 -q ./solana-client-accounts/bench-exchange"$i".yml >> ./solana-client-accounts/client-accounts.yml
|
||||
done
|
||||
[[ -z $externalPrimordialAccountsFile ]] || cat "$externalPrimordialAccountsFile" >> ./solana-node-stakes/fullnode-stakes.yml
|
||||
if [ -f ./solana-node-stakes/fullnode-stakes.yml ]; then
|
||||
genesisOptions+=" --primordial-accounts-file ./solana-node-stakes/fullnode-stakes.yml"
|
||||
genesisOptions+=" --primordial-accounts-file ./solana-node-stakes/fullnode-stakes.yml \
|
||||
--primordial-keypairs-file ./solana-client-accounts/client-accounts.yml"
|
||||
fi
|
||||
if [[ $skipSetup != true ]]; then
|
||||
args=(
|
||||
|
Reference in New Issue
Block a user