Add argument to net/net to specify number of nodes (#4429)
Allows for testing different node counts without recreating the network.
This commit is contained in:
parent
916844d399
commit
8611b40074
14
net/net.sh
14
net/net.sh
|
@ -52,6 +52,7 @@ Operate a configured testnet
|
|||
|
||||
--hashes-per-tick NUM_HASHES|sleep|auto
|
||||
- Override the default --hashes-per-tick for the cluster
|
||||
-n NUM_FULL_NODES - Number of fullnodes to apply command to.
|
||||
|
||||
sanity/start/update-specific options:
|
||||
-F - Discard validator nodes that didn't bootup successfully
|
||||
|
@ -86,6 +87,7 @@ benchTpsExtraArgs=
|
|||
benchExchangeExtraArgs=
|
||||
failOnValidatorBootupFailure=true
|
||||
genesisOptions=
|
||||
numFullnodesRequested=
|
||||
|
||||
command=$1
|
||||
[[ -n $command ]] || usage
|
||||
|
@ -106,7 +108,7 @@ while [[ -n $1 ]]; do
|
|||
fi
|
||||
done
|
||||
|
||||
while getopts "h?T:t:o:f:rD:i:c:F" opt "${shortArgs[@]}"; do
|
||||
while getopts "h?T:t:o:f:rD:i:c:Fn:" opt "${shortArgs[@]}"; do
|
||||
case $opt in
|
||||
h | \?)
|
||||
usage
|
||||
|
@ -130,6 +132,9 @@ while getopts "h?T:t:o:f:rD:i:c:F" opt "${shortArgs[@]}"; do
|
|||
f)
|
||||
cargoFeatures=$OPTARG
|
||||
;;
|
||||
n)
|
||||
numFullnodesRequested=$OPTARG
|
||||
;;
|
||||
i)
|
||||
updateManifestKeypairFile=$OPTARG
|
||||
if [[ ! -r $updateManifestKeypairFile ]]; then
|
||||
|
@ -159,7 +164,6 @@ while getopts "h?T:t:o:f:rD:i:c:F" opt "${shortArgs[@]}"; do
|
|||
echo "Error: Expecting tuple \"clientType=numClientType=extraArgs\" but got \"$OPTARG\""
|
||||
exit 1
|
||||
fi
|
||||
set -x
|
||||
local keyValue
|
||||
IFS='=' read -ra keyValue <<< "$OPTARG"
|
||||
local clientType=${keyValue[0]}
|
||||
|
@ -198,6 +202,12 @@ done
|
|||
|
||||
loadConfigFile
|
||||
|
||||
if [[ -n $numFullnodesRequested ]]; then
|
||||
truncatedNodeList=( "${fullnodeIpList[@]:0:$numFullnodesRequested}" )
|
||||
unset fullnodeIpList
|
||||
fullnodeIpList=( "${truncatedNodeList[@]}" )
|
||||
fi
|
||||
|
||||
numClients=${#clientIpList[@]}
|
||||
numClientsRequested=$((numBenchTpsClients+numBenchExchangeClients))
|
||||
if [[ "$numClientsRequested" -eq 0 ]]; then
|
||||
|
|
Loading…
Reference in New Issue