Skip to content

Commit 88df14e

Browse files
authored
Merge pull request #1393 from opentensor/feat/roman/add-flag-build-only
Add flag `--build-only`
2 parents 5903742 + f19a566 commit 88df14e

File tree

1 file changed

+44
-37
lines changed

1 file changed

+44
-37
lines changed

scripts/localnet.sh

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
# Check if `--no-purge` passed as a parameter
44
NO_PURGE=0
5+
6+
# Check if `--build-only` passed as parameter
7+
BUILD_ONLY=0
8+
59
for arg in "$@"; do
610
if [ "$arg" = "--no-purge" ]; then
711
NO_PURGE=1
8-
break
12+
elif [ "$arg" = "--build-only" ]; then
13+
BUILD_ONLY=1
914
fi
1015
done
1116

@@ -72,39 +77,41 @@ else
7277
echo "*** Previous chainstate purged"
7378
fi
7479

75-
echo "*** Starting localnet nodes..."
76-
alice_start=(
77-
"$BUILD_DIR/release/node-subtensor"
78-
--base-path /tmp/alice
79-
--chain="$FULL_PATH"
80-
--alice
81-
--port 30334
82-
--rpc-port 9944
83-
--validator
84-
--rpc-cors=all
85-
--allow-private-ipv4
86-
--discover-local
87-
--unsafe-force-node-key-generation
88-
)
89-
90-
bob_start=(
91-
"$BUILD_DIR/release/node-subtensor"
92-
--base-path /tmp/bob
93-
--chain="$FULL_PATH"
94-
--bob
95-
--port 30335
96-
--rpc-port 9945
97-
--validator
98-
--rpc-cors=all
99-
--allow-private-ipv4
100-
--discover-local
101-
--unsafe-force-node-key-generation
102-
)
103-
104-
trap 'pkill -P $$' EXIT SIGINT SIGTERM
105-
106-
(
107-
("${alice_start[@]}" 2>&1) &
108-
("${bob_start[@]}" 2>&1)
109-
wait
110-
)
80+
if [ $BUILD_ONLY -eq 0 ]; then
81+
echo "*** Starting localnet nodes..."
82+
alice_start=(
83+
"$BUILD_DIR/release/node-subtensor"
84+
--base-path /tmp/alice
85+
--chain="$FULL_PATH"
86+
--alice
87+
--port 30334
88+
--rpc-port 9944
89+
--validator
90+
--rpc-cors=all
91+
--allow-private-ipv4
92+
--discover-local
93+
--unsafe-force-node-key-generation
94+
)
95+
96+
bob_start=(
97+
"$BUILD_DIR/release/node-subtensor"
98+
--base-path /tmp/bob
99+
--chain="$FULL_PATH"
100+
--bob
101+
--port 30335
102+
--rpc-port 9945
103+
--validator
104+
--rpc-cors=all
105+
--allow-private-ipv4
106+
--discover-local
107+
--unsafe-force-node-key-generation
108+
)
109+
110+
trap 'pkill -P $$' EXIT SIGINT SIGTERM
111+
112+
(
113+
("${alice_start[@]}" 2>&1) &
114+
("${bob_start[@]}" 2>&1)
115+
wait
116+
)
117+
fi

0 commit comments

Comments
 (0)