0.8.1 • Published 10 years ago
sombrero-gossip v0.8.1
Sombrero Gossip
To be used as part of a Sombrero Node. Implements a gossip protocol over a set of peers.
Install
$ npm install sombrero-gossip
Require and Create
var Gossip = require('sombrero-gossip');
var options = {
port: 7000
};
var gossip = Gossip(options);
Options:
port
: defaults to 8217peers
: array of peers, each containing an id, hostname and port attributesinterval
: the interval with which it contacts other nodes
API
gossip.addPeer(peer)
Add a peer. A peer must have the following attributes:
- id
- hostname
- port
gossip.removePeer(peerId)
Removes a peer.
gossip.cluster.set(key, value)
Set a gossip value on the cluster.
gossip.cluster.get(key)
Returns the current known value.
License
ISC