Skip to content

Instantly share code, notes, and snippets.

@RCasatta
Created February 19, 2020 18:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RCasatta/7dc471405a9d21b7f6cbc0e70c354d21 to your computer and use it in GitHub Desktop.
Save RCasatta/7dc471405a9d21b7f6cbc0e70c354d21 to your computer and use it in GitHub Desktop.
FEES_COLLECTED=$(lightning-cli getinfo | jq '.msatoshi_fees_collected / 1000')
AVERAGE_FORWARDED=$(lightning-cli listforwards | jq '.forwards[] | select (.status == "settled") | .in_msatoshi' | jq -s 'add / length / 1000')
PAYMENTS_FORWARDED=$(lightning-cli listforwards | jq '.forwards[] | select (.status == "settled") | .in_msatoshi' | jq -s 'length')
echo "Payments forwarded: $PAYMENTS_FORWARDED"
echo "Average payment forwarded: $AVERAGE_FORWARDED satoshi"
echo "Fees collected: $FEES_COLLECTED satoshi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment