-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR: produce snapshot s0 & s1 (#996)
* upd * snapshot * fix bug of s1, execute one more cmd Co-authored-by: liang xiong <[email protected]>
- Loading branch information
1 parent
dd37964
commit 55a0bed
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
HOME=$1 | ||
VERSION=$2 | ||
CMD=exchaind | ||
NUM_EXECUTIONS=2 | ||
|
||
set -e | ||
set -o errexit | ||
set -a | ||
set -m | ||
|
||
killbyname() { | ||
NAME=$1 | ||
ps -ef|grep "$NAME"|grep -v grep |awk '{print "kill -9 "$2", "$8}' | ||
ps -ef|grep "$NAME"|grep -v grep |awk '{print "kill -9 "$2}' | sh | ||
echo "All <$NAME> killed!" | ||
} | ||
|
||
|
||
killbyname exchaind | ||
killbyname exchaincli | ||
|
||
set -x # activate debugging | ||
|
||
|
||
if [ "$1" == "-h" ]; | ||
then | ||
echo "Usage: exchaind [home] [s0|s1]" | ||
exit 0 | ||
fi | ||
|
||
if [ -z "$HOME" ]; | ||
then | ||
echo specify home directory first please | ||
exit -1 | ||
fi | ||
|
||
if [ -z "$VERSION" ]; | ||
then | ||
echo specify version first please | ||
exit -1 | ||
fi | ||
|
||
|
||
echo using $VERSION mode | ||
|
||
if [ "$VERSION" = "s0" ]; | ||
then | ||
for (( i=0; i<NUM_EXECUTIONS; i++ )) | ||
do | ||
echo runing $i-th times... | ||
$CMD data prune-compact all --home $HOME | ||
done | ||
rm -rf $HOME/data/cs.wal | ||
rm -rf $HOME/data/tx_index.db | ||
rm -rf $HOME/data/evidence.db | ||
rm -rf $HOME/data/watch.db | ||
else | ||
for (( i=0; i<NUM_EXECUTIONS; i++ )) | ||
do | ||
echo runing $i-th times... | ||
$CMD data prune-compact state --home $HOME | ||
done | ||
rm -rf $HOME/data/watch.db | ||
fi |