Skip to content

Commit 56d8b39

Browse files
committed
Revert "Added --no-purge flag to scripts/localnet.sh to be able to save state when restarting a script."
This reverts commit 5eb52b5.
1 parent 5eb52b5 commit 56d8b39

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

scripts/localnet.sh

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
#!/bin/bash
22

3-
# Check if `--no-purge` passed as a parameter
4-
NO_PURGE=0
5-
for arg in "$@"; do
6-
if [ "$arg" = "--no-purge" ]; then
7-
NO_PURGE=1
8-
break
9-
fi
10-
done
11-
123
# Determine the directory this script resides in. This allows invoking it from any location.
134
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
145

@@ -41,14 +32,10 @@ echo "*** Building chainspec..."
4132
"$BASE_DIR/target/release/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN >$FULL_PATH
4233
echo "*** Chainspec built and output to file"
4334

44-
if [ $NO_PURGE -eq 1 ]; then
45-
echo "*** Purging previous state skipped..."
46-
else
47-
echo "*** Purging previous state..."
48-
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
49-
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
50-
echo "*** Previous chainstate purged"
51-
fi
35+
echo "*** Purging previous state..."
36+
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
37+
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
38+
echo "*** Previous chainstate purged"
5239

5340
echo "*** Starting localnet nodes..."
5441
alice_start=(

0 commit comments

Comments
 (0)