1 | import { Monitor } from '@neo-one/monitor-esnext-esm';
|
2 | import { Binary, DescribeTable } from '@neo-one/server-plugin-esnext-esm';
|
3 | import { Observable } from 'rxjs';
|
4 | import { NodeSettings } from '../types';
|
5 | export interface Node {
|
6 | readonly name: string;
|
7 | readonly live: boolean;
|
8 | readonly ready: boolean;
|
9 | readonly rpcAddress: string;
|
10 | readonly tcpAddress: string;
|
11 | readonly telemetryAddress: string;
|
12 | }
|
13 | export interface NodeStatus {
|
14 | readonly rpcAddress: string;
|
15 | readonly tcpAddress: string;
|
16 | readonly telemetryAddress: string;
|
17 | }
|
18 | export declare abstract class NodeAdapter {
|
19 | readonly name: string;
|
20 | readonly node$: Observable<Node>;
|
21 | protected readonly binary: Binary;
|
22 | protected readonly dataPath: string;
|
23 | protected readonly monitor: Monitor;
|
24 | protected mutableSettings: NodeSettings;
|
25 | constructor({ monitor, name, binary, dataPath, settings, }: {
|
26 | readonly monitor: Monitor;
|
27 | readonly name: string;
|
28 | readonly binary: Binary;
|
29 | readonly dataPath: string;
|
30 | readonly settings: NodeSettings;
|
31 | });
|
32 | getDebug(): DescribeTable;
|
33 | create(): Promise<void>;
|
34 | update(settings: NodeSettings): Promise<void>;
|
35 | start(): Promise<void>;
|
36 | stop(): Promise<void>;
|
37 | abstract getNodeStatus(): NodeStatus;
|
38 | live(timeoutSeconds: number): Promise<void>;
|
39 | ready(timeoutSeconds: number): Promise<void>;
|
40 | protected abstract isLive(): Promise<boolean>;
|
41 | protected abstract isReady(): Promise<boolean>;
|
42 | protected abstract createInternal(): Promise<void>;
|
43 | protected abstract updateInternal(_settings: NodeSettings): Promise<void>;
|
44 | protected abstract startInternal(): Promise<void>;
|
45 | protected abstract stopInternal(): Promise<void>;
|
46 | }
|