Skip to content

nightly-check-db

nightly-check-db #1041

name: nightly-check-db
on:
schedule:
- cron: '1 8 */2 * *'
env:
PYTHONPATH: ${{ github.workspace }}
jobs:
download-snapshot-and-checkdb:
runs-on: self-hosted
container: quarkchaindocker/pyquarkchain:mainnet1.1.1
timeout-minutes: 4320
steps:
- uses: actions/checkout@v2
with:
ref: master
- name: Install Dependencies and Build
run: |
PYTHONPATH=/code/pyquarkchain pip3 install -e .
cd qkchash && make clean && make
- name: Download DB snapshot
run: |
mkdir -p quarkchain/cluster/qkc-data
curl -s https://s3-us-west-2.amazonaws.com/qkcmainnet/data/LATEST > LATEST
curl -s https://s3-us-west-2.amazonaws.com/qkcmainnet/data/`cat LATEST`.tar.gz --output data.tar.gz
tar xvfz data.tar.gz
rm data.tar.gz && mv data quarkchain/cluster/qkc-data/mainnet
- name: Check DB
run: |
height=$(python quarkchain/tools/db_browser.py --cluster_config=`pwd`/mainnet/singularity/cluster_config_template.json root_print_tip 2> /dev/null | grep "height" | awk "{print \$2}" | sed "s/,$//")
day_of_week=`date +%u`
end=$(( day_of_week == 7 ? 0 : height - 100000 )) # run whole dataset on Sunday
echo "Checking: $height -> $end"
QKC__QUARKCHAIN__DISABLE_POW_CHECK=True ./run_cluster.sh \
--check_db=True \
--check_db_rblock_batch=100 \
--check_db_rblock_from=$height \
--check_db_rblock_to=$end \
--cluster_config `pwd`/mainnet/singularity/cluster_config_template_8nodes.json