Skip to content

Commit 9c4a6e7

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/ipip-513-empty-200s
2 parents 1459f1d + ae6f2c6 commit 9c4a6e7

File tree

9 files changed

+40
-33
lines changed

9 files changed

+40
-33
lines changed

packages/client/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@
139139
"release": "aegir release"
140140
},
141141
"dependencies": {
142-
"@libp2p/interface": "^2.10.1",
143-
"@libp2p/logger": "^5.1.17",
144-
"@libp2p/peer-id": "^5.1.4",
145-
"@multiformats/multiaddr": "^12.4.0",
142+
"@libp2p/interface": "^3.0.2",
143+
"@libp2p/logger": "^6.0.5",
144+
"@libp2p/peer-id": "^6.0.3",
145+
"@multiformats/multiaddr": "^13.0.1",
146146
"any-signal": "^4.1.1",
147147
"browser-readablestream-to-it": "^2.0.9",
148148
"ipns": "^10.0.2",
@@ -151,7 +151,7 @@
151151
"it-ndjson": "^1.1.3",
152152
"multiformats": "^13.3.6",
153153
"p-defer": "^4.0.1",
154-
"p-queue": "^8.1.0",
154+
"p-queue": "^9.0.0",
155155
"uint8arrays": "^5.1.0"
156156
},
157157
"devDependencies": {

packages/interop/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
"devDependencies": {
2727
"@helia/delegated-routing-v1-http-api-client": "^4.0.0",
2828
"@helia/delegated-routing-v1-http-api-server": "^4.0.0",
29-
"@helia/ipns": "^8.2.3",
29+
"@helia/ipns": "^9.0.0",
3030
"@libp2p/crypto": "^5.1.3",
31-
"@libp2p/identify": "^3.0.31",
32-
"@libp2p/interface": "^2.10.1",
33-
"@libp2p/kad-dht": "^15.1.1",
34-
"@libp2p/ping": "^2.0.31",
31+
"@libp2p/identify": "^4.0.5",
32+
"@libp2p/interface": "^3.0.2",
33+
"@libp2p/kad-dht": "^16.0.5",
34+
"@libp2p/keychain": "^6.0.5",
35+
"@libp2p/ping": "^3.0.5",
3536
"aegir": "^47.0.10",
3637
"fastify": "^5.3.3",
37-
"helia": "^5.4.2",
38+
"helia": "^6.0.1",
3839
"ipns": "^10.0.2",
3940
"it-first": "^3.0.8",
4041
"multiformats": "^13.3.6"

packages/interop/test/fixtures/create-helia.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import { identify } from '@libp2p/identify'
22
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht'
3+
import { keychain } from '@libp2p/keychain'
34
import { ping } from '@libp2p/ping'
45
import { createHelia as createNode } from 'helia'
56
import { ipnsSelector } from 'ipns/selector'
67
import { ipnsValidator } from 'ipns/validator'
7-
import type { HeliaInit, HeliaLibp2p } from 'helia'
8+
import type { Libp2p } from '@libp2p/interface'
9+
import type { KadDHT } from '@libp2p/kad-dht'
10+
import type { Keychain } from '@libp2p/keychain'
11+
import type { HeliaInit, Helia } from 'helia'
812

9-
export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp2p> {
10-
const helia = await createNode({
13+
export async function createHelia (init?: Partial<HeliaInit>): Promise<Helia<Libp2p<{ dht: KadDHT, keychain: Keychain }>>> {
14+
const helia = await createNode<Libp2p<{ dht: KadDHT, keychain: Keychain }>>({
1115
libp2p: {
1216
peerDiscovery: [],
1317
services: {
@@ -23,7 +27,8 @@ export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp
2327
}
2428
}),
2529
identify: identify(),
26-
ping: ping()
30+
ping: ping(),
31+
keychain: keychain()
2732
}
2833
}
2934
})

packages/interop/test/index.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ import * as raw from 'multiformats/codecs/raw'
1313
import { sha256 } from 'multiformats/hashes/sha2'
1414
import { createHelia } from './fixtures/create-helia.js'
1515
import type { DelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
16+
import type { Libp2p } from '@libp2p/interface'
17+
import type { KadDHT } from '@libp2p/kad-dht'
18+
import type { Keychain } from '@libp2p/keychain'
1619
import type { FastifyInstance } from 'fastify'
17-
import type { HeliaLibp2p } from 'helia'
20+
import type { Helia } from 'helia'
1821

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

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

9799
// use client to resolve the published record
98-
const record = await client.getIPNS(privateKey.publicKey.toCID())
100+
const record = await client.getIPNS(result.publicKey.toCID())
99101
expect(record.value).to.equal(`/ipfs/${cid.toString()}`)
100102
})
101103

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

110112
// resolve the record using a remote host
111113
const i = ipns(network[8])
112-
// @ts-expect-error helia needs to be updated to the latest libp2p deps
113114
const result = await i.resolve(privateKey.publicKey.toCID())
114115
expect(result.cid.toString()).to.equal(cid.toString())
115116
})

packages/server/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@
156156
},
157157
"dependencies": {
158158
"@fastify/cors": "^11.0.1",
159-
"@helia/interface": "^5.3.2",
160-
"@libp2p/interface": "^2.10.1",
161-
"@libp2p/peer-id": "^5.1.4",
159+
"@helia/interface": "^6.0.0",
160+
"@libp2p/interface": "^3.0.2",
161+
"@libp2p/peer-id": "^6.0.3",
162162
"fastify": "^5.3.3",
163163
"ipns": "^10.0.2",
164164
"multiformats": "^13.3.6",
165165
"raw-body": "^3.0.0"
166166
},
167167
"devDependencies": {
168168
"@libp2p/crypto": "^5.1.3",
169-
"@multiformats/multiaddr": "^12.4.0",
169+
"@multiformats/multiaddr": "^13.0.1",
170170
"@types/sinon": "^17.0.4",
171171
"aegir": "^47.0.10",
172172
"sinon": "^21.0.0",

packages/server/src/routes/routing/v1/ipns/get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export default function getIpnsV1 (fastify: FastifyInstance, helia: Helia): void
4040
// PeerId must be encoded as a Libp2p-key CID.
4141
const { name: cidStr } = request.params
4242
cid = CID.parse(cidStr)
43-
} catch (err: any) {
44-
fastify.log.error('could not parse CID from params', err)
43+
} catch (err) {
44+
fastify.log.error({ err }, 'could not parse CID from params')
4545
return reply.code(422).type('text/html').send('Unprocessable Entity')
4646
}
4747

packages/server/src/routes/routing/v1/ipns/put.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export default function putIpnsV1 (fastify: FastifyInstance, helia: Helia): void
4747
// PeerId must be encoded as a Libp2p-key CID.
4848
const { name: cidStr } = request.params
4949
cid = CID.parse(cidStr)
50-
} catch (err: any) {
51-
fastify.log.error('could not parse CID from params', err)
50+
} catch (err) {
51+
fastify.log.error({ err }, 'could not parse CID from params')
5252
return reply.code(422).type('text/html').send('Unprocessable Entity')
5353
}
5454

packages/server/src/routes/routing/v1/peers/get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export default function getPeersV1 (fastify: FastifyInstance, helia: Helia): voi
4040
const { peerId: cidStr } = request.params
4141
const peerCid = CID.parse(cidStr)
4242
peerId = peerIdFromCID(peerCid)
43-
} catch (err: any) {
44-
fastify.log.error('could not parse CID from params', err)
43+
} catch (err) {
44+
fastify.log.error({ err }, 'could not parse CID from params')
4545
return reply.code(422).type('text/html').send('Unprocessable Entity')
4646
}
4747

packages/server/src/routes/routing/v1/providers/get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export default function getProvidersV1 (fastify: FastifyInstance, helia: Helia):
5151
try {
5252
const { cid: cidStr } = request.params
5353
cid = CID.parse(cidStr)
54-
} catch (err: any) {
55-
fastify.log.error('could not parse CID from params', err)
54+
} catch (err) {
55+
fastify.log.error({ err }, 'could not parse CID from params')
5656
return reply.code(422).type('text/html').send('Unprocessable Entity')
5757
}
5858

0 commit comments

Comments
 (0)