add assume UTXO support

This commit is contained in:
Léo Haf 2025-03-26 13:33:14 +01:00
parent 826b8117da
commit 2f7ceb68ec
Signed by: Retropex
GPG Key ID: F5073C4F4882FFFC
3 changed files with 51 additions and 1 deletions

View File

@ -88,6 +88,7 @@ COPY ./manager/target/${ARCH}-unknown-linux-musl/release/bitcoind-manager \
./actions/sendcoin.sh \
./actions/sendall.sh \
./actions/signmessage.sh \
/actions/assumeutxo.sh \
./actions/reindex_chainstate.sh \
./actions/prioritise-transaction.sh \
./check-rpc.sh \

28
actions/assumeutxo.sh Normal file
View File

@ -0,0 +1,28 @@
#!/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

View File

@ -351,7 +351,28 @@ actions:
description: "The message to sign."
placeholder: ""
nullable: false
assumeutxo:
name: "Assume UTXO"
description: "Use an UTXO snapshot for instant use of your node."
allowed-statuses:
- running
implementation:
type: docker
image: main
system: false
entrypoint: assumeutxo.sh
args: []
io-format: json
mounts:
main: /root/.bitcoin
inject: true
input-spec:
location:
type: string
name: "Snapshot URL"
description: "The URL where we download the snapshot"
placeholder: ""
nullable: false
migrations:
from:
"*":