
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@curium.rocks/maestro
Advanced tools
Connects emitters to chroniclers and transceivers along with managing state of emitters
Manager of emitters and chroniclers. Intended to run as a service and house multiple emitters.
npm install --save @curium.rocks/maestro
You can view the API documentation here.
The below example shows a full configuration, load, and save handlers can be provided to dynamically fetch the latest config on save/load calls.
/***
* Create a logger facade wrapper winston
* @param {string} serviceName
* @return {LoggerFacade}
*/
function getLoggerFacade(serviceName: string): LoggerFacade {
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: serviceName },
transports: [
new winston.transports.Console()
],
});
return {
info: logger.info.bind(logger),
debug: logger.debug.bind(logger),
trace: logger.silly.bind(logger),
warn: logger.warn.bind(logger),
error: logger.error.bind(logger),
critical: logger.error.bind(logger)
}
}
/**
* Get the configuraiton obj, in this case it's mostly static for demo purposes,
* but this could fetch from a file, fill properties in from a DB etc.
* @param {string} logDir log directory for json chronicler
* @param {string} logName log name for json chronicler
* @return {IMaestroConfig}
*/
function getConfig(logDir?: string, logName?: string) : IMaestroConfig {
return {
id: 'meastro-id',
name: 'meastro-name',
description: 'meastro description',
formatSettings: {
encrypted: false,
type: 'N/A'
},
connections: [{
emitters: [
'ping-pong-1'
],
chroniclers: [
'json-chronicler-1'
]
}],
factories: {
emitter: [{
factoryType: PingPongEmitter.TYPE,
factoryPath: 'PingPongEmitterFactory',
packageName: '@curium.rocks/ping-pong-emitter',
}],
chronicler: [{
factoryType: JsonChronicler.TYPE,
factoryPath: 'JsonChroniclerFactory',
packageName: '@curium.rocks/json-chronicler'
}]
},
emitters: [{
config: {
type: PingPongEmitter.TYPE,
id: 'ping-pong-1',
name: 'My Ping Pong Emitter 1',
description: "A ping pong emitter",
emitterProperties: {
interval: 250
}
}
}],
chroniclers: [{
config: {
type: JsonChronicler.TYPE,
id: 'json-chronicler-1',
name: 'Chronicler 1',
description: "A json chronicler",
chroniclerProperties: {
logDirectory: logDir || './logs',
logName: logName || 'maestro',
rotationSettings: {
seconds: 300
}
}
}
}]
}
}
const maestroOptions = {
config: getConfig(),
logger: getLoggerFacade('maestro'),
loadHandler: () => {
return Promise.resolve(getConfig());
}
}
Once you have your configuration, you can create the maestro:
const maestro = new Maestro(maestroOptions);
The meastro doesn't start automatically and you must call start, this refreshes it's configuration and starts any emitters as well.
await maestro.start();
You can add a hook to clean up gracefully on SIG INT
like so:
process.on('SIGINT', async () => {
await maestro.disposeAsync();
})
import { IMaestro, LoggerFacade, ProviderSingleton } from "@curium.rocks/data-emitter-base";
import { JsonChronicler } from "@curium.rocks/json-chronicler";
import { PingPongEmitter } from "@curium.rocks/ping-pong-emitter";
import { IMaestroConfig, Maestro } from "@curium.rocks/maestro";
import winston from "winston";
/**
* Create a logger facade wrapper winston
* @param {string} serviceName
* @return {LoggerFacade}
*/
function getLoggerFacade(serviceName: string): LoggerFacade {
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: serviceName },
transports: [
new winston.transports.Console()
],
});
return {
info: logger.info.bind(logger),
debug: logger.debug.bind(logger),
trace: logger.silly.bind(logger),
warn: logger.warn.bind(logger),
error: logger.error.bind(logger),
critical: logger.error.bind(logger)
}
}
/**
* Get the configuraiton obj, in this case it's mostly static for demo purposes,
* but this could fetch from a file, fill properties in from a DB etc.
* @param {string} logDir log directory for json chronicler
* @param {string} logName log name for json chronicler
* @return {IMaestroConfig}
*/
function getConfig(logDir?: string, logName?: string) : IMaestroConfig {
return {
id: 'meastro-id',
name: 'meastro-name',
description: 'meastro description',
formatSettings: {
encrypted: false,
type: 'N/A'
},
connections: [{
emitters: [
'ping-pong-1'
],
chroniclers: [
'json-chronicler-1'
]
}],
factories: {
emitter: [{
factoryType: PingPongEmitter.TYPE,
factoryPath: 'PingPongEmitterFactory',
packageName: '@curium.rocks/ping-pong-emitter',
}],
chronicler: [{
factoryType: JsonChronicler.TYPE,
factoryPath: 'JsonChroniclerFactory',
packageName: '@curium.rocks/json-chronicler'
}]
},
emitters: [{
config: {
type: PingPongEmitter.TYPE,
id: 'ping-pong-1',
name: 'My Ping Pong Emitter 1',
description: "A ping pong emitter",
emitterProperties: {
interval: 250
}
}
}],
chroniclers: [{
config: {
type: JsonChronicler.TYPE,
id: 'json-chronicler-1',
name: 'Chronicler 1',
description: "A json chronicler",
chroniclerProperties: {
logDirectory: logDir || './logs',
logName: logName || 'maestro',
rotationSettings: {
seconds: 300
}
}
}
}]
}
}
const maestroOptions = {
config: getConfig(),
logger: getLoggerFacade('maestro'),
loadHandler: () => {
return Promise.resolve(getConfig());
}
}
ProviderSingleton.getInstance().setLoggerFacade(maestroOptions.logger);
const maestro:IMaestro = new Maestro(maestroOptions);
maestro.start();
process.on('SIGINT', async () => {
await maestro.disposeAsync();
});
For more information generate the docs using npm run doc
, documentation for each version is also attached as an artifact of the build in CI.
FAQs
Connects emitters to chroniclers and transceivers along with managing state of emitters
We found that @curium.rocks/maestro 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.