1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 01:43:22 +01:00

add basic bash eclair client

This commit is contained in:
sstone 2016-06-02 17:15:36 +02:00
parent 2ad3dcde82
commit 719e92f8fb

25
eclair-demo/eclair-cli Executable file
View 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