aboutsummaryrefslogtreecommitdiffstats
path: root/doc
ModeNameSize
-rw-r--r--PAYMENTS.md3428logstatsplainblame
-rw-r--r--fund-server-bitcoin-cli.md1349logstatsplainblame
d---------img57logstatsplain
757f33587c9ef5834fa47c1ee00210'>^
5f7a63c7 ^

421accbf ^



5f7a63c7 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


              
            





                                                                                                                             
                                       

                                                  



                                               


           
#!/bin/bash

sats=100000000
threshold=$1
while true
do
  ln=$(lncli --lnddir=/root/.lnda --network=mainnet --chain=bitcoin --rpcserver=localhost:10001 channelbalance | jr .balance)
  bc=$(bitcoin-cli getbalance)
  el=$(elements-cli getbalance | jr .bitcoin)
  total=$(node -pe "$ln + $bc * $sats + $el * $sats")
  low=$(node -pe "$total < $threshold")
  echo $(date -Is) ln $ln bc $bc el $el tot $total
  if "$low"; then 
    echo "Threshold hit, setting new threshold"
    threshold=$total
    # yarn pm2 stop 0 > /dev/null
   node /root/mailgun/index.js
  fi
  sleep 10 
done