Skip to content

Commit 243dc1a

Browse files
deps: bump multiformats from 12.1.3 to 13.0.0 (#615)
Bumps [multiformats](https://github.com/multiformats/js-multiformats) from 12.1.3 to 13.0.0. - [Release notes](https://github.com/multiformats/js-multiformats/releases) - [Changelog](https://github.com/multiformats/js-multiformats/blob/master/CHANGELOG.md) - [Commits](multiformats/js-multiformats@v12.1.3...v13.0.0) --- updated-dependencies: - dependency-name: multiformats dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent 9d5bc7e commit 243dc1a

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,38 +148,38 @@
148148
"docs": "aegir docs"
149149
},
150150
"dependencies": {
151-
"@libp2p/identify": "^1.0.0",
152151
"@libp2p/interface": "^1.0.0",
153152
"@libp2p/logger": "^4.0.0",
154153
"@libp2p/utils": "^5.0.0",
155154
"@multiformats/multiaddr": "^12.1.0",
156155
"@vascosantos/moving-average": "^1.1.0",
157156
"any-signal": "^4.1.1",
158-
"blockstore-core": "^4.0.0",
159157
"events": "^3.3.0",
160158
"interface-blockstore": "^5.0.0",
161159
"interface-store": "^5.1.0",
160+
"it-drain": "^3.0.5",
162161
"it-foreach": "^2.0.2",
163162
"it-length-prefixed": "^9.0.0",
164163
"it-map": "^3.0.2",
165164
"it-pipe": "^3.0.1",
166165
"it-take": "^3.0.1",
167166
"just-debounce-it": "^3.0.1",
168-
"multiformats": "^12.0.1",
167+
"multiformats": "^13.0.0",
169168
"progress-events": "^1.0.0",
170169
"protons-runtime": "^5.0.0",
171170
"timeout-abort-controller": "^3.0.0",
172171
"uint8arraylist": "^2.4.3",
173-
"uint8arrays": "^4.0.2",
172+
"uint8arrays": "^5.0.1",
174173
"varint": "^6.0.0",
175174
"varint-decoder": "^1.0.0"
176175
},
177176
"devDependencies": {
178177
"@chainsafe/libp2p-noise": "^14.0.0",
179-
"@libp2p/kad-dht": "^11.0.0",
180-
"@libp2p/mplex": "^10.0.0",
178+
"@chainsafe/libp2p-yamux": "^6.0.1",
179+
"@libp2p/identify": "^1.0.0",
180+
"@libp2p/kad-dht": "^12.0.2",
181181
"@libp2p/peer-id": "^4.0.0",
182-
"@libp2p/peer-id-factory": "^3.0.2",
182+
"@libp2p/peer-id-factory": "^4.0.3",
183183
"@libp2p/tcp": "^9.0.0",
184184
"@nodeutils/defaults-deep": "^1.1.0",
185185
"@types/lodash.difference": "^4.5.7",
@@ -188,12 +188,12 @@
188188
"@types/sinon": "^17.0.2",
189189
"@types/stats-lite": "^2.2.0",
190190
"@types/varint": "^6.0.0",
191-
"aegir": "^41.0.0",
191+
"aegir": "^42.0.1",
192192
"benchmark": "^2.1.4",
193+
"blockstore-core": "^4.0.0",
193194
"delay": "^6.0.0",
194195
"iso-random-stream": "^2.0.0",
195196
"it-all": "^3.0.1",
196-
"it-drain": "^3.0.1",
197197
"libp2p": "^1.0.0",
198198
"lodash.difference": "^4.5.0",
199199
"lodash.flatten": "^4.4.0",

src/stats/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { EventEmitter } from 'events'
22
import { trackedMap } from '@libp2p/utils/tracked-map'
33
import { Stat } from './stat.js'
4-
import type { PeerId } from '@libp2p/interface'
4+
import type { Libp2p, PeerId } from '@libp2p/interface'
55
import type { IMovingAverage } from '@vascosantos/moving-average'
6-
import type { Libp2p } from 'libp2p'
76

87
export interface StatsOptions {
98
enabled?: boolean

test/bitswap.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import { createLibp2pNode } from './utils/create-libp2p-node.js'
1212
import { orderedFinish } from './utils/helpers.js'
1313
import { makeBlocks } from './utils/make-blocks.js'
1414
import type { Libp2p } from '@libp2p/interface'
15-
import type { DualKadDHT } from '@libp2p/kad-dht'
15+
import type { KadDHT } from '@libp2p/kad-dht'
1616

1717
/**
1818
* Creates a repo + libp2pNode + Bitswap with or without DHT
1919
*/
20-
async function createThing (dht: boolean): Promise<{ libp2pNode: Libp2p<{ dht: DualKadDHT }>, bitswap: DefaultBitswap }> {
20+
async function createThing (dht: boolean): Promise<{ libp2pNode: Libp2p<{ dht: KadDHT }>, bitswap: DefaultBitswap }> {
2121
const libp2pNode = await createLibp2pNode({
2222
DHT: dht
2323
})
@@ -167,7 +167,7 @@ describe('bitswap without DHT', function () {
167167
describe('bitswap with DHT', function () {
168168
this.timeout(60 * 1000)
169169

170-
let nodes: Array<{ libp2pNode: Libp2p<{ dht: DualKadDHT }>, bitswap: DefaultBitswap }>
170+
let nodes: Array<{ libp2pNode: Libp2p<{ dht: KadDHT }>, bitswap: DefaultBitswap }>
171171

172172
before(async () => {
173173
nodes = await Promise.all([

test/utils/create-libp2p-node.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { noise } from '@chainsafe/libp2p-noise'
2+
import { yamux } from '@chainsafe/libp2p-yamux'
23
import { identify } from '@libp2p/identify'
3-
import { type DualKadDHT, kadDHT } from '@libp2p/kad-dht'
4-
import { mplex } from '@libp2p/mplex'
4+
import { type KadDHT, kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht'
55
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
66
import { tcp } from '@libp2p/tcp'
77
// @ts-expect-error no types
@@ -13,18 +13,20 @@ export interface NodeOptions extends Libp2pOptions {
1313
DHT?: boolean
1414
}
1515

16-
export async function createLibp2pNode (options: NodeOptions = {}): Promise<Libp2p<{ dht: DualKadDHT }>> {
16+
export async function createLibp2pNode (options: NodeOptions = {}): Promise<Libp2p<{ dht: KadDHT }>> {
1717
const services: ServiceMap = {
1818
identify: identify()
1919
}
2020

2121
if (options.DHT === true) {
2222
services.dht = kadDHT({
23+
protocol: '/ipfs/lan/kad/1.0.0',
24+
peerInfoMapper: removePublicAddressesMapper,
2325
clientMode: false
2426
})
2527
}
2628

27-
const node = await createLibp2p<{ dht: DualKadDHT }>(defaultsDeep({
29+
const node = await createLibp2p<{ dht: KadDHT }>(defaultsDeep({
2830
peerId: await createEd25519PeerId(),
2931
addresses: {
3032
listen: ['/ip4/0.0.0.0/tcp/0']
@@ -33,7 +35,7 @@ export async function createLibp2pNode (options: NodeOptions = {}): Promise<Libp
3335
tcp()
3436
],
3537
streamMuxers: [
36-
mplex()
38+
yamux()
3739
],
3840
connectionEncryption: [
3941
noise()

0 commit comments

Comments
 (0)