Commit Graph

66 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
Vincenzo Palazzo
e70a526a05 increase pyln-client version in summary
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-06 17:02:31 +01:00
Michael Schmoock
4d3560b129 reqirements: switch to pyln-client 0.12 for backup, drain, feeadj, rebalance and summary
This is required as newer versions of cln (>=0.12) use non numeric json
rpc IDs.
2022-11-04 11:43:00 +01:00
Michael Schmoock
3514460ae8 summary: fixes a nasty test flake 2022-11-04 11:43:00 +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
a83ec975ba summary: remove code duplication wait_for from pyln.testing.utils 2021-06-29 10:43:56 +02:00
Michael Schmoock
0062e92011 summary: fix another flake
This will make the test to wait for one node to see that the second node
disconnected after using .stop().

For that it adds wait_for(lambda) testing utils method.
2021-06-25 13:34:58 +02:00
Michael Schmoock
5475f256ed summary: nits 2021-06-24 14:19:55 +02:00
Michael Schmoock
2afe310a6e summary: makes test_summary_persist more precise 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
355f0e7745 summary: fix test flakes 2020-11-23 11:54:36 +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
294dc5dc20 summary: increase test coverage 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
eab10a051b pytest: test summary exclude option
And some drive-by minor cleanups
2019-12-13 20:12:03 +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
Christian Decker
81199ae3e6 summary: Improve on the dummy test 2019-12-09 14:31:14 +01:00
Christian Decker
6d7bdc370b summary: Add dummy test to see that travis is working 2019-12-09 14:31:14 +01:00