-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
🪀 enhancementNew feature or requestNew feature or requestplugin APIrelated to cln plugin APIrelated to cln plugin API
Description
Take the value from the configuration plugin usually inside the init method is painful
+ .on_init(&|plugin| -> Value {
+ plugin.log(LogLevel::Debug, "Custom init method called");
+ // FIXME: improve the get option plugin API
+ let conf = if let Some(conf_plugin) = &plugin.conf {
+ conf_plugin
+ } else {
+ panic!("this should never happen")
+ };
+ let server_port = conf.options[0].to_owned();
+ let server_port: i32 = from_value(server_port).unwrap();
+ if server_port >= 0 {
+ plugin.log(LogLevel::Info, "running rest server on port {port}");
+ let path = conf.configuration.lightning_dir.as_str();
+ run_rocket(path);
+ }
+ json_utils::init_payload()
+ })
Metadata
Metadata
Assignees
Labels
🪀 enhancementNew feature or requestNew feature or requestplugin APIrelated to cln plugin APIrelated to cln plugin API