From 55d8276d7dbcaf13815f743adb727c8a524519d8 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 16 Aug 2023 20:27:14 +0100 Subject: [PATCH] fix: enable dcutr by default This should have been in the previous release. --- packages/helia/package.json | 2 +- packages/helia/src/utils/libp2p-defaults.browser.ts | 4 +++- packages/helia/src/utils/libp2p-defaults.ts | 4 +++- packages/interop/package.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/helia/package.json b/packages/helia/package.json index 67a20296..70b7c867 100644 --- a/packages/helia/package.json +++ b/packages/helia/package.json @@ -77,7 +77,7 @@ "it-drain": "^3.0.1", "it-filter": "^3.0.1", "it-foreach": "^2.0.2", - "libp2p": "^0.46.3", + "libp2p": "^0.46.6", "mortice": "^3.0.1", "multiformats": "^12.0.1", "p-defer": "^4.0.0", diff --git a/packages/helia/src/utils/libp2p-defaults.browser.ts b/packages/helia/src/utils/libp2p-defaults.browser.ts index 366f0ece..2802458e 100644 --- a/packages/helia/src/utils/libp2p-defaults.browser.ts +++ b/packages/helia/src/utils/libp2p-defaults.browser.ts @@ -12,12 +12,13 @@ import { ipnsSelector } from 'ipns/selector' import { ipnsValidator } from 'ipns/validator' import { autoNATService } from 'libp2p/autonat' import { circuitRelayTransport } from 'libp2p/circuit-relay' +import { dcutrService } from 'libp2p/dcutr' import { identifyService } from 'libp2p/identify' import { bootstrapConfig } from './bootstrappers.js' import type { PubSub } from '@libp2p/interface/pubsub' import type { Libp2pOptions } from 'libp2p' -export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, identify: unknown, autoNAT: unknown }> { +export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, identify: unknown, autoNAT: unknown, dcutr: unknown }> { return { addresses: { listen: [ @@ -50,6 +51,7 @@ export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubS identify: identifyService(), autoNAT: autoNATService(), pubsub: gossipsub(), + dcutr: dcutrService(), dht: kadDHT({ clientMode: true, validators: { diff --git a/packages/helia/src/utils/libp2p-defaults.ts b/packages/helia/src/utils/libp2p-defaults.ts index 346e42fa..f70147c1 100644 --- a/packages/helia/src/utils/libp2p-defaults.ts +++ b/packages/helia/src/utils/libp2p-defaults.ts @@ -12,13 +12,14 @@ import { ipnsSelector } from 'ipns/selector' import { ipnsValidator } from 'ipns/validator' import { autoNATService } from 'libp2p/autonat' import { circuitRelayTransport, circuitRelayServer, type CircuitRelayService } from 'libp2p/circuit-relay' +import { dcutrService } from 'libp2p/dcutr' 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 { Libp2pOptions } from 'libp2p' -export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, relay: CircuitRelayService, identify: unknown, autoNAT: unknown, upnp: unknown }> { +export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubSub, relay: CircuitRelayService, identify: unknown, autoNAT: unknown, upnp: unknown, dcutr: unknown }> { return { addresses: { listen: [ @@ -51,6 +52,7 @@ export function libp2pDefaults (): Libp2pOptions<{ dht: DualKadDHT, pubsub: PubS autoNAT: autoNATService(), upnp: uPnPNATService(), pubsub: gossipsub(), + dcutr: dcutrService(), dht: kadDHT({ validators: { ipns: ipnsValidator diff --git a/packages/interop/package.json b/packages/interop/package.json index 1cac64d5..b816daf2 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -63,7 +63,7 @@ "it-all": "^3.0.2", "it-to-buffer": "^4.0.1", "kubo-rpc-client": "^3.0.1", - "libp2p": "^0.46.3", + "libp2p": "^0.46.6", "multiformats": "^12.0.1" }, "browser": {