Skip to content

Commit

Permalink
fix: enable dcutr by default (#239)
Browse files Browse the repository at this point in the history
This should have been in the previous release.
  • Loading branch information
achingbrain authored Aug 16, 2023
1 parent 9f9bc60 commit 7431f09
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/helia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion packages/helia/src/utils/libp2p-defaults.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 3 additions & 1 deletion packages/helia/src/utils/libp2p-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 7431f09

Please sign in to comment.