Christian Decker
a71208b2a0
plugin: Remove added JSON-RPC methods if a plugin gets killed
Removes the method from the dispatch table, leaving a NULL entry
currently.
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
7de4c40b77
plugin: Add plugin rpcmethods to the JSON-RPC interface
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
3e1138951b
plugin: Add pointer to jsonrpc so we can add new methods
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
a4ded47d34
plugin: Fix memory leak when requests are done
We weren't cleaning the requests we fulfilled, so this does that :-)
6 years ago
arowser
3ba751797b
add needed include file
6 years ago
Christian Decker
da465f0fdd
plugin: Exit if we fail to start a plugin
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
b02861bfe1
plugin: Give each plugin their own log-prefix
There is no good naming just yet, so we just number them 1 to n.
6 years ago
Christian Decker
74c58e9f25
docs: Add an initial draft of the plugin documentation
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
805a76a97f
plugin: Make the plugins a list
Suggested-by: Rusty Russell <@rustyrussell>
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
775e4b784d
plugin: Get rid of redundant stdin and stdout members
Suggested-by: Rusty Russell <@rustyrussell>
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
e6ef675ea1
plugin: Send the configure request once we collected all options
This is the final step to get the plugins working. After parsing the
early options (including `--plugin`), then starting and asking the
plugins for options, and finally reading in the options we just
registered, we just need to assemble the options and send them over.
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
3abc32cbbc
plugin: Terminate objects with an empty line to signal end
This is just meant as a hint to the plugin that the message is done,
and it can try to parse the buffer.
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
404352fc7e
plugin: Configure plugins once we've collected all cli options
6 years ago
Christian Decker
55d6d6b0e7
plugin: Register plugin cli options
We also make `--help` a non-early arg so it allows for the plugins to
register their options before printing the help message. The options
themselves are stored in a separate struct inbetween them being
registered and them being forwarded to the plugin. Currently only
supports string options.
Signed-off-by: Christian Decker <@cdecker>
6 years ago
Christian Decker
10338983a6
plugin: Add logs to plugin and add method to kill a plugin
Also includes some sanity checks for the results returned by the
plugin, such as ensuring that the ID is as expected and that we have
either an error or a real result.
6 years ago
Christian Decker
084224f134
plugin: Add request muxing to the plugin subsystem
6 years ago
Christian Decker
d0de6e59c6
plugin: Start each plugin and setup the connection to it
Mostly copied from bitcoind.c
6 years ago
Christian Decker
c71f4f3bd9
plugin: Add listconfigs stub for the --plugin option
6 years ago
Christian Decker
b6a1735929
plugin: Basic scaffolding for the plugin subsystem
6 years ago