plugin: Added .params.configuration to init call - #2141
Conversation
renepickhardt
left a comment
There was a problem hiding this comment.
as far as I understand the plugin architecture this patch looks good fore me. Once this is merged I will also update #2139 to utilize this right away
|
tested your code with my updated plugin and it worked like a charm. how should I push my code? just the plugin your PR merged in my PR? |
|
I have merged this PR into #2139 because the proposed plugin depends on these changes and they turned out to work well in practice. While I am happy with this PR I suggest to close this PR here and merge #2139 in order to avoid merging conflicts on master. Otherwise I can also change my PR with the plugin by just adding the python file. |
| /* Add .params.configuration */ | ||
| json_object_start(req->stream, "configuration"); | ||
| json_add_string(req->stream, "lightning-dir", ld->config_dir); | ||
| json_add_string(req->stream, "rpc-filename", ld->rpc_filename); |
There was a problem hiding this comment.
The command-line option is called 'rpc-file', so let's match that.
| json_object_end(req->stream); /* end of .params.options */ | ||
|
|
||
| /* Add .params.configuration */ | ||
| json_object_start(req->stream, "configuration"); |
There was a problem hiding this comment.
"dir", "params", "configuration".... One of these is not like the other :)
|
|
||
| struct plugins *plugins_new(const tal_t *ctx, struct log_book *log_book, | ||
| struct jsonrpc *rpc) | ||
| struct jsonrpc *rpc, struct lightningd *ld) |
There was a problem hiding this comment.
Maybe should remove log_book and rpc here, and replace by ld->log_book and log->rpc in follow.
|
ACK ef11628 |
885773c to
1930920
Compare
This tells the plugin both the `lightning-dir` as well as the `rpc-filename` to use to talk to `lightningd`. Prior to this they'd had to guess. Signed-off-by: Christian Decker <decker.christian@gmail.com>
1930920 to
ef11628
Compare
This tells the plugin both the
lightning-diras well as therpc-filenameto use to talk tolightningd. Prior to this they'dhad to guess.
This was supposed to be in #2131, but I had it stashed and forgot about it 🙁