From 7da22bd7bc47fbf780adbc37f34b3edc3b12218d Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 18 Sep 2024 15:12:20 +0200 Subject: [PATCH] deps: update libp2p deps to v2 (#170) Updates examples to use the new libp2p release --- README.md | 9 ++++----- dialer.js | 2 +- listener.js | 2 +- package.json | 14 +++++++------- relay.js | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8f904cc..3c1b683 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ const node = await createLibp2p({ transports: [ webSockets() ], - connectionEncryption: [ + connectionEncrypters: [ noise() ], streamMuxers: [ @@ -116,7 +116,7 @@ const node = await createLibp2p({ discoverRelays: 2 }) ], - connectionEncryption: [ + connectionEncrypters: [ noise() ], streamMuxers: [ @@ -176,7 +176,6 @@ connecting to the auto relay node via the relay. import { createLibp2p } from 'libp2p' import { webSockets } from '@libp2p/websockets' import { noise } from '@chainsafe/libp2p-noise' -import { mplex } from '@libp2p/mplex' import { yamux } from '@chainsafe/libp2p-yamux', const autoRelayNodeAddr = process.argv[2] @@ -186,8 +185,8 @@ if (!autoRelayNodeAddr) { const node = await createLibp2p({ transports: [webSockets()], - connectionEncryption: [noise()], - streamMuxers: [yamux(), mplex()] + connectionEncrypters: [noise()], + streamMuxers: [yamux()] }) console.log(`Node started with id ${node.peerId.toString()}`) diff --git a/dialer.js b/dialer.js index 1811e1c..f99bcbd 100644 --- a/dialer.js +++ b/dialer.js @@ -19,7 +19,7 @@ async function main () { webSockets(), circuitRelayTransport() ], - connectionEncryption: [ + connectionEncrypters: [ noise() ], streamMuxers: [ diff --git a/listener.js b/listener.js index 2a413ac..ad9fd4d 100644 --- a/listener.js +++ b/listener.js @@ -21,7 +21,7 @@ async function main () { discoverRelays: 2 }) ], - connectionEncryption: [ + connectionEncrypters: [ noise() ], streamMuxers: [ diff --git a/package.json b/package.json index 084181e..c688827 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,13 @@ "test": "test-node-example test/*" }, "dependencies": { - "@chainsafe/libp2p-noise": "^15.0.0", - "@chainsafe/libp2p-yamux": "^6.0.1", - "@libp2p/circuit-relay-v2": "^1.0.4", - "@libp2p/identify": "^2.1.0", - "@libp2p/websockets": "^8.0.4", - "@multiformats/multiaddr": "^12.1.11", - "libp2p": "^1.0.8 " + "@chainsafe/libp2p-noise": "^16.0.0", + "@chainsafe/libp2p-yamux": "^7.0.0", + "@libp2p/circuit-relay-v2": "^2.0.0", + "@libp2p/identify": "^3.0.0", + "@libp2p/websockets": "^9.0.0", + "@multiformats/multiaddr": "^12.3.1", + "libp2p": "^2.0.0" }, "devDependencies": { "test-ipfs-example": "^1.1.0" diff --git a/relay.js b/relay.js index f42fe10..40c3409 100644 --- a/relay.js +++ b/relay.js @@ -17,7 +17,7 @@ async function main () { transports: [ webSockets() ], - connectionEncryption: [ + connectionEncrypters: [ noise() ], streamMuxers: [