From 4d480b400a3a7d6990aac4a0cacccd86c0fd9cd3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 6 Apr 2023 17:57:35 +0000 Subject: capture funds snapshots --- watcher.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'watcher.sh') diff --git a/watcher.sh b/watcher.sh index 4f5cbd39..5afe3a5a 100755 --- a/watcher.sh +++ b/watcher.sh @@ -4,8 +4,10 @@ sats=100000000 threshold=$1 while true do - lnc=$(docker exec -it cl lightning-cli listfunds | jr '[.channels[] | .channel_sat] | add') - lnw=$(docker exec -it cl lightning-cli listfunds | jr '[.outputs[] | .value] | add') + f=/home/adam/coinos-server/data/funds/$(date +"%m-%d-%y-%T").json + docker exec -it cl lightning-cli listfunds > $f + lnc=$(cat $f | jr '[.channels[] | .channel_sat] | add') + lnw=$(cat $f | jr '[.outputs[] | .value] | add') ln=$(node -pe "$lnc + $lnw") bc=$(docker exec -it bc bitcoin-cli getbalance | jr) total=$(node -pe "$ln + $bc * $sats") -- cgit v1.2.3