Skip to content

Commit

Permalink
deps!: update libp2p to 0.46.x (#215)
Browse files Browse the repository at this point in the history
Updates all deps to the latest version including libp2p@0.46.x to gracefully close streams.

See the libp2p [release notes](https://github.com/libp2p/js-libp2p/releases/tag/libp2p-v0.46.0) and [migration guide](https://github.com/libp2p/js-libp2p/blob/master/doc/migrations/v0.45-v0.46.md).

BREAKING CHANGE: libp2p has been updated to 0.46.x
  • Loading branch information
achingbrain committed Aug 7, 2023
1 parent 5b1f195 commit 65b68f0
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 43 deletions.
36 changes: 17 additions & 19 deletions packages/helia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,37 @@
"prepublishOnly": "node scripts/update-version.js && npm run build"
},
"dependencies": {
"@chainsafe/libp2p-gossipsub": "^8.0.0",
"@chainsafe/libp2p-noise": "^12.0.0",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-gossipsub": "^10.0.0",
"@chainsafe/libp2p-noise": "^13.0.0",
"@chainsafe/libp2p-yamux": "^5.0.0",
"@helia/interface": "^1.0.0",
"@ipld/dag-pb": "^4.0.3",
"@libp2p/bootstrap": "^8.0.0",
"@libp2p/interface-libp2p": "^3.2.0",
"@libp2p/interface-pubsub": "^4.0.1",
"@libp2p/interfaces": "^3.3.2",
"@libp2p/bootstrap": "^9.0.2",
"@libp2p/interface": "^0.1.1",
"@libp2p/ipni-content-routing": "^1.0.0",
"@libp2p/kad-dht": "^9.3.3",
"@libp2p/logger": "^2.0.7",
"@libp2p/mdns": "^8.0.0",
"@libp2p/mplex": "^8.0.3",
"@libp2p/tcp": "^7.0.1",
"@libp2p/webrtc": "^2.0.4",
"@libp2p/websockets": "^6.0.1",
"@libp2p/webtransport": "^2.0.1",
"@libp2p/kad-dht": "^10.0.2",
"@libp2p/logger": "^3.0.1",
"@libp2p/mdns": "^9.0.2",
"@libp2p/mplex": "^9.0.2",
"@libp2p/tcp": "^8.0.2",
"@libp2p/webrtc": "^3.1.3",
"@libp2p/websockets": "^7.0.2",
"@libp2p/webtransport": "^3.0.3",
"blockstore-core": "^4.0.0",
"cborg": "^1.10.0",
"cborg": "^2.0.3",
"datastore-core": "^9.0.0",
"interface-blockstore": "^5.0.0",
"interface-datastore": "^8.0.0",
"interface-store": "^5.0.1",
"ipfs-bitswap": "^18.0.0",
"ipfs-bitswap": "^19.0.0",
"ipns": "^6.0.0",
"it-all": "^3.0.2",
"it-drain": "^3.0.1",
"it-filter": "^3.0.1",
"it-foreach": "^2.0.2",
"libp2p": "^0.45.2",
"libp2p": "^0.46.3",
"mortice": "^3.0.1",
"multiformats": "^11.0.1",
"multiformats": "^12.0.1",
"p-defer": "^4.0.0",
"p-queue": "^7.3.4",
"progress-events": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/helia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NetworkedStorage } from './utils/networked-storage.js'
import type { HeliaInit } from '.'
import type { GCOptions, Helia } from '@helia/interface'
import type { Pins } from '@helia/interface/pins'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { Libp2p } from '@libp2p/interface'
import type { Blockstore } from 'interface-blockstore'
import type { Datastore } from 'interface-datastore'
import type { CID } from 'multiformats/cid'
Expand Down
4 changes: 2 additions & 2 deletions packages/helia/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { HeliaImpl } from './helia.js'
import { createLibp2p } from './utils/libp2p.js'
import { name, version } from './version.js'
import type { Helia } from '@helia/interface'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { PubSub } from '@libp2p/interface-pubsub'
import type { Libp2p } from '@libp2p/interface'
import type { PubSub } from '@libp2p/interface/pubsub'
import type { DualKadDHT } from '@libp2p/kad-dht'
import type { Blockstore } from 'interface-blockstore'
import type { Datastore } from 'interface-datastore'
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/pins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { cborWalker, dagPbWalker, jsonWalker, rawWalker } from './utils/dag-walk
import type { DAGWalker } from './index.js'
import type { AddOptions, AddPinEvents, IsPinnedOptions, LsOptions, Pin, Pins, RmOptions } from '@helia/interface/pins'
import type { GetBlockProgressEvents } from '@helia/interface/src/blocks.js'
import type { AbortOptions } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interface'
import type { Blockstore } from 'interface-blockstore'

const DEFAULT_DAG_WALKERS = [
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/storage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import createMortice from 'mortice'
import type { Blocks, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions } from '@helia/interface/blocks'
import type { Pins } from '@helia/interface/pins'
import type { AbortOptions } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interface'
import type { Blockstore } from 'interface-blockstore'
import type { AwaitIterable } from 'interface-store'
import type { Mortice } from 'mortice'
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/utils/libp2p-defaults.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { autoNATService } from 'libp2p/autonat'
import { circuitRelayTransport } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'
import { bootstrapConfig } from './bootstrappers.js'
import type { PubSub } from '@libp2p/interface-pubsub'
import type { PubSub } from '@libp2p/interface/pubsub'
import type { Libp2pOptions } from 'libp2p'

export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, identify: unknown, autoNAT: unknown }> {
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/utils/libp2p-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { circuitRelayTransport, circuitRelayServer, type CircuitRelayService } f
import { identifyService } from 'libp2p/identify'
import { uPnPNATService } from 'libp2p/upnp-nat'
import { bootstrapConfig } from './bootstrappers.js'
import type { PubSub } from '@libp2p/interface-pubsub'
import type { PubSub } from '@libp2p/interface/pubsub'
import type { Libp2pOptions } from 'libp2p'

export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, relay: CircuitRelayService, identify: unknown, autoNAT: unknown, upnp: unknown }> {
Expand Down
4 changes: 2 additions & 2 deletions packages/helia/src/utils/libp2p.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createLibp2p as create, type Libp2pOptions } from 'libp2p'
import { libp2pDefaults } from './libp2p-defaults.js'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { PubSub } from '@libp2p/interface-pubsub'
import type { Libp2p } from '@libp2p/interface'
import type { PubSub } from '@libp2p/interface/pubsub'
import type { DualKadDHT } from '@libp2p/kad-dht'
import type { Datastore } from 'interface-datastore'
import type { CircuitRelayService } from 'libp2p/circuit-relay'
Expand Down
2 changes: 1 addition & 1 deletion packages/helia/src/utils/networked-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import filter from 'it-filter'
import forEach from 'it-foreach'
import { CustomProgressEvent, type ProgressOptions } from 'progress-events'
import type { Blocks, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions } from '@helia/interface/blocks'
import type { AbortOptions } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interface'
import type { Blockstore } from 'interface-blockstore'
import type { AwaitIterable } from 'interface-store'
import type { Bitswap } from 'ipfs-bitswap'
Expand Down
7 changes: 3 additions & 4 deletions packages/interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@
"build": "aegir build"
},
"dependencies": {
"@libp2p/interface-libp2p": "^3.2.0",
"@libp2p/interfaces": "^3.3.2",
"@libp2p/interface": "^0.1.1",
"interface-blockstore": "^5.0.0",
"interface-datastore": "^8.0.0",
"interface-store": "^5.0.1",
"ipfs-bitswap": "^18.0.0",
"multiformats": "^11.0.1",
"ipfs-bitswap": "^19.0.0",
"multiformats": "^12.0.1",
"progress-events": "^1.0.0"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/interface/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import type { Blocks } from './blocks.js'
import type { Pins } from './pins.js'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Libp2p, AbortOptions } from '@libp2p/interface'
import type { Datastore } from 'interface-datastore'
import type { CID } from 'multiformats/cid'
import type { ProgressEvent, ProgressOptions } from 'progress-events'
Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/pins.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { GetBlockProgressEvents } from './blocks'
import type { AbortOptions } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interface'
import type { CID } from 'multiformats/cid'
import type { ProgressEvent, ProgressOptions } from 'progress-events'

Expand Down
14 changes: 7 additions & 7 deletions packages/interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@
"test:electron-main": "aegir test -t electron-main"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^12.0.0",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-noise": "^13.0.0",
"@chainsafe/libp2p-yamux": "^5.0.0",
"@helia/interface": "^1.0.0",
"@libp2p/tcp": "^7.0.1",
"@libp2p/websockets": "^6.0.1",
"@libp2p/tcp": "^8.0.2",
"@libp2p/websockets": "^7.0.2",
"@multiformats/sha3": "^2.0.15",
"aegir": "^40.0.8",
"blockstore-core": "^4.0.0",
"datastore-core": "^9.0.0",
"go-ipfs": "^0.20.0",
"go-ipfs": "^0.21.0",
"helia": "^1.0.0",
"ipfsd-ctl": "^13.0.0",
"it-all": "^3.0.2",
"it-to-buffer": "^4.0.1",
"kubo-rpc-client": "^3.0.1",
"libp2p": "^0.45.2",
"multiformats": "^11.0.1"
"libp2p": "^0.46.3",
"multiformats": "^12.0.1"
},
"browser": {
"./dist/test/fixtures/create-helia.js": "./dist/test/fixtures/create-helia.browser.js",
Expand Down

0 comments on commit 65b68f0

Please sign in to comment.