UNPKG

@helia/http

Version:

A lightweight implementation of IPFS over HTTP in JavaScript

29 lines 968 B
import { delegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'; import { keychain } from '@libp2p/keychain'; import { userAgent } from 'libp2p/user-agent'; export function libp2pDefaults(options = {}) { const agentVersion = `@helia/http ${userAgent()}`; return { privateKey: options.privateKey, dns: options.dns, nodeInfo: { userAgent: agentVersion }, addresses: { listen: [] }, transports: [], connectionEncrypters: [], streamMuxers: [], peerDiscovery: [], services: { delegatedRouting: delegatedRoutingV1HttpApiClient({ url: 'https://delegated-ipfs.dev', filterAddrs: ['https'], filterProtocols: ['transport-ipfs-gateway-http'] }), keychain: keychain(options.keychain) } }; } //# sourceMappingURL=libp2p-defaults.js.map