mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
grpc-plugin: Make the grpc port to listen on configurable
Changelog-Added: cln-grpc-plugin: The plugin can be configured to listen on a specific port using the `grpc-port` option
This commit is contained in:
committed by
Rusty Russell
parent
647ed6a8c8
commit
dd66c85fcb
@@ -331,6 +331,19 @@ where
|
||||
sender: tokio::sync::mpsc::Sender<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl<S> Plugin<S>
|
||||
where
|
||||
S: Clone + Send,
|
||||
{
|
||||
pub fn option(&self, name: &str) -> Option<options::Value> {
|
||||
self.options
|
||||
.iter()
|
||||
.filter(|o| o.name() == name)
|
||||
.next()
|
||||
.map(|co| co.value.clone().unwrap_or(co.default().clone()))
|
||||
}
|
||||
}
|
||||
|
||||
/// The [PluginDriver] is used to run the IO loop, reading messages
|
||||
/// from the Lightning daemon, dispatching calls and notifications to
|
||||
/// the plugin, and returning responses to the the daemon. We also use
|
||||
|
||||
Reference in New Issue
Block a user