2024-06-06 12:33:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Create a set of states, each advanced by 100k blocks
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
trap "exit" INT
|
|
|
|
|
2024-07-01 12:07:39 +00:00
|
|
|
if [ -z "$3" ]
|
2024-06-06 12:33:49 +00:00
|
|
|
then
|
2024-07-01 12:07:39 +00:00
|
|
|
echo "Syntax: make_states.sh datadir era1dir statsdir [startdir]"
|
2024-06-06 12:33:49 +00:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
counter=0
|
|
|
|
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
DATE="$(date -u +%Y%m%d_%H%M)"
|
|
|
|
REV=$(git rev-parse --short=8 HEAD)
|
2024-07-01 12:07:39 +00:00
|
|
|
DATA_DIR="$1/${DATE}-${REV}"
|
|
|
|
|
|
|
|
mkdir -p "$DATA_DIR"
|
|
|
|
[ "$4" ] && cp -ar "$4"/* "$DATA_DIR"
|
2024-06-06 12:33:49 +00:00
|
|
|
|
|
|
|
while true;
|
|
|
|
do
|
|
|
|
"$SCRIPT_DIR/../build/nimbus" import \
|
2024-07-01 12:07:39 +00:00
|
|
|
--data-dir:"${DATA_DIR}" \
|
2024-06-06 12:33:49 +00:00
|
|
|
--era1-dir:"$2" \
|
|
|
|
--debug-csv-stats:"$3/stats-${DATE}-${REV}.csv" \
|
|
|
|
--max-blocks:100000
|
|
|
|
cp -ar "$1/${DATE}-${REV}" "$1/${DATE}-${REV}"-$(printf "%04d" $counter)
|
|
|
|
counter=$((counter+1))
|
|
|
|
done
|