|
@ -28,10 +28,17 @@ executable (e.g. use `chmod a+x plugin_name`) |
|
|
## A day in the life of a plugin |
|
|
## A day in the life of a plugin |
|
|
|
|
|
|
|
|
During startup of `lightningd` you can use the `--plugin=` option to |
|
|
During startup of `lightningd` you can use the `--plugin=` option to |
|
|
register one or more plugins that should be started. `lightningd` will |
|
|
register one or more plugins that should be started. In case you wish |
|
|
write JSON-RPC requests to the plugin's `stdin` and will read replies |
|
|
to start several plugins you have to use the `--plugin=` argument |
|
|
from its `stdout`. To initialize the plugin two RPC methods are |
|
|
once for each plugin. An example call might look like: |
|
|
required: |
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
lightningd --plugin=/path/to/plugin1 --plugin=path/to/plugin2 |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
`lightningd` will write JSON-RPC requests to the plugin's `stdin` and |
|
|
|
|
|
will read replies from its `stdout`. To initialize the plugin two RPC |
|
|
|
|
|
methods are required: |
|
|
|
|
|
|
|
|
- `getmanifest` asks the plugin for command line options and JSON-RPC |
|
|
- `getmanifest` asks the plugin for command line options and JSON-RPC |
|
|
commands that should be passed through |
|
|
commands that should be passed through |
|
|