Skip to content

Commit

Permalink
refactor(rosenet-node, rosenet-relay): switch from mplex to yamux
Browse files Browse the repository at this point in the history
Based on the docs, `mplex` is going to be deprecated in favor of `yamux`.
  • Loading branch information
mkermani144 committed Aug 14, 2024
1 parent 47444f8 commit 44c6d3e
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-hairs-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-bridge/rosenet-utils': patch
---

Append unused format parameters to format function
6 changes: 6 additions & 0 deletions .changeset/tame-queens-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rosen-bridge/rosenet-relay': minor
'@rosen-bridge/rosenet-node': minor
---

Switch from mplex to yamux for multiplexing
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/rosenet-node/lib/createRoseNetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { bootstrap } from '@libp2p/bootstrap';
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2';
import { identify } from '@libp2p/identify';
import { PeerId } from '@libp2p/interface';
import { mplex } from '@libp2p/mplex';
import { yamux } from '@chainsafe/libp2p-yamux';
import { pubsubPeerDiscovery } from '@libp2p/pubsub-peer-discovery';
import { tcp } from '@libp2p/tcp';
import map from 'it-map';
Expand Down Expand Up @@ -95,7 +95,7 @@ const createRoseNetNode = async ({
denyDialPeer: isPeerUnauthorized,
}),
},
streamMuxers: [mplex()],
streamMuxers: [yamux()],
peerDiscovery: [
bootstrap({
list: config.relayMultiaddrs,
Expand Down
2 changes: 1 addition & 1 deletion packages/rosenet-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"dependencies": {
"@chainsafe/libp2p-gossipsub": "^12.0.0",
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/libp2p-yamux": "^6.0.2",
"@libp2p/bootstrap": "^10.0.15",
"@libp2p/circuit-relay-v2": "^1.0.15",
"@libp2p/identify": "^1.0.14",
"@libp2p/mplex": "^10.0.15",
"@libp2p/peer-id": "^4.0.6",
"@libp2p/pubsub-peer-discovery": "^10.0.2",
"@libp2p/tcp": "^9.0.15",
Expand Down
4 changes: 2 additions & 2 deletions packages/rosenet-relay/lib/createRoseNetRelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { noise } from '@chainsafe/libp2p-noise';
import { circuitRelayServer } from '@libp2p/circuit-relay-v2';
import { identify } from '@libp2p/identify';
import { PeerId } from '@libp2p/interface';
import { mplex } from '@libp2p/mplex';
import { yamux } from '@chainsafe/libp2p-yamux';
import { pubsubPeerDiscovery } from '@libp2p/pubsub-peer-discovery';
import { tcp } from '@libp2p/tcp';
import { createLibp2p } from 'libp2p';
Expand Down Expand Up @@ -63,7 +63,7 @@ const createRoseNetRelay = async ({
denyInboundRelayedConnection: () => true,
denyDialPeer: isPeerUnauthorized,
},
streamMuxers: [mplex()],
streamMuxers: [yamux()],
services: {
circuitRelay: circuitRelayServer({
reservations: {
Expand Down
2 changes: 1 addition & 1 deletion packages/rosenet-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"dependencies": {
"@chainsafe/libp2p-gossipsub": "^12.0.0",
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/libp2p-yamux": "^6.0.2",
"@libp2p/circuit-relay-v2": "^1.0.15",
"@libp2p/identify": "^1.0.14",
"@libp2p/interface": "^1.1.3",
"@libp2p/mplex": "^10.0.15",
"@libp2p/pubsub-peer-discovery": "^10.0.2",
"@libp2p/tcp": "^9.0.15",
"@rosen-bridge/logger-interface": "^0.2.0",
Expand Down

0 comments on commit 44c6d3e

Please sign in to comment.