Last active
November 3, 2017 19:00
-
-
Save ngrinkevich/d4038ea4f342ee26cc4a17d6581964ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createNode((err, node) => { | |
if (err) { | |
return console.log('Could not create the Node', err) | |
} | |
node.on('peer:discovery', (peerInfo) => { | |
const idStr = peerInfo.id.toB58String() | |
console.log('Discovered a peer:', idStr) | |
}) | |
node.start((err) => { | |
if (err) { | |
return console.log('WebRTC not supported') | |
} | |
const idStr = node.peerInfo.id.toB58String() | |
console.log('Node ' + idStr + 'has just started'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment