feat: add bitcoind-addr and dogecoind-addr to managed launcher config#347
feat: add bitcoind-addr and dogecoind-addr to managed launcher config#347
bitcoind-addr and dogecoind-addr to managed launcher config#347Conversation
raymondk
left a comment
There was a problem hiding this comment.
It's valid to make bitcoin/dogecoin configurable for managed networks.
We should not change how docker based networks are configured.
bitcoind-addr and dogecoind-addr to managed launcher config
|
docker based networks now stay as they are. the only thing I kept was the address translation helper which seems to be required for the Windows auto-docker fallback path. I also updated the docs accordingly and created a PR in the network launcher repo that updates the readme: dfinity/icp-cli-network-launcher#23 |
Merged latest changes from main including: - feat: cache canisters and recipes locally (#349) - fix: use typed Candid decoding for canister call responses (#350) - feat: Autocontainerize setting (#324) - feat: install proxy canister on managed network initialization (#348) Resolved conflict in crates/icp/src/network/managed/run.rs by keeping both the install_proxy function from main and the transform_native_launcher tests from the current branch. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| pub(super) fn docker_extra_hosts_for_addrs(addrs: &[String]) -> Vec<String> { | ||
| let needs_host_gateway = addrs.iter().any(|addr| { | ||
| addr.rsplit_once(':') | ||
| .map(|(host, _)| matches!(host, "127.0.0.1" | "localhost" | "::1")) |
There was a problem hiding this comment.
Also needs 0.0.0.0
| pub(super) fn translate_addr_for_docker(addr: &str) -> String { | ||
| if let Some((host, port)) = addr.rsplit_once(':') { | ||
| let translated = match host { | ||
| "127.0.0.1" | "localhost" | "::1" => "host.docker.internal", |
There was a problem hiding this comment.
Also needs 0.0.0.0
|
|
||
| **Comparison with native launcher mode:** When using native managed networks (without `image`), settings like `bitcoind-addr`, `ii`, `nns`, and `subnets` are configured as top-level YAML fields. In Docker image mode, these are passed via `args` instead, since the image could be any Docker image — not necessarily the official network launcher. | ||
|
|
||
| > **Docker networking note:** When referencing services running on the host machine from inside a container (e.g., a local Bitcoin node), use `host.docker.internal` instead of `127.0.0.1` or `localhost`. Inside a container, `127.0.0.1` refers to the container's own loopback, not the host. For example: `--bitcoind-addr=host.docker.internal:18444`. Docker Desktop (macOS/Windows) resolves `host.docker.internal` automatically. On Linux Docker Engine, you may need to pass `--add-host=host.docker.internal:host-gateway` or equivalent to ensure it resolves. |
There was a problem hiding this comment.
This implies that you can pass Docker CLI flags, which you can't. extra-hosts should instead be surfaced in the docker network options YAML.
Summary
bitcoind-addranddogecoind-addrfields to the managed network Launcher variant, allowing native launcher mode to connect to Bitcoin/Dogecoin P2P nodes directly fromicp.yamlconfigurationtransform_native_launcher_to_container) to automatically translate localhost addresses (127.0.0.1,localhost,::1) tohost.docker.internalwhen converting launcher config to Docker options — and addshost.docker.internal:host-gatewayto the container'sextra_hostsso the hostname resolves on Linux Docker Engine (relevant for manual WSL2 dockerd setups where Docker Desktop isn't handling DNS)Updates docs, JSON schemas, and adds tests for the new fields and the Windows auto-Docker address translation
Note: