We are at a standstill with a dead repository and would like to bring it back to life. Our only problem is, it's lacks so much documentation, it's almost unusable.

We are able to make a connection to the network, show when people connect, disconnect, and who all is online.

Here is the repo in question. The file to keep an eye on is /lib/node.js (not to be confused with NodeJS itself).

Here is what we have to show for it:

var Node = require('n2n').Node; var node = new Node(5146); console.log("Connecting to the network...





"); node.connect([{ host: 'bradleypl.us', port: 5146 }]); node.on('online', function () { console.log('Your ID:', this.id); console.log('Online ids:', node.sortedIds); }); //just for testing, this will spam the terminal if repeated every time. node.on('node::online', function (newNode) { console.log('Someone is online:', newNode.id); }); //just for testing, this will spam the terminal if repeated every time. node.on('node::offline', function () { console.log('Someone just left!'); });

This is where we have no idea what to so. Now how does one send messages? We can see something like:

node.broadcast("node::test","message");

Being used to send a "node::test" event to everyone on the network. That is then received with:

node.on("node::test", function (message) { console.log("New message:",message); }

But that doesn't work... Any idea?