Skip to content

Instantly share code, notes, and snippets.

@vasa-develop
Created December 28, 2019 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasa-develop/5f23e3917e7fa33375e897aacb4918f6 to your computer and use it in GitHub Desktop.
Save vasa-develop/5f23e3917e7fa33375e897aacb4918f6 to your computer and use it in GitHub Desktop.
SimpleAsWater: Building a Chat Application using Libp2p
const Libp2p = require('libp2p')
const TCP = require('libp2p-tcp')
const defaultsDeep = require('@nodeutils/defaults-deep')
const DEFAULT_OPTS = {
modules: {
transport: [
TCP
]
}
}
class P2PNode extends Libp2p {
constructor (opts) {
super(defaultsDeep(opts, DEFAULT_OPTS))
}
}
module.exports = P2PNode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment