
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
@aggregion/blockchain-mq
Advanced tools
const keySource = new MockKeySource();
const dataSource = new MockDataSource<string>();
const bmq = new BlockchainMQ({
keySource,
dataSource,
ownKey: await keySource.getMyKey('my_org_id'),
pollingInterval: 1000,
});
const topic = 56; // Some topic number
// Listening for new messages
const emitter = await bmq.poll<string>(topic);
let lastCursor;
emitter.on('message', (message) => {
console.log(message);
});
emitter.on('newCursor', (cursor) => {
lastCursor = cursor; // In production, you must save cursor and resume from this another time you need polling
});
await bmq.send<string>(
topic, // Topic number
'Hello!',
'some_receiver_org_id',
);
// Broadcast message
await bmq.send<string>(
topic,
'Hello!'
);
emitter.stop(); // Stop polling
bmq.stopAll(); // You can use this method instead of calling "stop" of each emitter
To use with the real blockchain, create client instance as follows (also look at blockchainMQ.e2e-spec.ts for example):
import { AggregionBlockchain } from '@aggregion/dmp-contracts';
const client = new AggregionBlockchain(nodeUrl, [
pair1.privateKey,
pair2.privateKey,
]);
const blockchainMQ = new BlockchainMQ({
keySource: new EosKeySource({
contractName: 'dmpusers',
client: client,
}),
dataSource: new EosDataSource({
contractName: 'dmpusers',
client: client,
clientAccount: 'your_orgId', // Id of your organization in orgsv2 table
}),
ownKey: {
orgId: 'your_orgId',// Id of your organization in orgsv2 table
data: 'your organization private key', // Not blockchain key! It is private part of public key saved in orgsv2 table
format: KeyFormat.PKCS1_PEM,
algo: KeyAlgo.RSA_4096,
},
pollingInterval: 500,
});
FAQs
Blockchain message queue module
The npm package @aggregion/blockchain-mq receives a total of 0 weekly downloads. As such, @aggregion/blockchain-mq popularity was classified as not popular.
We found that @aggregion/blockchain-mq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.