Skip to content

Reckless: Add an update command #8266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
12 changes: 11 additions & 1 deletion doc/lightning-reckless.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ lightningd config file. Reckless does all of these by invoking:

**reckless** **install**[@*commit/tag*] *plugin\_name*

Alternatively, the source path or URL to the plugin repository can be
passed directly in place of the *plugin\_name*. In either case, the
containing directory or repository should be named for the plugin, don't
pass the plugin's executable/entrypoint directly.

reckless will exit early in the event that:

- the plugin is not found in any available source repositories
Expand Down Expand Up @@ -53,6 +58,11 @@ Other commands include:
**reckless** **source** **rm** *repo\_url*
remove a plugin repo for reckless to search.

**reckless** **update** *[plugin\_name]*
install the latest commit of a single plugin, or omit to update all
reckless-installed plugins. Does not automatically update if a plugin
was previously installed by requesting a specific git tag or commit.

OPTIONS
-------

Expand Down Expand Up @@ -81,7 +91,7 @@ Available option flags:
NOTES
-----

Reckless currently supports python and javascript plugins.
Reckless currently supports python, rust, and javascript plugins.

Running the first time will prompt the user that their lightningd's
bitcoin config will be appended (or created) to inherit the reckless
Expand Down
15 changes: 11 additions & 4 deletions tests/test_reckless.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,12 @@ def test_poetry_install(node_factory):


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
@unittest.skip("Broken")
def test_local_dir_install(node_factory):
"""Test search and install from local directory source."""
n = get_reckless_node(node_factory)
n.start()
r = reckless([f"--network={NETWORK}", "-v", "source", "add",
os.path.join(n.lightning_dir, '..', 'lightningd', 'testplugpass')],
dir=n.lightning_dir)
source_dir = str(Path(n.lightning_dir / '..' / 'lightningd' / 'testplugpass').resolve())
r = reckless([f"--network={NETWORK}", "-v", "source", "add", source_dir], dir=n.lightning_dir)
assert r.returncode == 0
r = reckless([f"--network={NETWORK}", "-v", "install", "testplugpass"], dir=n.lightning_dir)
assert r.returncode == 0
Expand All @@ -247,6 +245,15 @@ def test_local_dir_install(node_factory):
print(plugin_path)
assert os.path.exists(plugin_path)

# Retry with a direct install passing the full path to the local source
r = reckless(['uninstall', 'testplugpass', '-v'], dir=n.lightning_dir)
assert not os.path.exists(plugin_path)
r = reckless(['source', 'remove', source_dir], dir=n.lightning_dir)
assert 'plugin source removed' in r.stdout
r = reckless(['install', '-v', source_dir], dir=n.lightning_dir)
assert 'testplugpass enabled' in r.stdout
assert os.path.exists(plugin_path)


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
def test_disable_enable(node_factory):
Expand Down
Loading
Loading