-
Notifications
You must be signed in to change notification settings - Fork 39
47 lines (43 loc) · 1.82 KB
/
checkdb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: checkdb
on:
schedule:
- cron: '0 13 * * *'
jobs:
download-snapshot-and-checkdb:
runs-on: self-hosted
container: quarkchaindocker/goquarkchain
timeout-minutes: 2880
steps:
- uses: actions/checkout@v2
- name: Install Dependencies and Build
run: |
echo "Install Dependencies and Build"
- name: Download DB snapshot
run: |
cd cmd/cluster
mkdir qkc-data
curl https://qkcmainnet-go.s3.amazonaws.com/data/`curl https://qkcmainnet-go.s3.amazonaws.com/data/LATEST`.tar.gz --output data.tar.gz
tar xvfz data.tar.gz
rm data.tar.gz && mv mainnet qkc-data
- name: Check DB
run: |
cd consensus/qkchash/native && make && cd -
cd cmd/cluster
go build
chmod +x cluster
cd - && cd cmd/cluster
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --service S0>> S0.log 2>&1 &
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --service S1>> S1.log 2>&1 &
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --service S2>> S2.log 2>&1 &
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --service S3>> S3.log 2>&1 &
sleep 3
cd - && cd cmd/cluster
WEEK_DAY=$(date +%w)
date
if [ $WEEK_DAY -eq 6 ];then
echo "Sunday:checkdb until 0 "
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --check_db
else
echo "Not Sunday:checkdb until 40w"
./cluster --cluster_config ../../mainnet/singularity/cluster_config_template.json --check_db --check_db_rblock_to=600000
fi