Skip to content

Commit 1b4e3ff

Browse files
jackstar12rustyrussell
authored andcommitted
plugins/grpc: default value for grpc port
Changelog-Changed: grpc now starts on port 9736 by default
1 parent dd956e2 commit 1b4e3ff

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

plugins/grpc-plugin/src/main.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ struct PluginState {
1717
events: broadcast::Sender<cln_rpc::notifications::Notification>,
1818
}
1919

20-
const OPTION_GRPC_PORT: options::IntegerConfigOption = options::ConfigOption::new_i64_no_default(
20+
const OPTION_GRPC_PORT: options::DefaultIntegerConfigOption = options::ConfigOption::new_i64_with_default(
2121
"grpc-port",
22-
"Which port should the grpc plugin listen for incoming connections?",
22+
9736,
23+
"Which port should the grpc plugin listen for incoming connections?"
2324
);
2425

2526
const OPTION_GRPC_MSG_BUFFER_SIZE : options::DefaultIntegerConfigOption = options::ConfigOption::new_i64_with_default(
@@ -53,15 +54,7 @@ async fn main() -> Result<()> {
5354
None => return Ok(()),
5455
};
5556

56-
let bind_port = match plugin.option(&OPTION_GRPC_PORT).unwrap() {
57-
Some(port) => port,
58-
None => {
59-
log::info!("'grpc-port' options i not configured. exiting.");
60-
plugin.disable("Missing 'grpc-port' option").await?;
61-
return Ok(());
62-
}
63-
};
64-
57+
let bind_port: i64 = plugin.option(&OPTION_GRPC_PORT).unwrap();
6558
let buffer_size: i64 = plugin.option(&OPTION_GRPC_MSG_BUFFER_SIZE).unwrap();
6659
let buffer_size = match usize::try_from(buffer_size) {
6760
Ok(b) => b,

0 commit comments

Comments
 (0)