From a61b0d4771e885092bb47216f5fd525fa27caf4b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 29 Jul 2023 18:35:17 -0400 Subject: [PATCH] feat: add ipni fallback --- src/config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 56547af..2708c4e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,6 +18,7 @@ import { delegatedPeerRouting } from "@libp2p/delegated-peer-routing"; import { create as createIpfsHttpClient } from "ipfs-http-client"; import { DELEGATE_LIST } from "./constants.js"; import { multiaddr } from "@multiformats/multiaddr"; +import { ipniContentRouting } from "@libp2p/ipni-content-routing"; function getDelegateConfig(): any { const delegateString = @@ -49,7 +50,10 @@ export function libp2pConfig(proxy: MultiSocketProxy): Libp2pOptions<{ connectionEncryption: [noise()], streamMuxers: [yamux(), mplex()], peerDiscovery: [bootstrap(bootstrapConfig)], - contentRouters: [delegatedContentRouting(client)], + contentRouters: [ + delegatedContentRouting(client), + ipniContentRouting("https://cid.contact"), + ], peerRouters: [delegatedPeerRouting(client)], services: { identify: identifyService(),