Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const Libp2p = require('libp2p')
  2. const TCP = require('libp2p-tcp')
  3. const Multiplex = require('libp2p-mplex')
  4. const SECIO = require('libp2p-secio')
  5.  
  6. const defaultsDeep = require('@nodeutils/defaults-deep')
  7.  
  8. const DEFAULT_OPTS = {
  9. modules: {
  10. transport: [
  11. TCP
  12. ],
  13. connEncryption: [
  14. SECIO
  15. ],
  16. streamMuxer: [
  17. Multiplex
  18. ]
  19. }
  20. }
  21.  
  22. class P2PNode extends Libp2p {
  23. constructor(opts) {
  24. super(defaultsDeep(opts, DEFAULT_OPTS))
  25. }
  26. }
  27.  
  28. module.exports = P2PNode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement