-
Notifications
You must be signed in to change notification settings - Fork 912
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
feat: restructure plugin and options in listconfigs #3206 #3283
feat: restructure plugin and options in listconfigs #3206 #3283
Conversation
We could think about add a "name" feature to a plugin so we dont have to use the long command path-name as key... |
ad4aa7c
to
3237119
Compare
@cdecker how about adding a "name" to the plugin interface. For all the old plugins we guess the name by inspecting the commands paths lasts elements:
If we do this we can make this nicely without update all the plugins first... |
I think this is a great idea, though we should also still display the path somewhere so we have a mapping between the file being executed and the (self-assigned) alias. |
3237119
to
aecd2e9
Compare
We can address the dedicated plugin naming to a separate pull request... |
55c5249
to
2973862
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.
Awesome! Needs a Changelog-Deprecated
note for changing how the JSON prints though :)
a5cbdc2
to
abdc4af
Compare
I wonder if we can improve on the yet untyped/null values, what are those, date/times?:
From a code perspective Update: seems like those values are C NULL values, however for other python plugins
Open Questions:
We could/should address these problems in another PR... |
abdc4af
to
82ef5f5
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.
ACK 82ef5f5
I have some nits (ah and the commit message is wrong (_cmd
)) about the code, but the interface is much cleaner that way !
I think too that this "null"
fields should be fixed as part of another PR.
I wonder if we can improve on the yet untyped/null values, what are those, date/times?:
I think having null
values is OK. Don't forget that's Javascript Object Notation so the typing is ... You know.... :D
How do we handle python plugin parameters more correctly that are None or non-string types?
By setting them to null
Pylightning side ?..
Can the C code reflect the current (runtime) value of a plugins options? It seems to me that the current way only outputs the plugins default values ("fee-per-satoshi": "null" should no be null, as the value is set in plugins init() method.)
Shouldn't be set as a default instead of at init()
? Or even add a method to set it, but I don't think a startup option is meant to be set at runtime.
6ebcde6
to
5c48e1b
Compare
Okay, lets use the basename including extension for now until plugin can set their name properly. |
This will change the command `listconfigs` output in several ways: - Deprecated the duplicated "plugin" JSON output by replacing it with - a "plugins" array with substructures for each plugin with: - path, name and their options Changelog-Changed: JSON-RPC: `listconfigs` now structures plugins and include their options Changelog-Deprecated: JSON-RPC: `listconfigs` duplicated "plugin" paths
5c48e1b
to
02059ee
Compare
ACK 02059ee |
@m-schmoock Regarding
I gave a quick look to lightning/contrib/pyln-client/pyln/client/plugin.py Lines 416 to 419 in 6defc69
|
Addresses #3206 and #3281
This will restructure the
lightning-cli listconfigs
output in a way that plugins are not duplicated and have their options within a substructure like this: