UNPKG

@neo-one/server-plugin-network

Version:

NEO•ONE Server network plugin.

47 lines (46 loc) 1.72 kB
import { Monitor } from '@neo-one/monitor'; import { Binary, DescribeTable } from '@neo-one/server-plugin'; import { Observable } from 'rxjs'; import { NodeSettings } from '../types'; export interface Node { readonly name: string; readonly live: boolean; readonly ready: boolean; readonly rpcAddress: string; readonly tcpAddress: string; readonly telemetryAddress: string; } export interface NodeStatus { readonly rpcAddress: string; readonly tcpAddress: string; readonly telemetryAddress: string; } export declare abstract class NodeAdapter { readonly name: string; readonly node$: Observable<Node>; protected readonly binary: Binary; protected readonly dataPath: string; protected readonly monitor: Monitor; protected mutableSettings: NodeSettings; constructor({ monitor, name, binary, dataPath, settings, }: { readonly monitor: Monitor; readonly name: string; readonly binary: Binary; readonly dataPath: string; readonly settings: NodeSettings; }); getDebug(): DescribeTable; create(): Promise<void>; update(settings: NodeSettings): Promise<void>; start(): Promise<void>; stop(): Promise<void>; abstract getNodeStatus(): NodeStatus; live(timeoutSeconds: number): Promise<void>; ready(timeoutSeconds: number): Promise<void>; protected abstract isLive(): Promise<boolean>; protected abstract isReady(): Promise<boolean>; protected abstract createInternal(): Promise<void>; protected abstract updateInternal(_settings: NodeSettings): Promise<void>; protected abstract startInternal(): Promise<void>; protected abstract stopInternal(): Promise<void>; }