diff --git a/examples/chat/src/libp2p-bundle.js b/examples/chat/src/libp2p-bundle.js index 053a5719..f76f8b72 100644 --- a/examples/chat/src/libp2p-bundle.js +++ b/examples/chat/src/libp2p-bundle.js @@ -6,7 +6,7 @@ const WS = require('libp2p-websockets') const Railing = require('libp2p-railing') const spdy = require('libp2p-spdy') const KadDHT = require('libp2p-kad-dht') -const multiplex = require('libp2p-multiplex') +const mplex = require('libp2p-mplex') const secio = require('libp2p-secio') const libp2p = require('../../..') @@ -17,7 +17,7 @@ function mapMuxers (list) { } switch (pref.trim().toLowerCase()) { case 'spdy': return spdy - case 'multiplex': return multiplex + case 'mplex': return mplex default: throw new Error(pref + ' muxer not available') } @@ -31,7 +31,7 @@ function getMuxers (muxers) { } else if (muxers) { return mapMuxers(muxers) } else { - return [multiplex, spdy] + return [mplex, spdy] } } diff --git a/examples/discovery-mechanisms/1.js b/examples/discovery-mechanisms/1.js index dd056435..a0eb5664 100644 --- a/examples/discovery-mechanisms/1.js +++ b/examples/discovery-mechanisms/1.js @@ -2,7 +2,7 @@ const libp2p = require('libp2p') const TCP = require('libp2p-tcp') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SECIO = require('libp2p-secio') const PeerInfo = require('peer-info') const Railing = require('libp2p-railing') @@ -26,7 +26,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, discovery: [new Railing(bootstrapers)] diff --git a/examples/discovery-mechanisms/2.js b/examples/discovery-mechanisms/2.js index b32b09ed..2758352f 100644 --- a/examples/discovery-mechanisms/2.js +++ b/examples/discovery-mechanisms/2.js @@ -2,7 +2,7 @@ const libp2p = require('libp2p') const TCP = require('libp2p-tcp') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SECIO = require('libp2p-secio') const PeerInfo = require('peer-info') const MulticastDNS = require('libp2p-mdns') @@ -14,7 +14,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, discovery: [new MulticastDNS(peerInfo, { interval: 1000 })] diff --git a/examples/discovery-mechanisms/README.md b/examples/discovery-mechanisms/README.md index 83bdc6e8..254f0843 100644 --- a/examples/discovery-mechanisms/README.md +++ b/examples/discovery-mechanisms/README.md @@ -8,7 +8,7 @@ These mechanisms save configuration and enable a node to operate without any exp ## 1. Bootstrap list of Peers when booting a node -For this demo, we will connect to IPFS default bootstrapper nodes and so, we will need to support the same set of features those nodes have, that are: TCP, multiplex and SECIO. You can see the complete example at [1.js](./1.js). +For this demo, we will connect to IPFS default bootstrapper nodes and so, we will need to support the same set of features those nodes have, that are: TCP, mplex and SECIO. You can see the complete example at [1.js](./1.js). First, we create our libp2p bundle. @@ -18,7 +18,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, discovery: [new Railing(bootstrapers)] @@ -111,7 +111,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, // We set the interval here to 1 second so that is faster to observe. The diff --git a/examples/echo/src/libp2p-bundle.js b/examples/echo/src/libp2p-bundle.js index 053a5719..f76f8b72 100644 --- a/examples/echo/src/libp2p-bundle.js +++ b/examples/echo/src/libp2p-bundle.js @@ -6,7 +6,7 @@ const WS = require('libp2p-websockets') const Railing = require('libp2p-railing') const spdy = require('libp2p-spdy') const KadDHT = require('libp2p-kad-dht') -const multiplex = require('libp2p-multiplex') +const mplex = require('libp2p-mplex') const secio = require('libp2p-secio') const libp2p = require('../../..') @@ -17,7 +17,7 @@ function mapMuxers (list) { } switch (pref.trim().toLowerCase()) { case 'spdy': return spdy - case 'multiplex': return multiplex + case 'mplex': return mplex default: throw new Error(pref + ' muxer not available') } @@ -31,7 +31,7 @@ function getMuxers (muxers) { } else if (muxers) { return mapMuxers(muxers) } else { - return [multiplex, spdy] + return [mplex, spdy] } } diff --git a/examples/libp2p-in-the-browser/1/package.json b/examples/libp2p-in-the-browser/1/package.json index 089af1e7..efaa19cc 100644 --- a/examples/libp2p-in-the-browser/1/package.json +++ b/examples/libp2p-in-the-browser/1/package.json @@ -18,7 +18,7 @@ "dependencies": { "detect-dom-ready": "^1.0.2", "libp2p": "^0.13.0", - "libp2p-multiplex": "^0.5.0", + "libp2p-mplex": "^0.6.0", "libp2p-railing": "^0.7.1", "libp2p-secio": "^0.8.1", "libp2p-spdy": "^0.11.0", diff --git a/examples/libp2p-in-the-browser/1/src/browser-bundle.js b/examples/libp2p-in-the-browser/1/src/browser-bundle.js index b60e268b..92a28386 100644 --- a/examples/libp2p-in-the-browser/1/src/browser-bundle.js +++ b/examples/libp2p-in-the-browser/1/src/browser-bundle.js @@ -3,7 +3,7 @@ const WebRTCStar = require('libp2p-webrtc-star') const WebSockets = require('libp2p-websockets') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SPDY = require('libp2p-spdy') const SECIO = require('libp2p-secio') @@ -37,7 +37,7 @@ class Node extends libp2p { ], connection: { muxer: [ - Multiplex, + Mplex, SPDY ], crypto: [SECIO] diff --git a/examples/peer-and-content-routing/1.js b/examples/peer-and-content-routing/1.js index cfded2b2..056f78f5 100644 --- a/examples/peer-and-content-routing/1.js +++ b/examples/peer-and-content-routing/1.js @@ -2,7 +2,7 @@ const libp2p = require('libp2p') const TCP = require('libp2p-tcp') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SECIO = require('libp2p-secio') const PeerInfo = require('peer-info') const KadDHT = require('libp2p-kad-dht') @@ -15,7 +15,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, // we add the DHT module that will enable Peer and Content Routing diff --git a/examples/peer-and-content-routing/2.js b/examples/peer-and-content-routing/2.js index d362fd75..330e4901 100644 --- a/examples/peer-and-content-routing/2.js +++ b/examples/peer-and-content-routing/2.js @@ -2,7 +2,7 @@ const libp2p = require('libp2p') const TCP = require('libp2p-tcp') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SECIO = require('libp2p-secio') const PeerInfo = require('peer-info') const CID = require('cids') @@ -16,7 +16,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, // we add the DHT module that will enable Peer and Content Routing diff --git a/examples/peer-and-content-routing/README.md b/examples/peer-and-content-routing/README.md index 5ea85b64..06ce9471 100644 --- a/examples/peer-and-content-routing/README.md +++ b/examples/peer-and-content-routing/README.md @@ -18,7 +18,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, // we add the DHT module that will enable Peer and Content Routing diff --git a/examples/protocol-and-stream-muxing/README.md b/examples/protocol-and-stream-muxing/README.md index 46486ef8..3abe138b 100644 --- a/examples/protocol-and-stream-muxing/README.md +++ b/examples/protocol-and-stream-muxing/README.md @@ -88,7 +88,7 @@ The example above would require a node to create a whole new connection for ever Stream multiplexing is a old concept, in fact it happens in many of the layers of the [OSI System](https://en.wikipedia.org/wiki/OSI_model), in libp2p we make this feature to our avail by letting the user pick which module for stream multiplexing to use. -Currently, we have two available [libp2p-spdy](https://github.com/libp2p/js-libp2p-spdy) and [libp2p-multiplex](https://github.com/libp2p/js-libp2p-multiplex) and pluging them in is as easy as adding another transport. Let's revisit our libp2p bundle. +Currently, we have two available [libp2p-spdy](https://github.com/libp2p/js-libp2p-spdy) and [libp2p-mplex](https://github.com/libp2p/js-libp2p-mplex) and pluging them in is as easy as adding another transport. Let's revisit our libp2p bundle. ```JavaScript const SPDY = require('libp2p-spdy') diff --git a/examples/pubsub/1.js b/examples/pubsub/1.js index 08385433..3e5ce29d 100644 --- a/examples/pubsub/1.js +++ b/examples/pubsub/1.js @@ -2,7 +2,7 @@ const libp2p = require('libp2p') const TCP = require('libp2p-tcp') -const Multiplex = require('libp2p-multiplex') +const Mplex = require('libp2p-mplex') const SECIO = require('libp2p-secio') const PeerInfo = require('peer-info') const MulticastDNS = require('libp2p-mdns') @@ -15,7 +15,7 @@ class MyBundle extends libp2p { const modules = { transport: [new TCP()], connection: { - muxer: [Multiplex], + muxer: [Mplex], crypto: [SECIO] }, discovery: [