Skip to content

Commit

Permalink
Merge pull request #1003 from get10101/fund-only-when-necessary
Browse files Browse the repository at this point in the history
Only fund when faucet balance drops below 10 000 000 sats
  • Loading branch information
Restioson authored Jul 28, 2023
2 parents 75b4d72 + 24726f5 commit cced67a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,16 @@ run-local-android args="":
--dart-define="ESPLORA_ENDPOINT=http://${LOCAL_IP}:3000" --dart-define="COORDINATOR_P2P_ENDPOINT=02dd6abec97f9a748bf76ad502b004ce05d1b2d1f43a9e76bd7d85e767ffb022c9@${LOCAL_IP}:9045" \
--dart-define="REGTEST_FAUCET=http://${LOCAL_IP}:8080" --dart-define="COORDINATOR_PORT_HTTP=8000" --flavor local
fund:
cargo run --example fund
fund args="":
#!/usr/bin/env bash
BALANCE=$(curl -s localhost:8080/lnd/v1/balance/channels | sed 's/.*"balance":"\{0,1\}\([^,"]*\)"\{0,1\}.*/\1/')
if [ $BALANCE -lt 10000000 ] || [ "{{args}}" = "--force" ] || [ "{{args}}" = "-f" ]
then
echo "Lightning faucet balance is $BALANCE; funding..."
cargo run --example fund
else
echo "Lightning faucet balance is $BALANCE; skipping funding. Pass -f or --force to force."
fi
# Fund remote regtest instance
fund-regtest:
Expand Down

0 comments on commit cced67a

Please sign in to comment.