coreflow/ts/index.ts

31 lines
871 B
TypeScript
Raw Normal View History

2024-05-08 22:05:16 +00:00
import * as early from '@push.rocks/early';
// early
early.start('coreflow');
import * as plugins from './coreflow.plugins.js';
import * as paths from './coreflow.paths.js';
import { logger } from './coreflow.logging.js';
import { projectInfoNpm } from './coreflow.info.js';
import { smartnetworkInstance } from './coreflow.network.js';
import { Coreflow } from './coreflow.classes.coreflow.js';
early.stop();
// startup
let coreflowInstance: Coreflow;
export const runCli = async () => {
logger.log(
'info',
`trying to start coreflow@v${projectInfoNpm.version} on ${
(await smartnetworkInstance.getPublicIps()).v4
}`
);
coreflowInstance = new Coreflow();
await coreflowInstance.start();
logger.log('success', `coreflow@v${projectInfoNpm.version} successfully started!`);
};
export const stop = async () => {
coreflowInstance.stop();
};