Skip to content

Commit 18679fe

Browse files
committed
print launching args
1 parent 2d05b33 commit 18679fe

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/server/mod.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,35 @@ pub struct Arguments {
123123
pub request_timeout_seconds: u64,
124124
}
125125

126+
// We can't automatically derive Debug for Arguments because the server_key and wif_key are sensitive data
127+
impl std::fmt::Debug for Arguments {
128+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
129+
f.debug_struct("Arguments")
130+
.field("network", &self.network)
131+
.field("use_esplora", &self.use_esplora)
132+
.field("esplora_url", &self.esplora_url)
133+
.field("node_url", &self.node_url)
134+
.field("listen", &self.listen)
135+
.field("db_dir", &self.db_dir)
136+
.field(
137+
"server_key",
138+
&self.server_key.as_ref().map(|_| "<redacted>"),
139+
) // Show presence without revealing key
140+
.field("wif_key", &self.wif_key.as_ref().map(|_| "<redacted>")) // Show presence without revealing key
141+
.field("rpc_user_password", &self.rpc_user_password)
142+
.field("max_addresses", &self.max_addresses)
143+
.field("add_cors", &self.add_cors)
144+
.field("derivation_cache_capacity", &self.derivation_cache_capacity)
145+
.field("logs_rocksdb_stat_every", &self.logs_rocksdb_stat_every)
146+
.field("do_compaction", &self.do_compaction)
147+
.field("shared_db_cache_mb", &self.shared_db_cache_mb)
148+
.field("enable_db_statistics", &self.enable_db_statistics)
149+
.field("cache_control_seconds", &self.cache_control_seconds)
150+
.field("request_timeout_seconds", &self.request_timeout_seconds)
151+
.finish()
152+
}
153+
}
154+
126155
impl Arguments {
127156
pub fn is_valid(&self) -> Result<(), Error> {
128157
if !self.use_esplora && self.rpc_user_password.is_none() {
@@ -271,7 +300,7 @@ pub async fn inner_main(
271300
args: Arguments,
272301
shutdown_signal: impl Future<Output = ()>,
273302
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
274-
log::info!("starting waterfalls");
303+
log::info!("starting waterfalls with args: {:?}", args);
275304

276305
let store = get_store(&args)?;
277306

0 commit comments

Comments
 (0)