Skip to content

Upgrade guide from Helia 2.0.0 to Helia 3.0.0

Alex Potsides edited this page Jan 7, 2024 · 1 revision

New features and bug fixes

Please see the release notes for the full run-down of all the new features and bug fixes in helia@3.x.x.

Migration guide

libp2p@1.x.x

Helia@3.0.0 ships with libp2p@1.x.x which has breaking changes around service configuration and general API cleanup.

Please see the libp2p 1.x.x migration guide for any changes you may need to make to your application, if any.

If you simply use the built-in libp2p instance that comes with Helia there's nothing to do!

Pinning

The return type of the helia.pins.add and helia.pins.rm methods has changed to AsyncGenerator<CID>. This gives users greater control over pinning performance, allowing users to start multiple pin operations simultaneously on the same DAG which should improve performance.

Before

const cid = CID.parse('QmFoo')

await helia.pin.add(cid)

After

const cid = CID.parse('QmFoo')

for await (const pinnedCid of helia.pin.add(cid)) {
  // ...
}