libp2p-delegated-content-routing
Leverage other peers in the libp2p network to perform Content Routing calls.
Last updated 3 years ago by vascosantos .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install libp2p-delegated-content-routing 
SYNC missed versions from official npm registry.

js-libp2p-delegated-content-routing

Discourse posts Dependency Status

Leverage other peers in the network to perform Content Routing calls.

Requires access to /api/v0/dht/findprovs and /api/v0/refs HTTP API endpoints of the delegate node.

Lead Maintainer

Jacob Heun

Requirements

libp2p-delegated-content-routing leverages the ipfs-http-client library and requires an instance of it as a constructor argument.

npm install ipfs-http-client libp2p-delegated-content-routing

Example

const DelegatedContentRouting = require('libp2p-delegated-content-routing')
const ipfsHttpClient = require('ipfs-http-client')

// default is to use ipfs.io
const routing = new DelegatedContentRouting(peerId, ipfsHttpClient.create({
  // use default api settings
  protocol: 'https',
  port: 443,
  host: 'node0.delegate.ipfs.io' // In production you should setup your own delegates
}))
const cid = new CID('QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv')

for await (const { id, multiaddrs } of routing.findProviders(cid)) {
  console.log('found peer', id, multiaddrs)
}

await routing.provide(cid)
console.log('providing %s', cid.toBaseEncodedString())

License

MIT

Current Tags

  • 0.7.0                                ...           beta (4 years ago)
  • 0.11.2                                ...           latest (3 years ago)

23 Versions

  • 0.11.2                                ...           3 years ago
  • 0.11.1                                ...           3 years ago
  • 0.11.0                                ...           3 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.2                                ...           4 years ago
  • 0.8.0                                ...           4 years ago
  • 0.7.0                                ...           4 years ago
  • 0.6.0                                ...           4 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.5                                ...           5 years ago
  • 0.4.4                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (8)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE