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
10 changes: 5 additions & 5 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
"release": "aegir release"
},
"dependencies": {
"@libp2p/interface": "^2.10.1",
"@libp2p/logger": "^5.1.17",
"@libp2p/peer-id": "^5.1.4",
"@multiformats/multiaddr": "^12.4.0",
"@libp2p/interface": "^3.0.2",
"@libp2p/logger": "^6.0.5",
"@libp2p/peer-id": "^6.0.3",
"@multiformats/multiaddr": "^13.0.1",
"any-signal": "^4.1.1",
"browser-readablestream-to-it": "^2.0.9",
"ipns": "^10.0.2",
Expand All @@ -151,7 +151,7 @@
"it-ndjson": "^1.1.3",
"multiformats": "^13.3.6",
"p-defer": "^4.0.1",
"p-queue": "^8.1.0",
"p-queue": "^9.0.0",
"uint8arrays": "^5.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ describe('delegated-routing-v1-http-api-client', () => {
results.forEach(resultProviders => {
expect(resultProviders.map(prov => ({
id: prov.ID.toString(),
// eslint-disable-next-line max-nested-callbacks

addrs: prov.Addrs?.map(ma => ma.toString())
}))).to.deep.equal(providers.map(prov => ({
id: prov.ID,
Expand Down
1 change: 0 additions & 1 deletion packages/client/test/routings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-nested-callbacks */
/* eslint-env mocha */

import { generateKeyPair } from '@libp2p/crypto/keys'
Expand Down
13 changes: 7 additions & 6 deletions packages/interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
"devDependencies": {
"@helia/delegated-routing-v1-http-api-client": "^4.0.0",
"@helia/delegated-routing-v1-http-api-server": "^4.0.0",
"@helia/ipns": "^8.2.3",
"@helia/ipns": "^9.0.0",
"@libp2p/crypto": "^5.1.3",
"@libp2p/identify": "^3.0.31",
"@libp2p/interface": "^2.10.1",
"@libp2p/kad-dht": "^15.1.1",
"@libp2p/ping": "^2.0.31",
"@libp2p/identify": "^4.0.5",
"@libp2p/interface": "^3.0.2",
"@libp2p/kad-dht": "^16.0.5",
"@libp2p/keychain": "^6.0.5",
"@libp2p/ping": "^3.0.5",
"aegir": "^47.0.10",
"fastify": "^5.3.3",
"helia": "^5.4.2",
"helia": "^6.0.1",
"ipns": "^10.0.2",
"it-first": "^3.0.8",
"multiformats": "^13.3.6"
Expand Down
9 changes: 6 additions & 3 deletions packages/interop/test/fixtures/create-helia.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { identify } from '@libp2p/identify'
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht'
import { keychain } from '@libp2p/keychain'
import { ping } from '@libp2p/ping'
import { createHelia as createNode } from 'helia'
import { ipnsSelector } from 'ipns/selector'
import { ipnsValidator } from 'ipns/validator'
import type { Libp2p } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'
import type { HeliaInit, HeliaLibp2p } from 'helia'
import type { Keychain } from '@libp2p/keychain'
import type { HeliaInit, Helia } from 'helia'

export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp2p<Libp2p<{ dht: KadDHT }>>> {
export async function createHelia (init?: Partial<HeliaInit>): Promise<Helia<Libp2p<{ dht: KadDHT, keychain: Keychain }>>> {
const helia = await createNode({
libp2p: {
peerDiscovery: [],
Expand All @@ -25,7 +27,8 @@ export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp
}
}),
identify: identify(),
ping: ping()
ping: ping(),
keychain: keychain()
}
}
})
Expand Down
11 changes: 5 additions & 6 deletions packages/interop/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import { createHelia } from './fixtures/create-helia.js'
import type { DelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
import type { Libp2p } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'
import type { Keychain } from '@libp2p/keychain'
import type { FastifyInstance } from 'fastify'
import type { HeliaLibp2p } from 'helia'
import type { Helia } from 'helia'

describe('delegated-routing-v1-http-api interop', () => {
let network: Array<HeliaLibp2p<Libp2p<{ dht: KadDHT }>>>
let network: Array<Helia<Libp2p<{ dht: KadDHT, keychain: Keychain }>>>
let server: FastifyInstance
let client: DelegatedRoutingV1HttpApiClient

Expand Down Expand Up @@ -93,11 +94,10 @@ describe('delegated-routing-v1-http-api interop', () => {
// publish a record using a remote host
const i = ipns(network[5])
const cid = CID.parse('bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354')
const privateKey = await generateKeyPair('Ed25519')
await i.publish(privateKey, cid)
const result = await i.publish('key-name', cid)

// use client to resolve the published record
const record = await client.getIPNS(privateKey.publicKey.toCID())
const record = await client.getIPNS(result.publicKey.toCID())
expect(record.value).to.equal(`/ipfs/${cid.toString()}`)
})

Expand All @@ -111,7 +111,6 @@ describe('delegated-routing-v1-http-api interop', () => {

// resolve the record using a remote host
const i = ipns(network[8])
// @ts-expect-error helia needs to be updated to the latest libp2p deps
const result = await i.resolve(privateKey.publicKey.toCID())
expect(result.cid.toString()).to.equal(cid.toString())
})
Expand Down
8 changes: 4 additions & 4 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@
},
"dependencies": {
"@fastify/cors": "^11.0.1",
"@helia/interface": "^5.3.2",
"@libp2p/interface": "^2.10.1",
"@libp2p/peer-id": "^5.1.4",
"@helia/interface": "^6.0.0",
"@libp2p/interface": "^3.0.2",
"@libp2p/peer-id": "^6.0.3",
"fastify": "^5.3.3",
"ipns": "^10.0.2",
"multiformats": "^13.3.6",
"raw-body": "^3.0.0"
},
"devDependencies": {
"@libp2p/crypto": "^5.1.3",
"@multiformats/multiaddr": "^12.4.0",
"@multiformats/multiaddr": "^13.0.1",
"@types/sinon": "^17.0.4",
"aegir": "^47.0.10",
"sinon": "^21.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/routing/v1/ipns/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function getIpnsV1 (fastify: FastifyInstance, helia: Helia): void
const { name: cidStr } = request.params
cid = CID.parse(cidStr)
} catch (err) {
fastify.log.error('could not parse CID from params', err)
fastify.log.error({ err }, 'could not parse CID from params')
return reply.code(422).type('text/html').send('Unprocessable Entity')
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/routing/v1/ipns/put.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function putIpnsV1 (fastify: FastifyInstance, helia: Helia): void
const { name: cidStr } = request.params
cid = CID.parse(cidStr)
} catch (err) {
fastify.log.error('could not parse CID from params', err)
fastify.log.error({ err }, 'could not parse CID from params')
return reply.code(422).type('text/html').send('Unprocessable Entity')
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/routing/v1/peers/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function getPeersV1 (fastify: FastifyInstance, helia: Helia): voi
const peerCid = CID.parse(cidStr)
peerId = peerIdFromCID(peerCid)
} catch (err) {
fastify.log.error('could not parse CID from params', err)
fastify.log.error({ err }, 'could not parse CID from params')
return reply.code(422).type('text/html').send('Unprocessable Entity')
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/routing/v1/providers/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function getProvidersV1 (fastify: FastifyInstance, helia: Helia):
const { cid: cidStr } = request.params
cid = CID.parse(cidStr)
} catch (err) {
fastify.log.error('could not parse CID from params', err)
fastify.log.error({ err }, 'could not parse CID from params')
return reply.code(422).type('text/html').send('Unprocessable Entity')
}

Expand Down