-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lightningd: Added --alt-subdaemon command to allow alternate subdaemons. #3372
lightningd: Added --alt-subdaemon command to allow alternate subdaemons. #3372
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a cool idea. Just some (mostly style) nits, I'll leave the conceptual review to the others.
0ba16c8
to
667a3e9
Compare
seems like there was an intermittent failure in the build for |
Nice pr, @rustyrussell @cdecker another idea: if change the message channels between sub daemons from stdio to socket , then the subdaemon could run on different machines, even run remote-hsmd on a real remote HSM. |
@arowser how would we start the processes remotely? I suggest rather that such setups can be done with a bridge daemon that replaces |
c172e79
to
cdafc76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some trivial changes might be nice, but this is fine as is, too!
Thanks!
cdafc76
to
1b1bbdf
Compare
…lternate subdaemons.
1b1bbdf
to
530e837
Compare
@ksedgwic Thanks for your patience! Almost there: let's not skip the final diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md
index c72121bff..9d6548505 100644
--- a/doc/lightningd-config.5.md
+++ b/doc/lightningd-config.5.md
@@ -109,12 +109,12 @@ by *--conf*.
**subdaemon**=*SUBDAEMON*:*PATH*
Specifies an alternate subdaemon binary.
-Current subdaemons are *channel*, *closing*,
-*connect*, *gossip*, *hsm*, *onchain*, and *opening*.
+Current subdaemons are *channeld*, *closingd,
+*connectd*, *gossipd*, *hsmd*, *onchaind*, and *openingd*.
If the supplied path is relative the subdaemon binary is found in the
working directory. This option may be specified multiple times.
- So, **subdaemon=lightning_hsmd:remote_signer** would use a
+ So, **subdaemon=hsmd:remote_signer** would use a
hypothetical remote signing proxy instead of the standard *lightning_hsmd*
binary.
diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c
index 2f658affc..a43f3f07a 100644
--- a/lightningd/lightningd.c
+++ b/lightningd/lightningd.c
@@ -316,11 +316,9 @@ static void memleak_help_alt_subdaemons(struct htable *memtable,
const char *subdaemon_path(const tal_t *ctx, const struct lightningd *ld, const char *name)
{
- /* Strip the leading "lightning_" and following 'd' before looking
- * in alt_subdaemons
- */
- assert(strlen(name) > 10 + 1); /* len("lightning_") + len("d") */
- const char *short_name = tal_strndup(ctx, name + 10, strlen(name) - 11);
+ /* Strip the leading "lightning_" before looking in alt_subdaemons */
+ assert(strlen(name) > strlen("lightning_"));
+ const char *short_name = tal_strdup(ctx, name + strlen("lightning_"));
/* Is there an alternate path for this subdaemon? */
const char *dpath; And Cheers! |
a8f5cdc
to
95b5bdb
Compare
I think that was a spurious CI failure (timeout), force pushed to try again. |
ACK 95b5bdb |
This PR adds --alt-subdaemon to facilitate substituting a standard subdaemon with an alternate.
Examples: