Skip to content

Commit

Permalink
summary: fixes and restores the summary plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock committed Sep 25, 2024
1 parent 08b1bed commit 01ad1d5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Community curated plugins for Core-Lightning.
| [sauron][sauron] | A Bitcoin backend relying on [Esplora][esplora]'s API | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsauron_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsauron_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsauron_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsauron_nightly.json) |
| [sitzprobe][sitzprobe] | A Lightning Network payment rehearsal utility | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsitzprobe_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsitzprobe_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsitzprobe_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsitzprobe_nightly.json) |
| [sling][sling] | Rebalance your channels with smart rules and built-in background tasks | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsling_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsling_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsling_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsling_nightly.json) |
| [summars][summars] | Print configurable summary of node, channels and optionally forwards, invoices, payments | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_nightly.json) |
| [summars][summars] | Print configurable summary of node, channels and optionally forwards, invoices, payments | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummars_nightly.json) |
| [summary][summary] | Print a nice summary of the node status | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummary_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummary_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummary_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fsummary_nightly.json) |

| [torq-plugin][torq-plugin] | Better CLN integration into [Torq](https://github.com/lncapital/torq) | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftorq-plugin_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftorq-plugin_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftorq-plugin_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftorq-plugin_nightly.json) |
| [trustedcoin][trustedcoin] | Replace your Bitcoin Core with data from public block explorers | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftrustedcoin_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftrustedcoin_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftrustedcoin_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Ftrustedcoin_nightly.json) |
| [watchtower-client][watchtower-client] | Watchtower client for The Eye of Satoshi | ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fwatchtower-client_23.11.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fwatchtower-client_24.02.2.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fwatchtower-client_24.05.json) ![](https://img.shields.io/endpoint?url=https%3A%2F%2Flightningd.github.io%2Fplugins%2F.badges%2Fwatchtower-client_nightly.json) |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions archived/summary/summary.py → summary/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
draw_boxch = Charset('╟', '├', '─', '┼', '┤', '╢', '║')
draw_ascii = Charset('#', '[', '-', '+', ']', '#', '|')

summary_description = "Gets summary information about this node.\n"\
"Pass a list of scids to the {exclude} parameter to exclude some channels from the outputs.\n"\
"Sort the result by using the {sortkey} parameter that can be one of 'total', 'ours', 'theirs', 'scid' (default), 'avail', 'base', 'ppm'."


class PeerThread(threading.Thread):
def __init__(self):
Expand Down Expand Up @@ -83,10 +79,14 @@ def append_header(table, max_msat):
% (draw.left, short_str, draw.mid, short_str, draw.right))


@plugin.method("summary", long_desc=summary_description)
# TODO: cln and pyln-client needs to be updated to get additional usage info.
# currently `usage` is generated by pyln-client.Plugin by just reading the args.
@plugin.method("summary")
def summary(plugin, exclude='', sortkey=None, ascii=None):
"""Gets summary information about this node."""

"""Gets summary information about this node.
Pass a list of scids to the {exclude} parameter to exclude some channels from the outputs.
Sort the result by using the {sortkey} parameter that can be one of 'total', 'ours', 'theirs', 'scid' (default), 'avail', 'base', 'ppm'.")
"""
# Sets ascii mode for this and future requests (if requested)
if ascii is not None:
if ascii:
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions archived/summary/test_summary.py → summary/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pyln.client import Plugin
from pyln.testing.fixtures import * # noqa: F401,F403
from pyln.testing.utils import DEVELOPER, wait_for
from pyln.testing.utils import wait_for

from .summary_avail import trace_availability

Expand Down Expand Up @@ -264,7 +264,6 @@ def test_summary_opts(directory):
assert(o in help_out)


@unittest.skipIf(not DEVELOPER, "We need fast gossip for line_graph")
def test_summary_exclude(node_factory):
l1, l2 = node_factory.line_graph(2, opts=pluginopt)

Expand Down

0 comments on commit 01ad1d5

Please sign in to comment.