4
4
This script sets up and runs a native testnet for the Aztec network.
5
5
6
6
Steps:
7
- 1. Parse command-line arguments for custom test script and number of validators.
7
+ 1. Parse command-line arguments for custom test script, number of validators, and logging level .
8
8
2. Set up the base command for running the native network test, including:
9
9
- Running the specified test script
10
10
- Deploying L1 and L2 contracts
21
21
./run_native_testnet.sh [options]
22
22
23
23
Options:
24
- -h: Display help message
25
- -t: Specify a custom test script (default: ./test-transfer.sh)
26
- -v: Specify the number of validators (default: 3)
24
+ see display_help() below
27
25
'
28
26
29
27
# Function to display help message
@@ -33,51 +31,74 @@ display_help() {
33
31
echo " Options:"
34
32
echo " -h Display this help message"
35
33
echo " -t Specify the test script file (default: ./test-transfer.sh)"
36
- echo " -v Specify the number of validators (default: 3)"
34
+ echo " -val Specify the number of validators (default: 3)"
35
+ echo " -v Set logging level to verbose"
36
+ echo " -vv Set logging level to debug"
37
+ echo " -i Run interleaved (default: false)"
37
38
echo
38
39
echo " Example:"
39
- echo " $0 -t ./custom-test.sh -v 5 "
40
+ echo " $0 -t ./custom-test.sh -val 5 -v "
40
41
}
41
42
42
43
# Default values
43
44
TEST_SCRIPT=" ./test-transfer.sh"
44
45
NUM_VALIDATORS=3
46
+ LOG_LEVEL=" info"
47
+ INTERLEAVED=false
45
48
46
49
# Parse command line arguments
47
- while getopts " ht:v: " opt ; do
48
- case $opt in
49
- h)
50
+ while [[ $# -gt 0 ]] ; do
51
+ case $1 in
52
+ - h)
50
53
display_help
51
54
exit 0
52
55
;;
53
- t) TEST_SCRIPT=" $OPTARG "
56
+ -t)
57
+ TEST_SCRIPT=" $2 "
58
+ shift 2
54
59
;;
55
- v) NUM_VALIDATORS=" $OPTARG "
60
+ -val)
61
+ NUM_VALIDATORS=" $2 "
62
+ shift 2
56
63
;;
57
- \? ) echo " Invalid option -$OPTARG " >&2
58
- display_help
59
- exit 1
64
+ -v)
65
+ if [[ $LOG_LEVEL == " info" ]]; then
66
+ LOG_LEVEL=" verbose"
67
+ elif [[ $LOG_LEVEL == " verbose" ]]; then
68
+ LOG_LEVEL=" debug"
69
+ fi
70
+ shift
71
+ ;;
72
+ -i)
73
+ INTERLEAVED=true
74
+ shift
75
+ ;;
76
+ -vv)
77
+ LOG_LEVEL=" debug"
78
+ shift
79
+ ;;
80
+ * )
81
+ echo " Invalid option: $1 " >&2
82
+ display_help
83
+ exit 1
60
84
;;
61
85
esac
62
86
done
63
87
88
+ # # Set log level for all child commands
89
+ export LOG_LEVEL
90
+
64
91
# Base command
65
- BASE_CMD=" ./yarn-project/end-to-end/scripts/native_network_test.sh \
92
+ BASE_CMD=" INTERLEAVED= $INTERLEAVED ./yarn-project/end-to-end/scripts/native_network_test.sh \
66
93
$TEST_SCRIPT \
67
94
./deploy-l1-contracts.sh \
68
95
./deploy-l2-contracts.sh \
69
96
./boot-node.sh \
70
97
./ethereum.sh \
71
- \" ./prover-node.sh false\" \
98
+ \" ./prover-node.sh 8078 false\" \
72
99
./pxe.sh \
73
- ./transaction-bot.sh"
74
-
75
- # Generate validator commands
76
- for (( i= 0 ; i< NUM_VALIDATORS; i++ ))
77
- do
78
- PORT=$(( 8081 + i))
79
- BASE_CMD+=" \" ./validator.sh $PORT \" "
80
- done
100
+ ./transaction-bot.sh \
101
+ \" ./validators.sh $NUM_VALIDATORS \" "
81
102
82
103
# Execute the command
83
104
eval $BASE_CMD
0 commit comments