Skip to content

Commit 576ec48

Browse files
committed
Set my preferred defaults
1 parent 7c68a76 commit 576ec48

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

scripts/devnet.sh

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,58 @@ fi
99
read -p "Enter the total number of validators (default: 4): " total_validators
1010
total_validators=${total_validators:-4}
1111

12-
# Read the total number of clients from the user or use a default value of 2
13-
read -p "Enter the total number of clients (default: 2): " total_clients
14-
total_clients=${total_clients:-2}
12+
# Read the total number of clients from the user or use a default value of 0
13+
read -p "Enter the total number of clients (default: 0): " total_clients
14+
total_clients=${total_clients:-0}
1515

1616
# Read the network ID from user or use a default value of 1
1717
read -p "Enter the network ID (mainnet = 0, testnet = 1, canary = 2) (default: 1): " network_id
1818
network_id=${network_id:-1}
1919

2020
# Ask the user if they want to run 'cargo install --locked --path .' or use a pre-installed binary
21-
read -p "Do you want to run 'cargo install --locked --path .' to build the binary? (y/n, default: y): " build_binary
22-
build_binary=${build_binary:-y}
21+
read -p "Do you want to run build (b) or install (i) the binary? (b/i/n, default: b): " build_binary
22+
build_binary=${build_binary:-b}
23+
24+
# Ask the user whether to use a custom relative path
25+
read -p "Do you want to run snarkos from a relative path? (default: ./target/debug/snarkos): " binary_path
26+
binary_path=${binary_path:-"./target/debug/snarkos"}
2327

2428
# Ask the user whether to clear the existing ledger history
25-
read -p "Do you want to clear the existing ledger history? (y/n, default: n): " clear_ledger
26-
clear_ledger=${clear_ledger:-n}
29+
read -p "Do you want to clear the existing ledger history? (y/n, default: y): " clear_ledger
30+
clear_ledger=${clear_ledger:-y}
2731

2832
# Log verbosity is set to 1 (DEBUG) by default.
2933
verbosity=1
3034

3135
# Binary path set to "" by default (using installed binary)
3236
binary_path=""
3337

34-
if [[ $build_binary == "y" ]]; then
38+
# Build command set to "" by default
39+
build_cmd=""
40+
41+
if [[ $build_binary != "n" ]]; then
3542
# Ask the user for additional crate features (comma-separated)
3643
read -p "Enter crate features to enable (comma separated, default: test_network,telemetry): " crate_features
3744
crate_features=${crate_features:-test_network,telemetry}
3845

39-
# Build command
40-
build_cmd="cargo install --locked --path ."
46+
if [[ $build_binary == "i" ]]; then
47+
# Build command
48+
build_cmd="cargo install --locked --path ."
49+
elif [[ $build_binary == "b" ]]; then
50+
# Build command
51+
build_cmd="cargo build"
52+
fi
4153

4254
# Add any extra features if provided
4355
if [[ -n $crate_features ]]; then
4456
build_cmd+=" --features ${crate_features}"
4557
fi
46-
4758
# Build command
4859
echo "Running build command: \"$build_cmd\""
4960
eval "$build_cmd" || exit 1
50-
else
51-
# Ask the user whether to use a custom relative path
52-
read -p "Do you want to run snarkos from a relative path? (default: ./target/debug/snarkos): " binary_path
53-
binary_path=${binary_path:-"./target/debug/snarkos"}
5461
fi
5562

63+
5664
# Clear the ledger logs for each validator if the user chooses to clear ledger
5765
if [[ $clear_ledger == "y" ]]; then
5866
# Create an array to store background processes

0 commit comments

Comments
 (0)