mirror of
https://github.com/Retropex/knots-startos.git
synced 2025-05-12 11:20:46 +02:00
Merge pull request #33 from Retropex/sign
Some checks failed
Build Service / BuildPackage (push) Has been cancelled
Some checks failed
Build Service / BuildPackage (push) Has been cancelled
add sign message action
This commit is contained in:
commit
826b8117da
@ -87,6 +87,7 @@ COPY ./manager/target/${ARCH}-unknown-linux-musl/release/bitcoind-manager \
|
||||
./actions/reindex.sh \
|
||||
./actions/sendcoin.sh \
|
||||
./actions/sendall.sh \
|
||||
./actions/signmessage.sh \
|
||||
./actions/reindex_chainstate.sh \
|
||||
./actions/prioritise-transaction.sh \
|
||||
./check-rpc.sh \
|
||||
|
28
actions/signmessage.sh
Normal file
28
actions/signmessage.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if ! bitcoin-cli listwalletdir | jq -e '.wallets[] | select(.name == "coin")' &> /dev/null; then
|
||||
bitcoin-cli createwallet "coin" &> /dev/null
|
||||
fi
|
||||
|
||||
if ! bitcoin-cli getwalletinfo &> /dev/null; then
|
||||
bitcoin-cli loadwallet coin &> /dev/null
|
||||
fi
|
||||
|
||||
cat > input.json
|
||||
ADDRESS=$(jq -r '.["address"]' input.json)
|
||||
MESSAGE=$(jq -r '.["message"]' input.json)
|
||||
rm input.json
|
||||
|
||||
SIG=$(bitcoin-cli signmessage "$ADDRESS" "$MESSAGE")
|
||||
|
||||
result=" {
|
||||
\"version\": \"0\",
|
||||
\"message\": \"Signature: $SIG\",
|
||||
\"value\": null,
|
||||
\"copyable\": true,
|
||||
\"qr\": false
|
||||
}"
|
||||
|
||||
echo $result
|
@ -323,6 +323,35 @@ actions:
|
||||
range: "[0,1000000]"
|
||||
default: 0
|
||||
nullable: false
|
||||
signmessage:
|
||||
name: "Sign message"
|
||||
description: "Sign a message with a bitcoin address."
|
||||
allowed-statuses:
|
||||
- running
|
||||
implementation:
|
||||
type: docker
|
||||
image: main
|
||||
system: false
|
||||
entrypoint: signmessage.sh
|
||||
args: []
|
||||
io-format: json
|
||||
mounts:
|
||||
main: /root/.bitcoin
|
||||
inject: true
|
||||
input-spec:
|
||||
address:
|
||||
type: string
|
||||
name: Address
|
||||
description: "The bitcoin address to use to sign the message."
|
||||
placeholder: ""
|
||||
nullable: false
|
||||
message:
|
||||
type: string
|
||||
name: Message
|
||||
description: "The message to sign."
|
||||
placeholder: ""
|
||||
nullable: false
|
||||
|
||||
migrations:
|
||||
from:
|
||||
"*":
|
||||
|
Loading…
Reference in New Issue
Block a user