Skip to content

Commit

Permalink
feat: leverage filtering for delegated routing
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Oct 15, 2024
1 parent ad23cf4 commit d22a317
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/helia/src/utils/libp2p-defaults.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOpti
services: {
autoNAT: autoNAT(),
dcutr: dcutr(),
delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev'),
delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev', {
filterAddrs: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
filterProtocols: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss']
}),
dht: kadDHT({
clientMode: true,
validators: {
Expand Down
5 changes: 4 additions & 1 deletion packages/helia/src/utils/libp2p-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export function libp2pDefaults (options: Libp2pDefaultsOptions = {}): Libp2pOpti
services: {
autoNAT: autoNAT(),
dcutr: dcutr(),
delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev'),
delegatedRouting: () => createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev', {
filterAddrs: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'],
filterProtocols: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss']
}),
dht: kadDHT({
validators: {
ipns: ipnsValidator
Expand Down

0 comments on commit d22a317

Please sign in to comment.