Skip to content

v2.0.0

Choose a tag to compare

@christroutner christroutner released this 11 Feb 16:16
· 7 commits to master since this release
bce3745

Encapsulate helia and libp2p dependencies inside helia-coord

This is a breaking change that restructures how helia-coord manages its IPFS and libp2p dependencies.

Previously, helia-coord expected consumers to create their own Helia node and inject it, which forced every consuming application (like ipfs-service-provider) to independently manage ~20 sensitive @libp2p/, @chainsafe/, and helia packages with exact version pinning. A single version mismatch in any of these transitive dependencies could cause crashes.

This release moves all of those packages from devDependencies into dependencies, removes the peerDependencies entry for libp2p, and adds three new dependencies (@helia/unixfs, @libp2p/config, @libp2p/keychain) so that helia-coord fully owns and controls the IPFS/libp2p dependency tree, including the overrides that pin @libp2p/utils to a stable version.

New: Production node factory

A new production-grade node factory has been added at lib/create-helia-node.js, exported as helia-coord/create-helia-node. This factory encapsulates the full node configuration currently used by ipfs-service-provider:

  • identify, identifyPush, gossipsub, ping, keychain
  • KAD-DHT (private protocol /psf/kad/1.0.0 in server mode)
  • Circuit relay transport with optional circuit relay server
  • All transports (TCP, WebSockets, WebRTC, WebRTCDirect)
  • Persistent identity via loadOrCreateSelfKey
  • Content routing via libp2pRouting and bitswap
  • UnixFS

The factory accepts an options object for configurable settings (ipfsDir, tcpPort, wsPort, isCircuitRelay, getSeed, bootstrapPeers) while providing sensible defaults.

Usage

import CreateHeliaNode from 'helia-coord/create-helia-node'

const heliaNode = new CreateHeliaNode({
  ipfsDir: './.ipfsdata/ipfs',
  tcpPort: 4001,
  wsPort: 4003,
  isCircuitRelay: false,
  getSeed: async () => 'my-seed-string'
})

const ipfs = await heliaNode.start()

Consumers can now create a fully configured node without importing any helia or libp2p packages directly.

What's unchanged

The existing examples in examples/ are unchanged and continue to serve as minimal, self-contained references for testing and learning.

The core helia-coord library (index.js, lib/) is also unchanged -- it still accepts an IPFS instance via dependency injection, so the factory is optional and the library remains flexible.