bank: default auto-confirm poll interval to 2 seconds.

Faster explorer pool confirmation for demo withdrawals.
This commit is contained in:
Hernâni Marques 2026-07-16 20:49:53 +02:00
parent ffe8ad89db
commit 97b2fcce46
3 changed files with 186 additions and 66 deletions

View file

@ -61,18 +61,31 @@ else
fi
'
# start/restart API
# start/restart API + single auto-confirm loop (flock inside script)
podman exec -u root "$CTR" bash -lc '
pkill -f "demo-withdraw-api.py" 2>/dev/null || true
# stop demo-withdraw by pid (avoid pkill -f self-match)
ps -eo pid=,args= | awk "/demo-withdraw-api\\.py/ && !/awk/ {print \$1}" | while read p; do kill \$p 2>/dev/null || true; done
sleep 0.3
nohup python3 /usr/local/bin/demo-withdraw-api.py \
>>/var/log/demo-withdraw-api.log 2>&1 </dev/null &
echo "api pid $!"
# auto-confirm loop
pkill -f "auto-confirm-withdrawals.sh --loop" 2>/dev/null || true
nohup /usr/local/bin/auto-confirm-withdrawals.sh --loop 4 \
# stop auto-confirm by pid
ps -eo pid=,args= | awk "/auto-confirm-withdrawals\\.sh --loop/ && !/awk/ {print \$1}" | while read p; do kill \$p 2>/dev/null || true; done
sleep 0.5
if [ -f /var/log/auto-confirm-withdrawals.log ]; then
sz=$(wc -c </var/log/auto-confirm-withdrawals.log)
if [ "${sz:-0}" -gt 5000000 ]; then
tail -100 /var/log/auto-confirm-withdrawals.log > /tmp/ac-keep.log
: > /var/log/auto-confirm-withdrawals.log
cat /tmp/ac-keep.log >> /var/log/auto-confirm-withdrawals.log
fi
fi
nohup env QUIET=1 WATCH_MAX=80 \
/usr/local/bin/auto-confirm-withdrawals.sh --loop 2 \
>>/var/log/auto-confirm-withdrawals.log 2>&1 </dev/null &
echo "auto-confirm pid $!"
sleep 1
ps -eo pid=,args= | awk "/auto-confirm-withdrawals\\.sh --loop/ && !/awk/"
curl -sS -m 8 http://127.0.0.1:19096/demo-withdraw.json | head -c 300; echo
'