Skip to content

Commit

Permalink
deps: update libp2p deps to v2 (#170)
Browse files Browse the repository at this point in the history
Updates examples to use the new libp2p release
  • Loading branch information
achingbrain authored Sep 18, 2024
1 parent 04a4124 commit 7da22bd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const node = await createLibp2p({
transports: [
webSockets()
],
connectionEncryption: [
connectionEncrypters: [
noise()
],
streamMuxers: [
Expand Down Expand Up @@ -116,7 +116,7 @@ const node = await createLibp2p({
discoverRelays: 2
})
],
connectionEncryption: [
connectionEncrypters: [
noise()
],
streamMuxers: [
Expand Down Expand Up @@ -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]
Expand All @@ -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()}`)
Expand Down
2 changes: 1 addition & 1 deletion dialer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main () {
webSockets(),
circuitRelayTransport()
],
connectionEncryption: [
connectionEncrypters: [
noise()
],
streamMuxers: [
Expand Down
2 changes: 1 addition & 1 deletion listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function main () {
discoverRelays: 2
})
],
connectionEncryption: [
connectionEncrypters: [
noise()
],
streamMuxers: [
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function main () {
transports: [
webSockets()
],
connectionEncryption: [
connectionEncrypters: [
noise()
],
streamMuxers: [
Expand Down

0 comments on commit 7da22bd

Please sign in to comment.