UNPKG

1.47 kBTypeScriptView Raw
1import { ECPoint, PrivateKey, UInt160 } from '@neo-one/client-common';
2import { Monitor } from '@neo-one/monitor';
3import { ConsensusPayload, Node, Transaction } from '@neo-one/node-core';
4import { Observable } from 'rxjs';
5export interface Options {
6 readonly privateKey: string;
7 readonly privateNet: boolean;
8}
9export interface InternalOptions {
10 readonly privateKey: PrivateKey;
11 readonly publicKey: ECPoint;
12 readonly feeAddress: UInt160;
13 readonly privateNet: boolean;
14}
15export declare class Consensus {
16 private mutableQueue;
17 private mutableTimer;
18 private readonly options$;
19 private readonly node;
20 private mutableConsensusContext;
21 private readonly monitor;
22 private mutableStartPromise;
23 constructor({ options$, node, monitor, }: {
24 readonly options$: Observable<Options>;
25 readonly node: Node;
26 readonly monitor: Monitor;
27 });
28 start$(): Observable<void>;
29 onPersistBlock(): void;
30 onConsensusPayloadReceived(payload: ConsensusPayload): void;
31 onTransactionReceived(transaction: Transaction): void;
32 runConsensusNow(): Promise<void>;
33 nowSeconds(): number;
34 fastForwardOffset(seconds: number): Promise<void>;
35 fastForwardToTime(seconds: number): Promise<void>;
36 pause(): Promise<void>;
37 reset(): Promise<void>;
38 resume(): Promise<void>;
39 private doStart;
40 private start;
41 private handleResult;
42 private handleTimer;
43 private clearTimer;
44}