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/b4a996a83c0f02fe46e72d875543cc2f to your computer and use it in GitHub Desktop.
Save vasa-develop/b4a996a83c0f02fe46e72d875543cc2f to your computer and use it in GitHub Desktop.
SimpleAsWater: Building a Chat Application using Libp2p
'use strict'
/* eslint-disable no-console */
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const Node = require('./libp2p_bundle')
PeerId.createFromJSON(require('./ids/moonId'), (err, peerId) => {
if (err) {
throw err
}
const peerInfo = new PeerInfo(peerId)
peerInfo.multiaddrs.add('/ip4/127.0.0.1/tcp/10333')
const nodeListener = new Node({ peerInfo })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment