Skip to content

Commit

Permalink
Revert "Added --no-purge flag to scripts/localnet.sh to be able t…
Browse files Browse the repository at this point in the history
…o save state when restarting a script."

This reverts commit 5eb52b5.
  • Loading branch information
roman-opentensor committed Jul 23, 2024
1 parent 5eb52b5 commit 56d8b39
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions scripts/localnet.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#!/bin/bash

# Check if `--no-purge` passed as a parameter
NO_PURGE=0
for arg in "$@"; do
if [ "$arg" = "--no-purge" ]; then
NO_PURGE=1
break
fi
done

# Determine the directory this script resides in. This allows invoking it from any location.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"

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

if [ $NO_PURGE -eq 1 ]; then
echo "*** Purging previous state skipped..."
else
echo "*** Purging previous state..."
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
echo "*** Previous chainstate purged"
fi
echo "*** Purging previous state..."
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
echo "*** Previous chainstate purged"

echo "*** Starting localnet nodes..."
alice_start=(
Expand Down

0 comments on commit 56d8b39

Please sign in to comment.