knots-startos/actions/assumeutxo.sh
2025-04-02 14:24:38 +02:00

29 lines
551 B
Bash

#!/bin/sh
set -e
cat > input.json
URL=$(jq -r '.["location"]' input.json)
rm input.json
mkdir -p /tmp/snap
if [ -e "/tmp/snap/snapshot" ]; then
bitcoin-cli loadtxoutset /tmp/snap/snapshot &
else
wget -q $URL -O /tmp/snap/snapshot
bitcoin-cli loadtxoutset /tmp/snap/snapshot &
fi
result=" {
\"version\": \"0\",
\"message\": \"Consult the logs to see the progression of the snapshot loading. / DO NOT RESTART UNTIL THE SNAPSHOT IS LOADED.\",
\"value\": null,
\"copyable\": false,
\"qr\": false
}"
echo $result