-
Notifications
You must be signed in to change notification settings - Fork 24
Add CLI args and env var support #98
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,8 @@ use tokio::net::TcpListener; | |||||
| use tokio::select; | ||||||
| use tokio::signal::unix::SignalKind; | ||||||
|
|
||||||
| use clap::Parser; | ||||||
|
|
||||||
| use crate::io::events::event_publisher::EventPublisher; | ||||||
| use crate::io::events::get_event_name; | ||||||
| #[cfg(feature = "events-rabbitmq")] | ||||||
|
|
@@ -48,7 +50,7 @@ use crate::io::persist::{ | |||||
| PAYMENTS_PERSISTENCE_SECONDARY_NAMESPACE, | ||||||
| }; | ||||||
| use crate::service::NodeService; | ||||||
| use crate::util::config::{load_config, ChainSource}; | ||||||
| use crate::util::config::{load_config, ArgsConfig, ChainSource}; | ||||||
| use crate::util::logger::ServerLogger; | ||||||
| use crate::util::proto_adapter::{forwarded_payment_to_proto, payment_to_proto}; | ||||||
| use crate::util::tls::get_or_generate_tls_config; | ||||||
|
|
@@ -110,11 +112,13 @@ fn main() { | |||||
| std::process::exit(-1); | ||||||
| } | ||||||
|
|
||||||
| let args_config = ArgsConfig::parse(); | ||||||
|
|
||||||
| let mut ldk_node_config = Config::default(); | ||||||
| let config_file = match load_config(&config_path) { | ||||||
| let config_file = match load_config(&args_config) { | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Config path and the args above is never used now. We should be able to remove that logic as we use clap now, but we still should check for the default config file |
||||||
| Ok(config) => config, | ||||||
| Err(e) => { | ||||||
| eprintln!("Invalid configuration file: {}", e); | ||||||
| eprintln!("Invalid configuration: {}", e); | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. small preference |
||||||
| std::process::exit(-1); | ||||||
| }, | ||||||
| }; | ||||||
|
|
||||||
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.
this is calling the cli, not running the server with command line args