Calculate bench client lamports based on signature fee (#4713)

* use fee calculator to compute max fee

* review comments

* shellcheck
This commit is contained in:
Pankaj Garg
2019-06-18 14:44:53 -07:00
committed by GitHub
parent 2da7c7fbd3
commit e43a634944
4 changed files with 44 additions and 2 deletions

View File

@ -115,11 +115,23 @@ local|tar)
echo "${pubkey}: $stakeNodesInGenesisBlock" >> ./solana-node-stakes/fullnode-stakes.yml
done
fi
lamports_per_signature="42"
# shellcheck disable=SC2206 # Do not want to quote $genesisOptions
genesis_args=($genesisOptions)
for i in "${!genesis_args[@]}"; do
if [[ "${genesis_args[$i]}" = --target-lamports-per-signature ]]; then
lamports_per_signature="${genesis_args[$((i+1))]}"
break
fi
done
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
solana-bench-tps --write-client-keys ./solana-client-accounts/bench-tps"$i".yml \
--target-lamports-per-signature "$lamports_per_signature" $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