import { STHConfiguration } from "@scramjet/types" ; import { Host , startHost } from "@scramjet/host" ; export class STH { config : STHConfiguration ; host ? : Host ; constructor ( config ) { this . config = config ; } async start ( ) { this . host = await startHost ( { } , this . config , { identifyExisting : this . config . identifyExisting } ) . catch ( ( e ) => { console . error ( e . stack ) ; process . exitCode = e . exitCode || 1 ; process . exit ( ) ; } ) ; return this . host ; } async stop ( ) { return this . host ?. stop ( ) ; } }