From 01ad1d5aef9221bd2dc291ed5af82380a84cec2d Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Wed, 18 Sep 2024 18:04:43 +0200 Subject: [PATCH] summary: fixes and restores the summary plugin --- README.md | 4 +++- {archived/summary => summary}/README.md | 0 {archived/summary => summary}/__init__.py | 0 {archived/summary => summary}/requirements.txt | 0 {archived/summary => summary}/summary.py | 14 +++++++------- {archived/summary => summary}/summary_avail.py | 0 {archived/summary => summary}/test_summary.py | 3 +-- 7 files changed, 11 insertions(+), 10 deletions(-) rename {archived/summary => summary}/README.md (100%) rename {archived/summary => summary}/__init__.py (100%) rename {archived/summary => summary}/requirements.txt (100%) rename {archived/summary => summary}/summary.py (96%) rename {archived/summary => summary}/summary_avail.py (100%) rename {archived/summary => summary}/test_summary.py (98%) diff --git a/README.md b/README.md index 284544bab..366c70ebc 100644 --- a/README.md +++ b/README.md @@ -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) | diff --git a/archived/summary/README.md b/summary/README.md similarity index 100% rename from archived/summary/README.md rename to summary/README.md diff --git a/archived/summary/__init__.py b/summary/__init__.py similarity index 100% rename from archived/summary/__init__.py rename to summary/__init__.py diff --git a/archived/summary/requirements.txt b/summary/requirements.txt similarity index 100% rename from archived/summary/requirements.txt rename to summary/requirements.txt diff --git a/archived/summary/summary.py b/summary/summary.py similarity index 96% rename from archived/summary/summary.py rename to summary/summary.py index 2e07f93e5..7ce75075e 100755 --- a/archived/summary/summary.py +++ b/summary/summary.py @@ -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): @@ -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: diff --git a/archived/summary/summary_avail.py b/summary/summary_avail.py similarity index 100% rename from archived/summary/summary_avail.py rename to summary/summary_avail.py diff --git a/archived/summary/test_summary.py b/summary/test_summary.py similarity index 98% rename from archived/summary/test_summary.py rename to summary/test_summary.py index 364cfed68..e4f8e39b3 100644 --- a/archived/summary/test_summary.py +++ b/summary/test_summary.py @@ -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 @@ -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)