Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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({
const routing = new DelegatedContentRouting(peerId, ipfsHttpClient.create({
// use default api settings
protocol: 'https',
port: 443,
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"private": false,
"scripts": {
"lint": "aegir lint",
"prepare": "npm run build",
"build": "aegir build",
"test": "aegir test",
"test:node": "aegir test --target node",
Expand All @@ -20,18 +21,18 @@
"devDependencies": {
"aegir": "^33.0.0",
"go-ipfs": "^0.8.0",
"ipfs-http-client": "^49.0.4",
"ipfs-utils": "^6.0.6",
"ipfsd-ctl": "^7.2.0",
"ipfs-http-client": "^50.1.0",
"ipfs-utils": "^8.1.2",
"ipfsd-ctl": "^8.0.2",
"it-all": "^1.0.0",
"it-drain": "^1.0.0",
"peer-id": "^0.14.0",
"peer-id": "^0.15.0",
"uint8arrays": "^2.1.4"
},
"dependencies": {
"debug": "^4.1.1",
"it-drain": "^1.0.3",
"multiaddr": "^9.0.1",
"multiaddr": "^10.0.0",
"p-defer": "^3.0.0",
"p-queue": "^6.2.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DelegatedContentRouting {
timeout: options.timeout
})) {
yield {
id: PeerId.createFromCID(id),
id: PeerId.parse(id),
multiaddrs: addrs
}
providers++
Expand Down
12 changes: 6 additions & 6 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('DelegatedContentRouting', function () {
// Spawn our local node and bootstrap the bootstrapper node
const self = await spawnNode(bootstrapId.addresses)
selfNode = self.node
selfId = PeerId.createFromB58String(self.id.id)
selfId = PeerId.parse(self.id.id)

// Spawn the delegate node and bootstrap the bootstrapper node
const delegate = await spawnNode(bootstrapId.addresses)
Expand All @@ -82,7 +82,7 @@ describe('DelegatedContentRouting', function () {
})

it('should accept an http api client instance at construction time', () => {
const client = ipfsHttpClient({
const client = ipfsHttpClient.create({
protocol: 'http',
port: 8000,
host: 'localhost'
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('DelegatedContentRouting', function () {

it('should be able to find providers through the delegate node', async function () {
const opts = delegateNode.apiAddr.toOptions()
const routing = new DelegatedContentRouting(selfId, ipfsHttpClient({
const routing = new DelegatedContentRouting(selfId, ipfsHttpClient.create({
protocol: 'http',
port: opts.port,
host: opts.host
Expand All @@ -134,7 +134,7 @@ describe('DelegatedContentRouting', function () {

it('should be able to specify a timeout', async () => {
const opts = delegateNode.apiAddr.toOptions()
const routing = new DelegatedContentRouting(selfId, ipfsHttpClient({
const routing = new DelegatedContentRouting(selfId, ipfsHttpClient.create({
protocol: 'http',
port: opts.port,
host: opts.host
Expand All @@ -149,7 +149,7 @@ describe('DelegatedContentRouting', function () {
describe('provide', () => {
it('should be able to register as a content provider to the delegate node', async () => {
const opts = delegateNode.apiAddr.toOptions()
const contentRouter = new DelegatedContentRouting(selfId, ipfsHttpClient({
const contentRouter = new DelegatedContentRouting(selfId, ipfsHttpClient.create({
protocol: 'http',
port: opts.port,
host: opts.host
Expand All @@ -167,7 +167,7 @@ describe('DelegatedContentRouting', function () {

it('should provide non-dag-pb nodes via the delegate node', async () => {
const opts = delegateNode.apiAddr.toOptions()
const contentRouter = new DelegatedContentRouting(selfId, ipfsHttpClient({
const contentRouter = new DelegatedContentRouting(selfId, ipfsHttpClient.create({
protocol: 'http',
port: opts.port,
host: opts.host
Expand Down