summaryrefslogtreecommitdiff
path: root/examples/docker-minimal/docker/merge.sh
blob: 93808c52a3b04f412a8b059a638ae9a85ed886ea (plain)
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
#! /bin/sh

S1=300; [ -n "$1" ] && S1=$1
S2=1200; [ -n "$2" ] && S2=$2

[ -d mergedb ] && rm -rf mergedb
mkdir mergedb
mkdir mergedb/chains
touch mergedb/logorder

date
echo "merge: waiting $(expr $S1 / 60)m$(expr $S1 % 60)s before merging for the first time"
sleep $S1

while true; do
    echo "merge: merging"
    date
    tools/merge.py \
        --baseurl https://127.0.0.1:8080/ \
        --storage https://127.0.0.1:8081/ \
        --frontend https://127.0.0.1:8082/ \
        --mergedb mergedb \
        --keyfile examples/docker-minimal/docker/eckey.pem
    echo "merge: waiting $(expr $S2 / 60)m$(expr $S2 % 60)s before merging again"
    sleep $S2
done