feat: use `yamux` instead of `mplex`

This commit is contained in:
Danish Arora 2024-09-18 13:28:11 +05:30
parent 3e821591c9
commit 4c510f589e
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
4 changed files with 6580 additions and 2431 deletions

View File

@ -124,6 +124,7 @@
"websockets", "websockets",
"wifi", "wifi",
"xsalsa20", "xsalsa20",
"yamux",
"Привет", "Привет",
"مرحبا" "مرحبا"
], ],

8999
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,8 @@
}, },
"dependencies": { "dependencies": {
"@chainsafe/libp2p-noise": "^15.1.0", "@chainsafe/libp2p-noise": "^15.1.0",
"@libp2p/bootstrap": "^10.1.2", "@chainsafe/libp2p-yamux": "^7.0.0",
"@libp2p/bootstrap": "^10",
"@libp2p/identify": "^2.1.2", "@libp2p/identify": "^2.1.2",
"@libp2p/mplex": "^10.1.2", "@libp2p/mplex": "^10.1.2",
"@libp2p/ping": "^1.1.2", "@libp2p/ping": "^1.1.2",
@ -67,9 +68,9 @@
"@waku/core": "0.0.32", "@waku/core": "0.0.32",
"@waku/discovery": "0.0.5", "@waku/discovery": "0.0.5",
"@waku/interfaces": "0.0.27", "@waku/interfaces": "0.0.27",
"@waku/message-hash": "0.1.16",
"@waku/proto": "^0.0.8", "@waku/proto": "^0.0.8",
"@waku/utils": "0.0.20", "@waku/utils": "0.0.20",
"@waku/message-hash": "0.1.16",
"libp2p": "^1.8.1" "libp2p": "^1.8.1"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,7 +1,7 @@
import { noise } from "@chainsafe/libp2p-noise"; import { noise } from "@chainsafe/libp2p-noise";
import { yamux } from "@chainsafe/libp2p-yamux";
import { bootstrap } from "@libp2p/bootstrap"; import { bootstrap } from "@libp2p/bootstrap";
import { identify } from "@libp2p/identify"; import { identify } from "@libp2p/identify";
import { mplex } from "@libp2p/mplex";
import { ping } from "@libp2p/ping"; import { ping } from "@libp2p/ping";
import { webSockets } from "@libp2p/websockets"; import { webSockets } from "@libp2p/websockets";
import { all as filterAll, wss } from "@libp2p/websockets/filters"; import { all as filterAll, wss } from "@libp2p/websockets/filters";
@ -63,7 +63,7 @@ export async function defaultLibp2p(
minConnections: 1 minConnections: 1
}, },
transports: [webSockets({ filter: filter })], transports: [webSockets({ filter: filter })],
streamMuxers: [mplex()], streamMuxers: [yamux()],
connectionEncryption: [noise()], connectionEncryption: [noise()],
...options, ...options,
services: { services: {