Commit Graph

54 Commits

Author SHA1 Message Date
Michael Schmoock
4138896223 summary: request ascii mode 2023-02-23 18:15:33 +01:00
Michael Schmoock
30003279e3 summary: check and dismiss old datastores 2023-02-10 18:33:43 +01:00
Michael Schmoock
e79545e9a2 summary: save datastore usage by compater objects 2023-02-10 18:33:43 +01:00
Michael Schmoock
b52360c0cd summary: replace shelve with datastore using pickle
Usage of python shelve caused a lot of issues in the past.
2023-02-10 18:33:43 +01:00
Michael Schmoock
07f9fcfa78 summary: optimize table alignment 2023-02-10 18:33:43 +01:00
Michael Schmoock
6e2b1274fc summary: lowercase the given parameter
Also renames the 'PERMIL' column to 'PPM' which, at least for me, is
more common when it comes to fees.
2023-02-10 18:33:43 +01:00
Michael Schmoock
24bad1c988 summary: adds sortkey parameter and argument 2023-02-10 18:33:43 +01:00
Michael Schmoock
d1d89047bf summary: sort output by scid per default
The sort order got changed to random(?) I think when cln changed to have
multiple channels per peer supprt.

This restores the old sort by scid order, which is nice since old
channels are upfront.

Maybe we can add other orderings in later commits by copfig options and
`summary` method paramters.
2023-02-10 18:33:43 +01:00
Michael Schmoock
b207d2ca9f summary: fix db init when shelve has binary format updates
Sometimes when shelve gets updated, the binary format can differ
and result in first write errors on a re-opened db.

This tries to check for that and drop DB in this case.
2023-02-10 18:33:43 +01:00
Michael Schmoock
fe07f0d578 summary: fix cli upstream changes on listpeerchannels 2023-02-08 15:32:42 +01:00
Andrew Toth
d1a8db61cb summary: fix attribute errors 2022-09-19 10:45:31 +09:30
Ken Sedgwick
0f42425b65 summary: add fees_collected fiatstr 2022-09-16 12:32:39 +02:00
Ken Sedgwick
8529abd833 summary: use lowercase in bitstamp url 2022-07-30 12:30:19 +02:00
laanwj
6756681e54 summary: lightnind→lightningd in shutdown message 2022-04-28 12:59:54 +02:00
Michael Schmoock
69e02e23b1 cleanups: feeadjuster, drain and summary 2022-02-17 10:26:54 +01:00
Vincenzo Palazzo
22923724a9 summary: close the db when the lightningd will stop.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
Vincenzo Palazzo
a6829450db summary: check for all the extension of the db
Reported by: nathanael on IRC

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
Vincenzo Palazzo
4d7ed5cb5f Make a sanity check during the initialization of the db
This commit try to solve the following exception with an additional sanity check:

```
{
   "code": -32600,
   "message": "Error while processing summary: 'Plugin' object has no attribute 'persist'",
   "traceback": "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 627, in _dispatch_request\n    result = self._exec_func(method.func, request)\n  File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 609, in _exec_func\n    return func(*ba.args, **ba.kwargs)\n  File \"/home/_lightning/plugins/summary.py\", line 124, in summary\n    addpeer(plugin, p)\n  File \"/var/git/plugins/summary/summary_avail.py\", line 7, in addpeer\n    if pid not in p.persist['peerstate']:\nAttributeError: 'Plugin' object has no attribute 'persist'\n"
}
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
LightningHelper
bcebb1ba2a added fee per channel
Knowing the fee per channel is very useful for fee selection.
I assume an option can be added to show the fees only if --details is an argument, but it will make the code a bit less clean.
2021-12-13 14:20:29 +01:00
Michael Schmoock
5475f256ed summary: nits 2021-06-24 14:19:55 +02:00
Michael Schmoock
37022fbc15 summary: logs summary.dat shelve usage 2021-06-24 14:19:55 +02:00
Michael Schmoock
b862247e2b summary: logs PeerThred activity to debug
This will eliminate a potential flakyness of the tests
because we can use that log as a marker to wait for the PeerThread.
2021-06-24 14:19:55 +02:00
Aido
defdc28915 summary: Add fees_collected info to output 2021-02-10 15:36:52 +01:00
Michael Schmoock
e825910af1 summary: adds __init__.py to fix remaining flake8 nits 2020-12-13 15:36:15 +01:00
Michael Schmoock
2034c29214 summary: fix flake8 nits 2020-12-13 15:36:15 +01:00
Michael Schmoock
2a798864f8 summary: fix bitstamp api 404 2020-11-23 11:54:36 +01:00
Michael Schmoock
5d274f67c4 summary: fix always-use-proxy check 2020-11-23 11:54:36 +01:00
Rusty Russell
6cd4726369 summary: use proxy if configuration says to.
All plugins should take care to do this if config
specifies always-use-proxy!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-13 14:24:00 +01:00
Michael Schmoock
158a15110f summary: fix persistent peerstate zero leading window 2020-08-03 11:37:10 +02:00
Michael Schmoock
f4e3383ed6 summary: persist peerstate via shelve 2020-08-02 19:07:40 +02:00
Michael Schmoock
acf670b782 summary: adds Channel named tuple 2020-08-01 17:03:41 +02:00
Michael Schmoock
75700ddc57 summary: remove legacy code 2020-08-01 17:03:41 +02:00
Michael Schmoock
5a6489c3ae summary: moves availability code and adds testcases
extracts the availability calculations to own testable module
2020-08-01 17:03:41 +02:00
Michael Schmoock
01b075117f summary: set thread loglevel to just warn
using level error caused the testframework to fail on non-essential
price or availability thread log messages.

likely caused by the test runner not being able to query the bitstamp
API.
2020-08-01 17:03:41 +02:00
Michael Schmoock
14ad827fb8 summary: adds 72hr availability measurement
this applies a 72hr exponential smoothed sliding window to
the online/offline availability state of a peer.
2020-08-01 17:03:41 +02:00
Michael Schmoock
e484db385a summary: fix broken price API and other bugs
1. bitcoinaverage does not supply public prices since a while now:
>  Unauthenticated requests are not allowed. Take out a new plan or start
>   a free trial at https://pro.bitcoinaverage.com"
This commit fixes this by porting to bitstamp public ticker API.

2. This commit fixes the missing thread loop, so the price is
   actually updated after a while.

3. This commit fixes an unchecked attribute access that crashed during
   my tests.
2020-08-01 17:03:41 +02:00
Antoine Poinsot
bfab383959 No more pylightning imports !
```
$ grep -rE '^import lightning$|^from lightning'
```

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-04-30 15:07:56 +02:00
darosior
e426f6738e Update to pyln-client
This updates all plugins *which already have requirements.txt* to
pyln-client from pylightning.
2019-12-27 17:17:58 +01:00
darosior
db4357a766 summary: add an 'exclude' parameter to the summary command
This is useful to get an idea of the balance proportions of your
channels when you have a big channel that mess them up.
2019-12-13 20:12:03 +01:00
Rusty Russell
5bb3061ade helpme: new plugin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-26 15:29:59 +02:00
Michael Schmoock
f6309a2da0 Cleanup rebalance sendinvoiceless (#33)
* doc: cleanup and key-value for optional parameters

* rebalance: cleanup and refinements

* sendinvoiceless: cleanup and refinements

* summary: reflects upcoming changes of pylightning to_approx_str

* rebalance: check peer connection on local channels
2019-05-31 22:52:43 +02:00
Michael Schmoock
12a80b2c13 feat: summary adds descriptive table header 2019-05-13 21:23:23 +02:00
Michael Schmoock
8311122645 fix: a race condition in the summary plugin
When the summary plugin starts, it runs a thread to discover the current
`fiat_per_btc` price. When this was not finished yet, the `if` statement
in line 112 fails, because this in not JavaScript and the property has
to be checked with `hasattr(obj, key)` method in order to not throw an
exception.
2019-05-13 14:02:45 +02:00
Christian Decker
e0f02db123 Update summary/summary.py
Co-Authored-By: Johnstedt <John-John@Markstedts.org>
2019-04-23 15:36:05 +02:00
John-John Markstedt
6b1f7901bc raw response fix 2019-04-23 15:36:05 +02:00
Michael Schmoock
7c392cb2dd feat: add scid to summary output
Improves some minor output issues:

 - Adds short channel id, so it can be copy and pasted for rebalancing
 - renames `channels_key` to `channels_flags`
 - changes flags round rackets (PO) to squace brackets [PO]
 - Always outputs flags even if not set [__] so things are always aligned
 - Removes the colon ':' and always prints a space
   this also helps when copy and pasting in a terminal
2019-04-23 15:33:50 +02:00
Joe Netti
78f0e96c5d fixed graphing bug that was caused by float->int conversion without rounding. Added newline to graph output 2019-04-17 15:23:40 +02:00
Rusty Russell
b286d7b47e summary: fix bug where we're connected to a node without node_announce
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-16 13:51:37 +02:00
Rusty Russell
ff67b26841 summary: fix num_gossipers calculation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-03-05 14:30:24 +10:30
Rusty Russell
ac1478f5a5 summary: add offline annotation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-03-05 14:22:10 +10:30