Skip to content

Instantly share code, notes, and snippets.

@darosior
Last active September 28, 2020 12:30
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 darosior/f85aed5bcc9c0a40f9fc3fe204b3f6c9 to your computer and use it in GitHub Desktop.
Save darosior/f85aed5bcc9c0a40f9fc3fe204b3f6c9 to your computer and use it in GitHub Desktop.
C-lightning admin utilities

Which one of your channels are you always failing to route through ?

for scid in $(lc listpeers |jq -r '.peers | map(.channels[].short_channel_id)[]');do echo "$scid failed $(lc listforwards |jq -r '.forwards | map(select(.status | contains("failed")).out_channel)' |grep $scid |wc -l) times";done

Which ones are often succeeding ?

for scid in $(lc listpeers |jq -r '.peers | map(.channels[].short_channel_id)[]');do echo "$scid succeeded $(lc listforwards |jq -r '.forwards | map(select(.status | contains("settled")).out_channel)' |grep $scid |wc -l) times";done

All-in-one version

for scid in $(lc listpeers |jq -r '.peers | map(.channels[].short_channel_id)[]');do echo "$scid : (success / failure) ($(lc listforwards |jq -r '.forwards | map(select(.status | contains("settled")).out_channel)' |grep $scid |wc -l) / $(lc listforwards |jq -r '.forwards | map(select(.status | contains("failed")).out_channel)' |grep $scid |wc -l))";done
@darosior
Copy link
Author

This should be ported to the summary plugin, like a routing-summary command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment