UNPKG

lisk-framework

Version:

Lisk blockchain application platform

53 lines (52 loc) 1.84 kB
/// <reference types="node" /> import { Database, StateDB } from '@liskhq/lisk-db'; import { Logger } from '../logger'; import { BasePlugin } from '../plugins/base_plugin'; import { ApplicationConfigForPlugin, EndpointHandlers, PluginConfig } from '../types'; import { InMemoryChannel } from './channels'; export interface ControllerOptions { readonly appConfig: ApplicationConfigForPlugin; readonly pluginConfigs: Record<string, PluginConfig>; readonly chainID: Buffer; } interface ControllerInitArg { readonly stateDB: StateDB; readonly moduleDB: Database; readonly logger: Logger; readonly endpoints: EndpointHandlers; readonly events: string[]; } export declare class Controller { private readonly _appConfig; private readonly _pluginConfigs; private readonly _config; private readonly _childProcesses; private readonly _inMemoryPlugins; private readonly _plugins; private readonly _endpointHandlers; private readonly _chainID; private readonly _bus; private readonly _internalIPCServer; private _logger; private _stateDB; private _moduleDB; private _channel?; constructor(options: ControllerOptions); get channel(): InMemoryChannel; getEndpoints(): ReadonlyArray<string>; getEvents(): ReadonlyArray<string>; init(arg: ControllerInitArg): void; registerPlugin(plugin: BasePlugin, options: PluginConfig): void; getRegisteredPlugins(): { [key: string]: BasePlugin; }; registerEndpoint(namespace: string, handlers: EndpointHandlers): void; start(): Promise<void>; stop(_code?: number, reason?: string): Promise<void>; private _unloadPlugins; private _loadInMemoryPlugin; private _loadChildProcessPlugin; private _unloadInMemoryPlugin; private _unloadChildProcessPlugin; } export {};