Skip to content

fix: private IPFS swarm nodes never peer, breaking shared storage#360

Open
EnriqueL8 wants to merge 1 commit into
mainfrom
fix-ipfs-private-network-peering
Open

fix: private IPFS swarm nodes never peer, breaking shared storage#360
EnriqueL8 wants to merge 1 commit into
mainfrom
fix-ipfs-private-network-peering

Conversation

@EnriqueL8

Copy link
Copy Markdown
Contributor

Summary

  • Private-mode IPFS nodes were pinned to ipfs/go-ipfs:v0.10.0, which has a private-network (pnet) connection bug where swarm connections drop immediately after handshake - nodes never actually peer with each other. This surfaces as failed to bootstrap (no peers found) and shared storage downloads timing out fetching content pinned only on another member's node.
  • Bumps the IPFS image to ipfs/kubo:v0.42.0. Modern Kubo needs its AutoConf/public-bootstrap defaults disabled to even start in private-network mode, so a container-init.d script now does that for private-mode stacks.
  • mDNS auto-discovery, which worked locally, proved unreliable on native Linux Docker bridge networks - members' nodes never found each other there. Added an explicit peering step after first-time-setup that queries each member's real PeerID via its own API and calls swarm/peering/add against every other member, so nodes connect (and persistently reconnect) regardless of whether mDNS works in a given environment.
  • Also fixes two related bugs found in internal/docker/docker.go's output-capture helper (used to build the AutoConf-disable init script): the loop exited as soon as either stdout or stderr closed rather than both, and the final chunk of output was dropped when it didn't end in a newline - together these could silently truncate captured command output.

Test plan

  • Verified locally: fresh 2-member private-mode stack peers automatically, cross-node ipfs cat and gateway fetch both succeed
  • go build ./... passes
  • CI Build/E2E

@EnriqueL8
EnriqueL8 requested a review from a team as a code owner July 23, 2026 14:42
@EnriqueL8
EnriqueL8 force-pushed the fix-ipfs-private-network-peering branch from fd5047b to c035f10 Compare July 23, 2026 14:45
The pinned ipfs/go-ipfs:v0.10.0 image has a private-network (pnet)
connection bug where swarm connections drop immediately after
handshake, so org IPFS nodes never peer with each other. This causes
"failed to bootstrap (no peers found)" and shared storage downloads
to time out fetching content pinned only on another member's node.

Bump to ipfs/kubo:v0.42.0, and since modern Kubo refuses to start in
private-network mode with its default AutoConf/public bootstrap
config, add a container-init.d script that disables it for
private-mode stacks.

mDNS auto-discovery, which worked locally, proved unreliable on
native Linux Docker bridge networks - members' nodes never found each
other there. Add an explicit peering step after first-time-setup that
queries each member's real PeerID via its own API and calls
swarm/peering/add against every other member, so nodes connect (and
persistently reconnect) regardless of whether mDNS works in a given
environment.

Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
@EnriqueL8
EnriqueL8 force-pushed the fix-ipfs-private-network-peering branch from c035f10 to 037d09c Compare July 23, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant