UNPKG

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