Make the prometheus plugin listen on 127.0.0.1 (localhost) by default
instead of open to the world. This closes a privacy breach in the
default configuration.
Poetry will automatically manage virtualenvs for our project, so we
can rely on `poetry install` and `poetry run` in the main environment
to keep the nested env up-to-date and enter it for testing.
In a clean machine a new user will endup with the following exception
```
Traceback (most recent call last):
File "/home/lightning/.lightning/plugins/commando.py", line 22, in <module>
from pyln.client import Plugin, RpcError # type: ignore
ModuleNotFoundError: No module named 'pyln'
```
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Otherwise it blocks everything while it's working, which can be a
while for a slow command.
Fixes: #347
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I don't understand the code at that location, but it can raise
a division by zero in testing environment where no real graph
was accessible because it couldn't be downloaded.
The old skipIf annotation doesn't seem to work correctly:
```
PytestUnknownMarkWarning: Unknown pytest.mark.skipIf - is this a typo?
You can register custom marks to avoid this warning -
for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.skipIf(True, "Test autopilot is hanging on DNS request")
```
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>