Leverage other peers in the network to perform Content Routing calls.
const DelegatedContentRouting = require('libp2p-delegated-content-routing')
// default is to use ipfs.io
const routing = new DelegatedContentRouing(peerId, {
// use default api settings
protocol: 'https',
port: 443,
host: 'ipfs.io'
})
const cid = new CID('QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv')
for await (const peerInfo of routing.findProviders(cid)) {
console.log('found peer', peerInfo)
}
await routing.provide(cid)
console.log('providing %s', cid.toBaseEncodedString())
MIT