Skip to content

Commit

Permalink
actions fully works
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMechanic committed Oct 12, 2024
1 parent 2faaf3c commit 6d7c298
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fast
RUN apk --no-cache add \
bash \
curl \
jq \
libevent \
libzmq \
sqlite-dev \
Expand All @@ -82,6 +83,7 @@ COPY --from=bitcoin-core /opt /opt
COPY ./manager/target/${ARCH}-unknown-linux-musl/release/bitcoind-manager \
./docker_entrypoint.sh \
./actions/reindex.sh \
./actions/prioritise-transaction.sh \
./check-rpc.sh \
./check-synced.sh \
/usr/local/bin/
Expand Down
19 changes: 15 additions & 4 deletions actions/prioritise-transaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ set -e

cat > input.json
TXID=$(jq -r '.["txid"]' input.json)
PRIORITY_DELTA=$(jq -r '.["priority-delta"]' input.json)
if [ $PRIORITY_DELTA = "null" ]; then
PRIORITY_DELTA="0"
fi
FEE_DELTA=$(jq -r '.["fee-delta"]' input.json)
if [ $FEE_DELTA = "null" ]; then
FEE_DELTA="0"
fi
rm input.json

bitcoin-cli prioritisetransaction $TXID $FEE_DELTA

echo "Transaction prioritised with fee $FEE_DELTA"
result=" {
\"version\": \"0\",
\"message\": \"Transaction prioritised with priority delta $PRIORITY_DELTA and fee delta $FEE_DELTA\",
\"value\": null,
\"copyable\": false,
\"qr\": false
}"
>&2 bitcoin-cli prioritisetransaction $TXID $PRIORITY_DELTA $FEE_DELTA && echo $result
19 changes: 10 additions & 9 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ actions:
description: "Ensure a transaction gets prioritised in generated templates."
allowed-statuses:
- running
- stopped
implementation:
type: docker
image: main
Expand All @@ -176,22 +175,24 @@ actions:
io-format: json
mounts:
main: /root/.bitcoin
inject: true
input-spec:
txid:
type: string
name: TXID
description: "The transaction ID of the transaction you wish to prioritise."
masked: false
placeholder: ""
nullable: false
priority-delta:
type: number
name: Priority Delta
description: "The priority to add or subtract."
nullable: true
fee-delta:
type: string
name: Fee-Delta
description: "The effective fee rate you wish your Bitcoin node to treat this transaction as having."
masked: true
placeholder: ""
nullable: false
default: ""
type: number
name: Fee Delta
description: "The fee value (in satoshis) to add (or subtract, if negative)."
nullable: true
migrations:
from:
"*":
Expand Down

0 comments on commit 6d7c298

Please sign in to comment.