Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
seneca-gossip
Advanced tools
seneca-gossip a cluster solution using gossip protocols for seneca.
The gossip's port default is options.port+1 .
The server2 join the cluster with seed - 127.0.0.1:4445.
The client join the cluster with seed - 127.0.0.1:4445 too, it also can client to the server2 with gossip.
So you can start a node with a known active node in the cluster, and then you can call the service with {role: xxx, cmd:xxx} but don't need to care about their physical location in the cluster.
var Seneca = require('seneca');
var Gossip = new require('../index');
var seneca = new Seneca();
seneca.add({role: 'api', cmd: 'add'}, function (msg, respond) {
var result = msg.left + msg.right;
respond(null, {result: result});
});
var options = {port: 4444, type: 'tcp', host: '127.0.0.1', pin: 'role:api'};
Gossip(seneca).start(options);
var seneca2 = new Seneca();
seneca2.add({role: 'api', cmd: 'mcl'}, function (msg, respond) {
var result = msg.left * msg.right;
respond(null, {result: result});
});
var options2 = {port: 4454, type: 'tcp', host: '127.0.0.1', pin: 'role:api',
seeds: ['127.0.0.1:4445']};
Gossip(seneca2).start(options2);
var Seneca = require('seneca');
var seneca = new Seneca();
var Gossip = new require('../index');
Gossip(seneca).start({port: 6666, type: 'tcp', host: '127.0.0.1', seeds: ['127.0.0.1:4445']});
setInterval(function () {
seneca.act({role: "api", cmd: "add", left: 2, right: 3}, function (e, r) {
console.log("2 + 3 =", r.result);
});
seneca.act({role: "api", cmd: "mcl", left: 2, right: 3}, function (e, r) {
console.log("2 * 3 =", r.result);
});
}, 2000);
**************************
2 + 3 = 5
2 * 3 = 6
Both the gossip protocol and the failure detection algorithms are based off of academic papers and Cassandra's (http://www.cassandra.org/) implementation of those papers. This library is highly indebted to both.
FAQs
seneca gossip protocol support
We found that seneca-gossip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.