Skip to content

Instantly share code, notes, and snippets.

@vasco-santos
Created September 24, 2020 16:46
Show Gist options
  • Save vasco-santos/c30bb5d1ce0a62f3c500f25162a0591b to your computer and use it in GitHub Desktop.
Save vasco-santos/c30bb5d1ce0a62f3c500f25162a0591b to your computer and use it in GitHub Desktop.
libp2p Basic setup multiplexer
const Libp2p = require('libp2p')
const WebSockets = require('libp2p-websockets')
const WebRtcStar = require('libp2p-webrtc-star')
const { NOISE } = require('libp2p-noise')
const MPLEX = require('libp2p-mplex')
const node = await Libp2p.create({
modules: {
transport: [WebSockets, WebRtcStar],
connEncryption: [NOISE],
streamMuxer: [MPLEX]
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment