feat: use yamux instead of mplex

This commit is contained in:
Danish Arora 2024-09-18 13:28:11 +05:30
parent 0a0a92bccb
commit 91eea23624
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
4 changed files with 30 additions and 7180 deletions

View File

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

7204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^16.0.0",
"@chainsafe/libp2p-yamux": "^7.0.0",
"@libp2p/bootstrap": "^11.0.1",
"@libp2p/identify": "^3.0.1",
"@libp2p/mplex": "^11.0.1",

View File

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