auto checkpointing

Signed-off-by: wowario <wowario@protonmail.com>
wowario 4 years ago
parent d14d83d5ce
commit 058d6e87b5
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -0,0 +1,18 @@
#!/bin/bash
while true
do
echo "Checkpointing"
height=$( curl -s http://127.0.0.1:34568/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json' | jq -r '.result.height' )
echo "Starting height: $height"
declare -i value
value=$height-60
echo "Roll back 60 blocks. New height: $value"
echo "Unix time: $EPOCHSECONDS"
/home/ubuntu/wownero/build/Linux/master/release/bin/wownero-blockchain-export --blocksdat --block-stop $value --output-file /home/ubuntu/wownero/src/blocks/archive/checkpoint_$value.dat &
sleep 10s
sha256sum /home/ubuntu/wownero/src/blocks/archive/checkpoint_$value.dat
echo "Sleeping..."
echo "Press [CTRL+C] to stop..."
sleep 6h
done
Loading…
Cancel
Save