docs: Updated developers-guide docs for v10
This commit is contained in:
committed by
Rusty Russell
parent
6bba927fef
commit
367efcf643
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "A day in the life of a plugin"
|
||||
slug: "a-day-in-the-life-of-a-plugin"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:32:53.431Z"
|
||||
updatedAt: "2023-07-12T13:48:23.030Z"
|
||||
title: A day in the life of a plugin
|
||||
slug: a-day-in-the-life-of-a-plugin
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
A plugin may be written in any language, and communicates with `lightningd` through the plugin's `stdin` and `stdout`. JSON-RPCv2 is used as protocol on top of the two streams, with the plugin acting as server and `lightningd` acting as client. The plugin file needs to be executable (e.g. use `chmod a+x plugin_name`).
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "Tutorials"
|
||||
slug: "additional-resources"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:33:51.998Z"
|
||||
updatedAt: "2023-02-08T09:36:57.988Z"
|
||||
title: Tutorials
|
||||
slug: additional-resources
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
## Writing a plugin in Python
|
||||
|
||||
@@ -51,4 +50,4 @@ Finally, `lightningd`'s own internal [tests](https://github.com/ElementsProject/
|
||||
|
||||
## Community built plugins
|
||||
|
||||
Check out this [repository](https://github.com/lightningd/plugins#plugin-builder-resources) that has a collection of actively maintained plugins as well as plugin libraries (in your favourite language) built by the community.
|
||||
Check out this [repository](https://github.com/lightningd/plugins#plugin-builder-resources) that has a collection of actively maintained plugins as well as plugin libraries (in your favourite language) built by the community.
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "Bitcoin backend"
|
||||
slug: "bitcoin-backend"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:58:27.125Z"
|
||||
updatedAt: "2023-07-13T05:18:59.439Z"
|
||||
title: Bitcoin backend
|
||||
slug: bitcoin-backend
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
Core Lightning communicates with the Bitcoin network through a plugin. It uses the `bcli` plugin by default but you can use a custom one, multiple custom ones for different operations, or write your own for your favourite Bitcoin data source!
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "Event notifications"
|
||||
slug: "event-notifications"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:57:15.799Z"
|
||||
updatedAt: "2023-07-14T07:17:17.114Z"
|
||||
title: Event notifications
|
||||
slug: event-notifications
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
Event notifications allow a plugin to subscribe to events in `lightningd`. `lightningd` will then send a push notification if an event matching the subscription occurred. A notification is defined in the JSON-RPC [specification][jsonrpc-spec] as an RPC call that does not include an `id` parameter:
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "Hooks"
|
||||
slug: "hooks"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:57:58.166Z"
|
||||
updatedAt: "2023-02-21T15:08:30.254Z"
|
||||
title: Hooks
|
||||
slug: hooks
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
Hooks allow a plugin to define custom behavior for `lightningd` without having to modify the Core Lightning source code itself. A plugin declares that it'd like to be consulted on what to do next for certain events in the daemon. A hook can then decide how `lightningd` should
|
||||
react to the given event.
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: "JSON-RPC passthrough"
|
||||
slug: "json-rpc-passthrough"
|
||||
hidden: false
|
||||
createdAt: "2023-02-03T08:53:50.840Z"
|
||||
updatedAt: "2023-02-03T08:53:50.840Z"
|
||||
title: JSON-RPC passthrough
|
||||
slug: json-rpc-passthrough
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
Plugins may register their own JSON-RPC methods that are exposed through the JSON-RPC provided by `lightningd`. This provides users with a single interface to interact with, while allowing the addition of custom methods without having to modify the daemon itself.
|
||||
|
||||
@@ -31,4 +30,4 @@ For example, `getmanifest` result will register two methods, called `hello` and
|
||||
The RPC call will be passed through unmodified, with the exception of the JSON-RPC call `id`, which is internally remapped to a unique integer instead, in order to avoid collisions. When passing the result back the `id` field is restored to its original value.
|
||||
|
||||
Note that if your `result` for an RPC call includes `"format-hint":
|
||||
"simple"`, then `lightning-cli` will default to printing your output in "human-readable" flat form.
|
||||
"simple"`, then `lightning-cli` will default to printing your output in "human-readable" flat form.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "Plugin manager"
|
||||
slug: "plugin-manager"
|
||||
excerpt: "Learn how to add your plugin to the `reckless` plugin manager."
|
||||
hidden: false
|
||||
createdAt: "2023-02-08T13:22:17.211Z"
|
||||
updatedAt: "2023-02-21T15:11:45.714Z"
|
||||
title: Plugin manager
|
||||
slug: plugin-manager
|
||||
content:
|
||||
excerpt: Learn how to add your plugin to the `reckless` plugin manager.
|
||||
privacy:
|
||||
view: public
|
||||
---
|
||||
`reckless` is a plugin manager for Core Lightning that you can use to install and uninstall [plugins](doc:plugins) with a single command.
|
||||
|
||||
@@ -21,4 +21,4 @@ To make your plugin compatible with reckless install:
|
||||
>
|
||||
> As reckless needs to know how to handle and install the dependencies of a plugin, current version only supports python plugins. We are working on a broader support, e.g., for javascript, golang and other popular programming languages.
|
||||
>
|
||||
> Stay tuned and tell us what languages you need support for, and what features you're missing.
|
||||
> Stay tuned and tell us what languages you need support for, and what features you're missing.
|
||||
|
||||
Reference in New Issue
Block a user