2019-08-31 14:30:56 +02:00
|
|
|
lightning-plugin -- Manage plugins with RPC
|
|
|
|
===========================================
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
**plugin** *subcommand* [plugin|directory] [*options*] ...
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
The **plugin** RPC command command can be used to control dynamic plugins,
|
|
|
|
i.e. plugins that declared themself "dynamic" (in getmanifest).
|
|
|
|
|
|
|
|
*subcommand* can be **start**, **stop**, **startdir**, **rescan** or **list** and
|
|
|
|
determines what action is taken
|
|
|
|
|
|
|
|
*plugin* is the *path* or *name* of a plugin executable to start or stop
|
|
|
|
|
|
|
|
*directory* is the *path* of a directory containing plugins
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
*options* are optional *keyword=value* options passed to plugin, can be repeated
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
*subcommand* **start** takes a *path* to an executable as argument and starts it as plugin.
|
|
|
|
*path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*).
|
|
|
|
If the plugin is already running and the executable (checksum) has changed, the plugin is
|
|
|
|
killed and restarted except if its an important (or builtin) plugin.
|
|
|
|
If the plugin doesn't complete the "getmanifest" and "init" handshakes within 60 seconds,
|
|
|
|
the command will timeout and kill the plugin.
|
|
|
|
Additional *options* may be passed to the plugin, but requires all parameters to
|
2023-10-14 10:09:05 +02:00
|
|
|
be passed as keyword=value pairs using the `-k|--keyword` option which
|
|
|
|
is recommended. For example the following command starts the plugin
|
|
|
|
helloworld.py (present in the plugin directory) with the option
|
|
|
|
greeting set to 'A crazy':
|
|
|
|
|
|
|
|
```
|
|
|
|
lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'
|
|
|
|
```
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
*subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin.
|
|
|
|
If the plugin subscribed to "shutdown", it may take up to 30 seconds before this
|
|
|
|
command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
*subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories)
|
|
|
|
as plugins. Checksum and timeout behavior as in **start** applies.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
*subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*)
|
|
|
|
that are not already running. Checksum and timeout behavior as in **start** applies.
|
|
|
|
|
|
|
|
*subcommand* **list** lists all running plugins (incl. non-dynamic)
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
|
|
|
On success, an object is returned, containing:
|
2022-09-05 23:33:09 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
- **command** (string): the subcommand this is responding to (one of "start", "stop", "rescan", "startdir", "list")
|
|
|
|
|
|
|
|
If **command** is "start", "startdir", "rescan" or "list":
|
2022-09-05 23:33:09 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
- **plugins** (array of objects):
|
|
|
|
- **name** (string): full pathname of the plugin
|
2022-06-22 18:37:46 +02:00
|
|
|
- **active** (boolean): status; plugin completed init and is operational, plugins are configured asynchronously.
|
2022-07-04 10:23:06 +02:00
|
|
|
- **dynamic** (boolean): plugin can be stopped or started without restarting lightningd
|
2021-06-16 03:10:17 +02:00
|
|
|
|
|
|
|
If **command** is "stop":
|
2022-09-05 23:33:09 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
- **result** (string): A message saying it successfully stopped
|
2021-09-03 12:07:59 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2019-09-16 11:36:05 +02:00
|
|
|
On error, the reason why the action could not be taken upon the
|
|
|
|
plugin is returned.
|
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
lightning-cli(1), lightning-listconfigs(1), [writing plugins][writing plugins]
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
|
|
|
Antoine Poinsot <<darosior@protonmail.com>> is mainly responsible.
|
|
|
|
|
|
|
|
RESOURCES
|
|
|
|
---------
|
|
|
|
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
2020-08-25 03:33:16 +02:00
|
|
|
|
2022-06-22 18:37:46 +02:00
|
|
|
[writing plugins]: PLUGINS.md
|
2024-01-25 01:28:53 +01:00
|
|
|
[comment]: # ( SHA256STAMP:83b40cc97b040fc0d7d47ebfda887c7c7ab0f305330978cd8426b6eed01737d2)
|