File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
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
+
3
12
# Determine the directory this script resides in. This allows invoking it from any location.
4
13
SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
5
14
@@ -32,10 +41,14 @@ echo "*** Building chainspec..."
32
41
" $BASE_DIR /target/release/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN > $FULL_PATH
33
42
echo " *** Chainspec built and output to file"
34
43
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"
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
39
52
40
53
echo " *** Starting localnet nodes..."
41
54
alice_start=(
You can’t perform that action at this time.
0 commit comments