mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-23 14:40:34 +01:00
add basic bash eclair client
This commit is contained in:
parent
2ad3dcde82
commit
719e92f8fb
1 changed files with 25 additions and 0 deletions
25
eclair-demo/eclair-cli
Executable file
25
eclair-demo/eclair-cli
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
[ -z "$1" ] && (
|
||||
echo "usage: "
|
||||
echo "eclair-cli list"
|
||||
echo "eclair-cli sign channel-id"
|
||||
echo "eclair-cli fulfill channel-id htlc-id htlc-premiage"
|
||||
) && exit 1
|
||||
|
||||
case $1 in
|
||||
"list")
|
||||
|
||||
curl -X POST -d '{ "method": "list", "params" : [] }' "http://localhost:8080"
|
||||
;;
|
||||
"sign")
|
||||
:${2?"missing channel id"}
|
||||
curl -X POST -d '{ "method": "sign", "params" : ["'$2'"] }' "http://localhost:8080"
|
||||
;;
|
||||
"fulfill")
|
||||
:${2?"missing channel id"}
|
||||
:${3?"missing htlc id"}
|
||||
:${4?"missing htlc preimage"}
|
||||
curl -X POST -d '{ "method": "fulfillhtlc", "params" : ["'$2'", '$3', "'$4'"] }' "http://localhost:8080"
|
||||
;;
|
||||
esac
|
Loading…
Add table
Reference in a new issue