Network peer membership discovery and dissemination.
Not yet published to npm, point package.json directly to github repo.
{
"dependencies": {
"ouroboros": "nomilous/ouroboros"
}
}
const Ouroboros = require('ouroboros');
const ouroboros = new Ouroboros(config);
ouroboros.on('member-join', member => {});
ouroboros.on('member-leave', member => {});
ouroboros.start(joinList, meta, seed)
.then(...
config = {
host: '0.0.0.0'
port: 65533
keyFile:
certFile:
secret: 'secret'
}
optional, default shown above
The listening host and port of this service. The defaults shown above.
optional, no default
If present the service listens with a TLS server. Must point to valid key and cert file. No Default.
optional, default shown above
Set the shared secret that all hosts in the network should know. Use with TLS.
returns Promise of connected network membership
required
Array of addresses of the other network nodes to use in the join attempt.
eg
joinList = ['10.0.0.45:65533', '10.0.0.46:65533', '10.0.0.47:65533']
optional, default {}
Object containing meta information about this member that is shared with all outher members.
optional, default false
If true then if this member's attempt to join the cluster failed, this becomes the first member in a new cluster.