feat: add ipni fallback
This commit is contained in:
parent
3befddd410
commit
a61b0d4771
|
@ -18,6 +18,7 @@ import { delegatedPeerRouting } from "@libp2p/delegated-peer-routing";
|
||||||
import { create as createIpfsHttpClient } from "ipfs-http-client";
|
import { create as createIpfsHttpClient } from "ipfs-http-client";
|
||||||
import { DELEGATE_LIST } from "./constants.js";
|
import { DELEGATE_LIST } from "./constants.js";
|
||||||
import { multiaddr } from "@multiformats/multiaddr";
|
import { multiaddr } from "@multiformats/multiaddr";
|
||||||
|
import { ipniContentRouting } from "@libp2p/ipni-content-routing";
|
||||||
|
|
||||||
function getDelegateConfig(): any {
|
function getDelegateConfig(): any {
|
||||||
const delegateString =
|
const delegateString =
|
||||||
|
@ -49,7 +50,10 @@ export function libp2pConfig(proxy: MultiSocketProxy): Libp2pOptions<{
|
||||||
connectionEncryption: [noise()],
|
connectionEncryption: [noise()],
|
||||||
streamMuxers: [yamux(), mplex()],
|
streamMuxers: [yamux(), mplex()],
|
||||||
peerDiscovery: [bootstrap(bootstrapConfig)],
|
peerDiscovery: [bootstrap(bootstrapConfig)],
|
||||||
contentRouters: [delegatedContentRouting(client)],
|
contentRouters: [
|
||||||
|
delegatedContentRouting(client),
|
||||||
|
ipniContentRouting("https://cid.contact"),
|
||||||
|
],
|
||||||
peerRouters: [delegatedPeerRouting(client)],
|
peerRouters: [delegatedPeerRouting(client)],
|
||||||
services: {
|
services: {
|
||||||
identify: identifyService(),
|
identify: identifyService(),
|
||||||
|
|
Loading…
Reference in New Issue