-
Notifications
You must be signed in to change notification settings - Fork 906
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
Implement registering and sending custom notifications to lightningd #6135
Implement registering and sending custom notifications to lightningd #6135
Conversation
566c630
to
9675463
Compare
9675463
to
605be59
Compare
Can we have a test? Would be nice to have a rust plugin in tests/plugins/ that we can use to test this? |
@rustyrussell hmm, I'm actually not seeing any examples of testers for the cln-plugin rust code. There are examples, but I'm not seeing a test module for @cdecker Is there a test module I'm missing? Do you need me to create one? Or do you guys think augmenting one or both example plugins would be sufficient? |
Ah yes, actually it does look like the examples are used in pytest, eg 2605e11 I'll get started on this! |
605be59
to
d40a31d
Compare
@rustyrussell test added! Let me know what else you need on this :) |
@rustyrussell I'm noticing just now that I misread your comment asking for a new plugin. I instead implemented this as an additional feature in the example plugin. I can reimplement the test as its own plugin in |
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.
There is still a WIP commit in this PR, and a Changelog line would also be nice!
5077441
to
65e087e
Compare
… lightningd This functionality already exists in the Python framework; this feature enables it for Rust plugins as well. Changelog-Added: cln-plugin: Implement send_custom_notification to allow sending custom notifications to other plugins.
Also fix Makefile for rust plugin examples Also add in a missing assert in the test_plugin_start test
…example files themselves are changed and to rebuild all the examples when the dependencies are changed (`CLN_RPC_SOURCES`).
also eliminate a rust warning
65e087e
to
4ac5354
Compare
Fixed / squashed / edited commit messages! Let me know what else is missing :) |
The ability to send custom notifications from plugins is needed for a new rust plugin, smaug, which, once finished, will watch a descriptor wallet for updates and sends on-chain movements to the
bookkeeper
plugin using custom notifications.This PR updates the
cln-plugin
create with a newsend_custom_notification
method on thePlugin
object, which allows plugins to send custom notifications during normal operation. It also expands thegetmanifest
rpc response with anotifications
array, which is needed in order for the plugin to register which notifications it wants to send withlightningd
.Sorry for all the formatting changes, my editor does this automatically on save and I'm unsure how to easily revert these, but I will remove if requested.
Edit: hmm, all my formatting changes are gone. No idea how that happened. Magic!