Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions historian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ verbatim in order to maintain their integrity and ensure signatures
remain valid.

** Install the plugin
There are two ways to install the plugin:
You need [uv](https://docs.astral.sh/uv/getting-started/installation/) to run this
plugin like a binary. After `uv` is installed you can simply run

- Specify the path to ~historian.py~ with the ~--plugin~ or
~--important-plugin~ options.
- Add a symbolic link to ~historian.py~ in one of the directories
specified as ~--plugin-dir~ or in
~$HOME/.lightning/bitcoin/plugins~.
```
lightning-cli plugin start /path/to/historian.py
```

Notice that copying the entire directory into the plugin-dir will
cause errors at startup. This is caused by ~lightningd~ attempting to
start all executables in the plugin-dir, even the ~historian-cli~
which is not a plugin. The errors are not dangerous, just annoying and
may delay startup slightly.
For general plugin installation instructions see the repos main
[README.md](https://github.com/lightningd/plugins/blob/master/README.md#Installation)

If the plugin starts correctly you should be able to call
~lightning-cli historian-stats~ and see that it is starting to store
Expand Down
14 changes: 13 additions & 1 deletion historian/historian.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/usr/bin/env python3
#!/usr/bin/env -S uv run --script

# /// script
# requires-python = ">=3.9.2"
# dependencies = [
# "inotify>=0.2.12",
# "pika>=1.3.2",
# "pyln-client>=24.2",
# "python-dotenv>=1.1.0",
# "sqlalchemy>=2.0.40",
# ]
# ///

from inotify import constants
from inotify.adapters import Inotify
import os
Expand Down
Loading