mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { RunningMainRet } from "./RunningMainRet";
|
|
import { Effects, ExpectedExports } from "../types";
|
|
export * as network from "./exportInterfaces";
|
|
export { LocalBinding } from "./LocalBinding";
|
|
export { LocalPort } from "./LocalPort";
|
|
export { NetworkBuilder } from "./NetworkBuilder";
|
|
export { NetworkInterfaceBuilder } from "./NetworkInterfaceBuilder";
|
|
export { Origin } from "./Origin";
|
|
export { TorBinding } from "./TorBinding";
|
|
export { TorHostname } from "./TorHostname";
|
|
|
|
export { Daemons } from "./Daemons";
|
|
|
|
/**
|
|
* Used to ensure that the main function is running with the valid proofs.
|
|
* We first do the folowing order of things
|
|
* 1. We get the interfaces
|
|
* 2. We setup all the commands to setup the system
|
|
* 3. We create the health checks
|
|
* 4. We setup the daemons init system
|
|
* @param fn
|
|
* @returns
|
|
*/
|
|
export const runningMain: (
|
|
fn: (o: {
|
|
effects: Effects;
|
|
started(onTerm: () => void): null;
|
|
}) => Promise<RunningMainRet>
|
|
) => ExpectedExports.main = (fn) => {
|
|
return async (options) => {
|
|
const { daemon } = await fn(options);
|
|
daemon.wait();
|
|
};
|
|
};
|