diff --git a/packages/helia/package.json b/packages/helia/package.json index 041d32e9a..0a52113d4 100644 --- a/packages/helia/package.json +++ b/packages/helia/package.json @@ -77,13 +77,13 @@ "@chainsafe/libp2p-gossipsub": "^10.0.0", "@chainsafe/libp2p-noise": "^13.0.0", "@chainsafe/libp2p-yamux": "^5.0.0", + "@helia/delegated-routing-v1-http-api-client": "^1.1.0", "@helia/interface": "^2.0.0", "@ipld/dag-cbor": "^9.0.0", "@ipld/dag-json": "^10.0.1", "@ipld/dag-pb": "^4.0.3", "@libp2p/bootstrap": "^9.0.2", "@libp2p/interface": "^0.1.1", - "@libp2p/ipni-content-routing": "^2.0.0", "@libp2p/kad-dht": "^10.0.2", "@libp2p/logger": "^3.0.1", "@libp2p/mdns": "^9.0.2", diff --git a/packages/helia/src/utils/libp2p-defaults.browser.ts b/packages/helia/src/utils/libp2p-defaults.browser.ts index a7e16e22c..2e704a1d5 100644 --- a/packages/helia/src/utils/libp2p-defaults.browser.ts +++ b/packages/helia/src/utils/libp2p-defaults.browser.ts @@ -1,8 +1,8 @@ import { gossipsub } from '@chainsafe/libp2p-gossipsub' import { noise } from '@chainsafe/libp2p-noise' import { yamux } from '@chainsafe/libp2p-yamux' +import { createDelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client' import { bootstrap } from '@libp2p/bootstrap' -import { ipniContentRouting } from '@libp2p/ipni-content-routing' import { type DualKadDHT, kadDHT } from '@libp2p/kad-dht' import { mplex } from '@libp2p/mplex' import { webRTC, webRTCDirect } from '@libp2p/webrtc' @@ -21,6 +21,7 @@ import type { Libp2pOptions } from 'libp2p' export interface DefaultLibp2pServices extends Record { dht: DualKadDHT + delegatedRouting: unknown pubsub: PubSub identify: IdentifyService autoNAT: unknown @@ -54,14 +55,12 @@ export function libp2pDefaults (): Libp2pOptions { peerDiscovery: [ bootstrap(bootstrapConfig) ], - contentRouters: [ - ipniContentRouting('https://cid.contact') - ], services: { identify: identifyService(), autoNAT: autoNATService(), pubsub: gossipsub(), dcutr: dcutrService(), + delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev'), dht: kadDHT({ clientMode: true, validators: { diff --git a/packages/helia/src/utils/libp2p-defaults.ts b/packages/helia/src/utils/libp2p-defaults.ts index b55fe4c9a..0f6ce3f82 100644 --- a/packages/helia/src/utils/libp2p-defaults.ts +++ b/packages/helia/src/utils/libp2p-defaults.ts @@ -1,8 +1,8 @@ import { gossipsub } from '@chainsafe/libp2p-gossipsub' import { noise } from '@chainsafe/libp2p-noise' import { yamux } from '@chainsafe/libp2p-yamux' +import { createDelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client' import { bootstrap } from '@libp2p/bootstrap' -import { ipniContentRouting } from '@libp2p/ipni-content-routing' import { type DualKadDHT, kadDHT } from '@libp2p/kad-dht' import { mdns } from '@libp2p/mdns' import { mplex } from '@libp2p/mplex' @@ -23,6 +23,7 @@ import type { Libp2pOptions } from 'libp2p' export interface DefaultLibp2pServices extends Record { dht: DualKadDHT + delegatedRouting: unknown pubsub: PubSub relay: CircuitRelayService identify: IdentifyService @@ -61,15 +62,13 @@ export function libp2pDefaults (): Libp2pOptions { mdns(), bootstrap(bootstrapConfig) ], - contentRouters: [ - ipniContentRouting('https://cid.contact') - ], services: { identify: identifyService(), autoNAT: autoNATService(), upnp: uPnPNATService(), pubsub: gossipsub(), dcutr: dcutrService(), + delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev'), dht: kadDHT({ validators: { ipns: ipnsValidator