fix: allow Fedimint install without local Bitcoin node

Fedimint can use a remote Bitcoin RPC (e.g., over Tailscale or Tor).
Dependency check now logs info instead of blocking installation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-11 23:00:06 -04:00
parent 038e00fa1c
commit f2b4e537e9

View File

@ -70,10 +70,10 @@ pub(super) fn check_install_deps(package_id: &str, deps: &RunningDeps) -> Result
missing.join(" and ") missing.join(" and ")
)) ))
} }
"fedimint" if !deps.has_bitcoin => Err(anyhow::anyhow!( "fedimint" if !deps.has_bitcoin => {
"Fedimint requires a running Bitcoin node (Bitcoin Knots). \ info!("Fedimint installing without local Bitcoin node — configure remote Bitcoin RPC in Fedimint guardian setup");
Please install and start Bitcoin Knots first." Ok(())
)), }
_ => Ok(()), _ => Ok(()),
} }
} }
@ -185,6 +185,12 @@ pub(super) fn configure_fedimint_lnd(
&& std::path::Path::new(lnd_macaroon).exists() && std::path::Path::new(lnd_macaroon).exists()
{ {
info!("LND detected with credentials — configuring gateway in lnd mode"); info!("LND detected with credentials — configuring gateway in lnd mode");
// Read bcrypt hash from secrets file, fall back to default
let fedi_hash = std::fs::read_to_string("/var/lib/archipelago/secrets/fedimint-gateway-hash")
.map(|s| s.trim().to_string())
.unwrap_or_else(|_| "$2y$10$t9YjjxkiktrlYvjajB/zgOMDnSNVg4HqrbDqh47u7Jf42whNdxNqC".to_string());
ports.retain(|p| p != "9737:9737"); ports.retain(|p| p != "9737:9737");
volumes.push(format!("{}:/lnd/tls.cert:ro", lnd_cert)); volumes.push(format!("{}:/lnd/tls.cert:ro", lnd_cert));
volumes.push(format!("{}:/lnd/admin.macaroon:ro", lnd_macaroon)); volumes.push(format!("{}:/lnd/admin.macaroon:ro", lnd_macaroon));
@ -195,7 +201,7 @@ pub(super) fn configure_fedimint_lnd(
"--listen".to_string(), "--listen".to_string(),
"0.0.0.0:8176".to_string(), "0.0.0.0:8176".to_string(),
"--bcrypt-password-hash".to_string(), "--bcrypt-password-hash".to_string(),
"$2y$10$t9YjjxkiktrlYvjajB/zgOMDnSNVg4HqrbDqh47u7Jf42whNdxNqC".to_string(), fedi_hash,
"--network".to_string(), "--network".to_string(),
"bitcoin".to_string(), "bitcoin".to_string(),
"--bitcoind-url".to_string(), "--bitcoind-url".to_string(),