-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.bat
47 lines (38 loc) · 1.36 KB
/
test.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@echo off
del *.csv
set builderCount=%1
set validatorCount=%2
set nonValidatorCount=%3
set parcelSize=%4
if "%builderCount%"=="" (
echo There should be 4 parameters: builderCount, validatorCount, nonValidatorCount, and parcelSize. e.g. test.bat 1 2 1 512
exit /b
) else if "%validatorCount%"=="" (
echo There should be 4 parameters: builderCount, validatorCount, nonValidatorCount, and parcelSize. e.g. test.bat 1 2 1 512
exit /b
) else if "%nonValidatorCount%"=="" (
echo There should be 4 parameters: builderCount, validatorCount, nonValidatorCount, and parcelSize. e.g. test.bat 1 2 1 512
exit /b
) else if "%parcelSize%"=="" (
echo There should be 4 parameters: builderCount, validatorCount, nonValidatorCount, and parcelSize. e.g. test.bat 1 2 1 512
exit /b
)
set /a builderCount=%builderCount%
if %builderCount% leq 0 (
echo builderCount should be greater than 0.
exit /b
)
set /a nonBuilderCount=%validatorCount%+%nonValidatorCount%
if %nonBuilderCount% leq 0 (
echo The sum of validatorCount and nonValidatorCount should be greater than 0.
exit /b
)
for /L %%i in (1,1,%builderCount%) do (
start /B "" run.bat builder %parcelSize%
)
for /L %%i in (1,1,%validatorCount%) do (
start /B "" run.bat validator %parcelSize%
)
for /L %%i in (1,1,%nonValidatorCount%) do (
start /B "" run.bat nonvalidator %parcelSize%
)