2019-07-10 04:01:15 +00:00
|
|
|
export { };
|
|
|
|
|
2019-07-14 10:27:58 +00:00
|
|
|
import { ChildProcess } from 'child_process'
|
2019-07-12 14:46:26 +00:00
|
|
|
import CSmartContract from './core/transaction-validator'
|
|
|
|
import CConsensus from './core/block-exchange'
|
|
|
|
import CTransport from './core/server'
|
2019-07-22 02:16:37 +00:00
|
|
|
import * as BufLib from './core/buffer'
|
2019-07-12 14:46:26 +00:00
|
|
|
|
2019-07-10 04:01:15 +00:00
|
|
|
declare global {
|
|
|
|
var nw: any;
|
|
|
|
interface TeraError {
|
|
|
|
code: string;
|
|
|
|
stack: any;
|
|
|
|
}
|
|
|
|
interface Window {
|
|
|
|
RUN_CLIENT: number;
|
|
|
|
RUN_SERVER: number;
|
|
|
|
}
|
|
|
|
namespace NodeJS {
|
|
|
|
interface Global {
|
|
|
|
//#region run-node.ts
|
|
|
|
DATA_PATH: string;
|
|
|
|
CODE_PATH: string;
|
|
|
|
HTTP_PORT_NUMBER: number;
|
|
|
|
LOCAL_RUN: number;
|
|
|
|
//#endregion
|
2019-07-10 07:59:04 +00:00
|
|
|
|
2019-07-10 04:01:15 +00:00
|
|
|
//#region main-process.ts
|
|
|
|
PROCESS_NAME: string;
|
|
|
|
POWPROCESS: number;
|
|
|
|
DEBUGPROCESS: any;
|
2019-07-10 07:59:04 +00:00
|
|
|
START_SERVER: number;
|
|
|
|
SetCalcPOW: Function;
|
|
|
|
RunStopPOWProcess: Function;
|
|
|
|
NEW_SERVER_PRIVATE_KEY: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region constant.ts
|
2019-07-10 04:01:15 +00:00
|
|
|
UPDATE_CODE_VERSION_NUM: number;
|
|
|
|
MIN_CODE_VERSION_NUM: number;
|
|
|
|
MINING_VERSION_NUM: number;
|
|
|
|
InitParamsArg: Function;
|
|
|
|
CONST_NAME_ARR: string[];
|
2019-07-10 07:59:04 +00:00
|
|
|
MAX_LENGTH_SENDER_MAP: number;
|
|
|
|
DELTA_START_SENDER_MAP: number;
|
2019-07-10 04:01:15 +00:00
|
|
|
NODES_DELTA_CALC_HOUR: number;
|
2019-07-13 07:37:38 +00:00
|
|
|
USE_API_WALLET: number;
|
|
|
|
USE_API_V1: number;
|
2019-07-10 04:01:15 +00:00
|
|
|
USE_HARD_API_V2: number;
|
|
|
|
USE_TICKET: number;
|
|
|
|
USE_CHECK_SENDING: number;
|
|
|
|
USE_LEVEL_WAY: number;
|
|
|
|
TR_TICKET_HASH_LENGTH: number;
|
|
|
|
BLOCKNUM_TICKET_ALGO: number;
|
|
|
|
WATCHDOG_BADACCOUNT: number;
|
|
|
|
WATCHDOG_DEV: number;
|
2019-07-12 14:46:26 +00:00
|
|
|
RESYNC_CONDITION: {
|
|
|
|
OWN_BLOCKS: number;
|
|
|
|
K_POW: number;
|
|
|
|
};
|
2019-07-10 04:01:15 +00:00
|
|
|
REST_BLOCK_SCALE: number;
|
|
|
|
REST_START_COUNT: number;
|
|
|
|
LOAD_TO_BEGIN: number;
|
|
|
|
DEBUG_WALLET: number;
|
|
|
|
CHECK_GLOBAL_TIME: number;
|
|
|
|
AUTO_CORRECT_TIME: number;
|
|
|
|
DELTA_CURRENT_TIME: number;
|
|
|
|
NODES_NAME: string;
|
|
|
|
COMMON_KEY: string;
|
|
|
|
SERVER_PRIVATE_KEY_HEX: string;
|
|
|
|
USE_NET_FOR_SERVER_ADDRES: number;
|
|
|
|
NET_WORK_MODE: {
|
2019-07-10 07:59:04 +00:00
|
|
|
ip?: string;
|
|
|
|
port?: number | string;
|
|
|
|
UseDirectIP?: boolean | number;
|
|
|
|
NodeWhiteList?: string;
|
|
|
|
DoRestartNode?: number;
|
2019-07-20 14:30:47 +00:00
|
|
|
NOT_RUN?: boolean | number;
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|
|
|
|
STAT_MODE: number;
|
|
|
|
MAX_STAT_PERIOD: number;
|
|
|
|
UPDATE_NUM_COMPLETE: number;
|
|
|
|
WALLET_NAME: string;
|
|
|
|
WALLET_DESCRIPTION: string;
|
|
|
|
USE_MINING: number;
|
|
|
|
POW_MAX_PERCENT: number;
|
|
|
|
POW_RUN_COUNT: number;
|
|
|
|
POWRunPeriod: number;
|
|
|
|
CheckPointDelta: number;
|
|
|
|
ALL_LOG_TO_CLIENT: number;
|
|
|
|
LOG_LEVEL: number;
|
|
|
|
LIMIT_SEND_TRAFIC: number;
|
|
|
|
COUNT_VIEW_ROWS: number;
|
|
|
|
MIN_VER_STAT: number;
|
|
|
|
STOPGETBLOCK: number;
|
|
|
|
RESTART_PERIOD_SEC: number;
|
|
|
|
HARD_PACKET_PERIOD120: number;
|
|
|
|
MINING_START_TIME: string;
|
|
|
|
MINING_PERIOD_TIME: string;
|
|
|
|
CHECK_RUN_MINING: number;
|
|
|
|
CHECK_STOP_CHILD_PROCESS: number;
|
|
|
|
COUNT_MINING_CPU: number;
|
|
|
|
SIZE_MINING_MEMORY: number;
|
|
|
|
HTTP_HOSTING_PORT: number;
|
|
|
|
HTTPS_HOSTING_DOMAIN: string;
|
|
|
|
HTTP_MAX_COUNT_ROWS: number;
|
2019-07-13 07:37:38 +00:00
|
|
|
HTTP_ADMIN_PASSWORD: string;
|
|
|
|
HTTP_START_PAGE: string;
|
2019-07-10 04:01:15 +00:00
|
|
|
MIN_POWER_POW_HANDSHAKE: number;
|
|
|
|
USE_HINT: number;
|
|
|
|
ALL_VIEW_ROWS: number;
|
|
|
|
COUNT_BLOCK_PROOF: number;
|
|
|
|
COUNT_NODE_PROOF: number;
|
|
|
|
MIN_POWER_POW_MSG: number;
|
|
|
|
MEM_POOL_MSG_COUNT: number;
|
|
|
|
MAX_LEVEL_SPECIALIZATION: number;
|
|
|
|
MIN_CONNECT_CHILD: number;
|
|
|
|
MAX_CONNECT_CHILD: number;
|
|
|
|
MAX_CONNECTIONS_COUNT: number;
|
|
|
|
TRUST_PROCESS_COUNT: number;
|
|
|
|
MAX_NODES_RETURN: number;
|
|
|
|
MAX_WAIT_PERIOD_FOR_STATUS: number;
|
|
|
|
MAX_GRAY_CONNECTIONS_TO_SERVER: number;
|
|
|
|
MAX_PACKET_LENGTH: number;
|
|
|
|
COUNT_BLOCKS_FOR_LOAD: number;
|
|
|
|
TR_LEN: number;
|
|
|
|
BLOCK_PROCESSING_LENGTH: number;
|
|
|
|
BLOCK_PROCESSING_LENGTH2: number;
|
|
|
|
CONSENSUS_PERIOD_TIME: number;
|
|
|
|
MAX_BLOCK_SIZE: number;
|
|
|
|
MAX_TRANSACTION_SIZE: number;
|
|
|
|
MIN_TRANSACTION_SIZE: number;
|
|
|
|
MAX_TRANSACTION_COUNT: number;
|
|
|
|
MAX_TRANSACTION_LIMIT: number;
|
|
|
|
MIN_POWER_POW_TR: number;
|
|
|
|
MIN_POWER_POW_BL: number;
|
|
|
|
GENERATE_BLOCK_ACCOUNT: number;
|
|
|
|
TOTAL_SUPPLY_TERA: number;
|
|
|
|
TRANSACTION_PROOF_COUNT: number;
|
|
|
|
MIN_POWER_POW_ACC_CREATE: number;
|
|
|
|
START_MINING: number;
|
|
|
|
REF_PERIOD_MINING: number;
|
2019-07-15 01:17:30 +00:00
|
|
|
REF_PERIOD_END: number;
|
2019-07-10 04:01:15 +00:00
|
|
|
DELTA_BLOCK_ACCOUNT_HASH: number;
|
|
|
|
PERIOD_ACCOUNT_HASH: number;
|
|
|
|
START_BLOCK_ACCOUNT_HASH: number;
|
|
|
|
START_BLOCK_ACCOUNT_HASH3: number;
|
|
|
|
NEW_ACCOUNT_INCREMENT: number;
|
|
|
|
NEW_BLOCK_REWARD1: number;
|
|
|
|
NEW_FORMULA_START: number;
|
|
|
|
NEW_FORMULA_KTERA: number;
|
|
|
|
NEW_FORMULA_TARGET1: number;
|
|
|
|
NEW_FORMULA_TARGET2: number;
|
|
|
|
BLOCK_COUNT_IN_MEMORY: number;
|
|
|
|
HISTORY_BLOCK_COUNT: number;
|
|
|
|
MAX_SIZE_LOG: number;
|
|
|
|
READ_ONLY_DB: number;
|
|
|
|
USE_CHECK_SAVE_DB: number;
|
|
|
|
START_NETWORK_DATE: number;
|
|
|
|
NETWORK: string;
|
|
|
|
DEF_MAJOR_VERSION: string;
|
|
|
|
SMART_BLOCKNUM_START: number;
|
|
|
|
PRICE_DAO: Function;
|
|
|
|
NEW_SIGN_TIME: number;
|
|
|
|
TEST_TRANSACTION_GENERATE: number;
|
|
|
|
TEST_NETWORK: boolean | number;
|
2019-07-10 07:59:04 +00:00
|
|
|
START_PORT_NUMBER: number | string;
|
2019-07-10 04:01:15 +00:00
|
|
|
GetNetworkName: Function;
|
|
|
|
DEF_VERSION: string;
|
|
|
|
DEF_CLIENT: string;
|
|
|
|
FIRST_TIME_BLOCK: number;
|
|
|
|
START_BLOCK_RUN: number;
|
|
|
|
START_IP: string;
|
|
|
|
LISTEN_IP: string;
|
|
|
|
HTTP_PORT_PASSWORD: string;
|
|
|
|
HTTP_IP_CONNECT: string;
|
|
|
|
USE_AUTO_UPDATE: number;
|
|
|
|
USE_PARAM_JS: number;
|
|
|
|
CREATE_ON_START: boolean | number;
|
|
|
|
DEBUG_MODE: number;
|
|
|
|
RUN_CLIENT: number;
|
|
|
|
RUN_SERVER: number;
|
|
|
|
CHILD_POW: boolean;
|
|
|
|
ADDRLIST_MODE: boolean;
|
|
|
|
NWMODE: number;
|
|
|
|
NOALIVE: number;
|
|
|
|
DEV_MODE: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region startlib.ts
|
|
|
|
GetDataPath: (str: string) => string;
|
|
|
|
GetCodePath: (str: string) => string;
|
|
|
|
GetNormalPathString: (str: string) => string;
|
|
|
|
CheckCreateDir: (l, o?, t?) => void;
|
|
|
|
CopyFiles: (l, o, t) => void;
|
|
|
|
ToLog: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
TO_ERROR_LOG: Function;
|
|
|
|
ToLogClient: Function;
|
|
|
|
|
|
|
|
glCurNumFindArr: number;
|
2019-07-10 07:59:04 +00:00
|
|
|
ArrReconnect: any[];
|
|
|
|
ArrConnect: any[];
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#region main-process.ts:51
|
2019-07-12 14:46:26 +00:00
|
|
|
SERVER: CSmartContract | CConsensus | CTransport | any;
|
2019-07-10 04:01:15 +00:00
|
|
|
NeedRestart: number;
|
|
|
|
WEB_PROCESS: TeraProcess;
|
|
|
|
CountAllNode: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:100
|
|
|
|
GetCurrentTime: Function;
|
2019-07-10 07:59:04 +00:00
|
|
|
//#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#region
|
|
|
|
SpeedSignLib: number;
|
|
|
|
TestSignLib: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:118
|
|
|
|
TX_PROCESS: TeraProcess
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:141
|
|
|
|
AddTransactionFromWeb: Function;
|
|
|
|
STATIC_PROCESS: TeraProcess;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:204
|
|
|
|
WALLET: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:342
|
|
|
|
StopChildProcess: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region main-process.ts:375
|
|
|
|
MiningPaused: number;
|
2019-07-22 08:43:50 +00:00
|
|
|
ArrMiningWrk: any[];
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region library.ts:118
|
|
|
|
DelDir: Function;
|
|
|
|
SliceArr: Function;
|
|
|
|
random: Function;
|
|
|
|
AddrLevelArrFromBegin: Function;
|
|
|
|
AddrLevelArr: Function;
|
|
|
|
SaveToFile: Function;
|
|
|
|
LoadParams: Function;
|
|
|
|
SaveParams: Function;
|
|
|
|
StartTime: Function;
|
|
|
|
FinishTime: Function;
|
|
|
|
CompareItemBufFD: Function;
|
|
|
|
CompareArr33: Function;
|
|
|
|
CompareItemHashSimple: Function;
|
2019-07-12 14:46:26 +00:00
|
|
|
CompareItemHash: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
CompareItemHash32: Function;
|
|
|
|
CompareItemHASH32: Function;
|
|
|
|
CompareItemHash33: Function;
|
|
|
|
CompareItemHashPow: Function;
|
2019-07-12 14:46:26 +00:00
|
|
|
CompareItemTimePow: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
LOAD_CONST: Function;
|
|
|
|
SAVE_CONST: Function;
|
|
|
|
CheckGlobalTime: Function;
|
|
|
|
GetDeltaCurrentTime: Function;
|
|
|
|
GetStrTimeUTC: Function;
|
|
|
|
GetStrOnlyTimeUTC: Function;
|
|
|
|
GetSecFromStrTime: Function;
|
|
|
|
DateFromBlock: Function;
|
|
|
|
NormalizeName: Function;
|
|
|
|
CreateEval: Function;
|
|
|
|
GetCountMiningCPU: Function;
|
|
|
|
AddTrMap: string[];
|
|
|
|
GrayConnect: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region library.ts:118
|
|
|
|
RBTree: any;
|
|
|
|
ntpClient: any;
|
|
|
|
Stun: any;
|
|
|
|
ZIP: any;
|
|
|
|
secp256k1: any;
|
2019-07-22 02:16:37 +00:00
|
|
|
BufLib: typeof BufLib;
|
2019-07-10 04:01:15 +00:00
|
|
|
GetCurrentBlockNumByTime: Function;
|
|
|
|
TimeStart: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region run-nw.ts
|
|
|
|
NWVERSION: string;
|
2019-07-10 07:59:04 +00:00
|
|
|
HTTP_SERVER_START_OK: boolean | number;
|
|
|
|
NO_HISTORY_MODE: boolean;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
2019-07-11 13:54:41 +00:00
|
|
|
// //#region crypto-library.ts
|
|
|
|
// MAX_SUPER_VALUE_POW: number;
|
|
|
|
// GetHexFromAddres: Function;
|
|
|
|
// GetArr32FromHex: Function;
|
|
|
|
// GetAddresFromHex: Function;
|
|
|
|
// GetHexAddresFromPublicKey: Function;
|
|
|
|
// GetHexFromArr: Function;
|
|
|
|
// GetArrFromHex: Function;
|
|
|
|
// GetHexFromArrBlock: Function;
|
|
|
|
// GetPublicKeyFromAddres: Function;
|
|
|
|
// CheckDevelopSign: Function;
|
|
|
|
// CheckContextSecret: Function;
|
|
|
|
// GetSignHash: Function;
|
|
|
|
// GetVerifyHash: Function;
|
|
|
|
// GetKeyPair: Function;
|
|
|
|
// GetKeyPairTest: Function;
|
|
|
|
// GetHashWithValues: Function;
|
|
|
|
// CreateNoncePOWExtern: Function;
|
|
|
|
// CreateNoncePOWExternMinPower: Function;
|
|
|
|
// CreateNoncePOWInner: Function;
|
|
|
|
// CreateAddrPOW: Function;
|
|
|
|
// CalcMerkl3FromArray: Function;
|
|
|
|
// CalcMerkl0FromArray: Function;
|
|
|
|
// ClientHex: Function;
|
|
|
|
// CalcHash3FromArray: Function;
|
|
|
|
// CalcHashFromArray: Function;
|
|
|
|
// CalcMerklFromArray: Function;
|
|
|
|
// CalcTreeHashFromArrBody: Function;
|
|
|
|
// UpdateMerklTree: Function;
|
|
|
|
// GetMerkleProof: Function;
|
|
|
|
// CheckMerkleProof: Function;
|
|
|
|
// IsZeroArr: Function;
|
|
|
|
// GetHashWithNonce: Function;
|
|
|
|
// GetPowPower: Function;
|
|
|
|
// GetArrFromValue: Function;
|
|
|
|
// GetPowValue: Function;
|
|
|
|
// Mesh: Function;
|
|
|
|
// Encrypt: Function;
|
|
|
|
// Decrypt: Function;
|
|
|
|
// toUTF8Array: Function;
|
|
|
|
// Utf8ArrayToStr: Function;
|
|
|
|
// GetArrFromStr: Function;
|
|
|
|
// IsDeveloperAccount: Function;
|
|
|
|
// DEVELOP_PUB_KEY_ARR: Buffer[] | string[];
|
|
|
|
// DEVELOP_PUB_KEY: any;
|
|
|
|
// DEVELOP_PUB_KEY0: Buffer;
|
|
|
|
// ARR_PUB_KEY: any;
|
|
|
|
// //#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#region log-strict.ts
|
|
|
|
CheckSizeLogFile: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region log.ts
|
|
|
|
ArrLogClient: any[];
|
2019-07-13 06:33:59 +00:00
|
|
|
WEB_LOG: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
ToLogWeb: Function;
|
|
|
|
SmallAddr: Function;
|
|
|
|
ToErrorTrace: Function;
|
|
|
|
ToLogTrace: Function;
|
|
|
|
ToInfo: Function;
|
|
|
|
ToError: Function;
|
|
|
|
ToLogClient0: Function;
|
2019-07-13 06:33:59 +00:00
|
|
|
ToErrorTx: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
PrepareStatEverySecond: Function;
|
|
|
|
HASH_RATE: number;
|
|
|
|
ADD_HASH_RATE: Function;
|
|
|
|
GET_STAT: Function;
|
|
|
|
ADD_TO_STAT_TIME: Function;
|
|
|
|
ADD_TO_STAT: Function;
|
|
|
|
GET_STATDIAGRAMS: Function;
|
|
|
|
GET_STATS: Function;
|
|
|
|
StartCommonStat: Function;
|
|
|
|
ClearCommonStat: Function;
|
|
|
|
ResizeArrAvg: Function;
|
|
|
|
ResizeArrMax: Function;
|
|
|
|
TO_DEBUG_LOG: Function;
|
|
|
|
GetStrOnlyTime: Function;
|
|
|
|
GetStrTime: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region geo.ts
|
|
|
|
SetGeoLocation: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region geo.ts
|
|
|
|
WebApi2: any;
|
|
|
|
HostingCaller: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region web-process.ts
|
2019-07-12 14:46:26 +00:00
|
|
|
LoadBlockFromNetwork: (Params, F?) => any;
|
2019-07-10 04:01:15 +00:00
|
|
|
GlobalRunID: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region base.ts
|
|
|
|
glStopNode: any;
|
2019-07-10 07:59:04 +00:00
|
|
|
GetCheckAccHash: Function;
|
|
|
|
ReadHashFromBufDB: Function;
|
|
|
|
STreeBuffer: any;
|
|
|
|
TestCreateTr: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region html-server.ts
|
|
|
|
HTTPCaller: any;
|
|
|
|
DappTemplateFile: Function;
|
|
|
|
DappSmartCodeFile: Function;
|
2019-07-10 07:59:04 +00:00
|
|
|
DappClientCodeFile: Function;
|
|
|
|
SendBlockFile: Function;
|
|
|
|
SetCheckPointOnBlock: Function;
|
|
|
|
SendHTMLMap: any;
|
|
|
|
SendWebFile: Function;
|
|
|
|
GetFileHTMLWithParsing: Function;
|
|
|
|
GetFileHTMLFromMarkdown: Function;
|
|
|
|
GetFileSimple: Function;
|
|
|
|
SaveFileSimple: Function; SetSafeResponce: Function;
|
|
|
|
GetUserContext: Function;
|
|
|
|
EventNum: number;
|
|
|
|
EventMap: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
AddDappEventToGlobalMap: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region accounts.ts
|
|
|
|
HistoryDB: any;
|
2019-07-13 10:48:51 +00:00
|
|
|
// FORMAT_CREATE: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER_BODY: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER2: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER_BODY2: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER3: string;
|
|
|
|
// FORMAT_MONEY_TRANSFER_BODY3: string;
|
|
|
|
// FORMAT_ACCOUNT_HASH: string;
|
|
|
|
// FORMAT_ACCOUNT_HASH3: string;
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
2019-07-11 05:35:16 +00:00
|
|
|
// //#region block-db.ts
|
|
|
|
// BlockDB: any;
|
|
|
|
// BLOCK_HEADER_SIZE: number;
|
|
|
|
// BLOCK_HEADER_SIZE2: number;
|
|
|
|
// DB_VERSION: number;
|
|
|
|
// AddInfoChain: Function;
|
|
|
|
// AddInfoBlock: Function;
|
|
|
|
// GetNodeStrPort: Function;
|
|
|
|
// NO_CHECK_BLOCKNUM_ONSTART: number;
|
|
|
|
// //#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#region db.ts
|
2019-07-11 05:35:16 +00:00
|
|
|
//CheckStartOneProcess: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region update.ts
|
|
|
|
UpdateMode: number;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region file.ts
|
2019-07-13 10:48:51 +00:00
|
|
|
// TYPE_TRANSACTION_FILE: number;
|
|
|
|
// FORMAT_FILE_CREATE: string;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
2019-07-11 05:35:16 +00:00
|
|
|
// //#region dapp.ts
|
|
|
|
// DApps: {
|
|
|
|
// Accounts?: any,
|
|
|
|
// File?: any,
|
|
|
|
// Names?: any,
|
|
|
|
// Messager?: any,
|
|
|
|
// Smart?: any,
|
|
|
|
// };
|
|
|
|
// DAppByType: any;
|
|
|
|
// //#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
|
|
|
//#region names.ts
|
|
|
|
NAMES: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region smart.ts
|
|
|
|
TickCounter: number;
|
2019-07-13 10:48:51 +00:00
|
|
|
// TYPE_TRANSACTION_SMART_RUN: number;
|
|
|
|
// FORMAT_SMART_CREATE: string;
|
|
|
|
// FORMAT_SMART_RUN
|
|
|
|
// FORMAT_SMART_CHANGE
|
2019-07-10 04:01:15 +00:00
|
|
|
RunSmartMethod: Function;
|
|
|
|
DebugEvent: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region transaction-validator.ts
|
2019-07-10 07:59:04 +00:00
|
|
|
CurTrItem: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region connect.ts
|
|
|
|
PERIOD_FOR_RECONNECT: number;
|
|
|
|
CHECK_DELTA_TIME: any;
|
|
|
|
CHECK_POINT: any;
|
|
|
|
CODE_VERSION: any;
|
|
|
|
NET_CONSTANT: any;
|
|
|
|
START_LOAD_CODE: any;
|
|
|
|
MIN_PERIOD_PING: number;
|
|
|
|
MAX_PING_FOR_CONNECT: number;
|
|
|
|
MAX_WAIT_PERIOD_FOR_HOT: number;
|
2019-07-10 07:59:04 +00:00
|
|
|
GetGrayServerConnections: Function;
|
|
|
|
SortNodeBlockProcessCount: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region code.ts
|
2019-07-10 07:59:04 +00:00
|
|
|
RestartNode: Function;
|
|
|
|
UnpackCodeFile: Function;
|
|
|
|
//#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
2019-07-10 07:59:04 +00:00
|
|
|
//#region node.ts
|
|
|
|
SocketStatistic: Function;
|
|
|
|
GetSocketStatus: Function;
|
|
|
|
SetSocketStatus: Function;
|
|
|
|
NodeInfo: Function;
|
|
|
|
NodeName: Function;
|
|
|
|
SocketInfo: Function;
|
|
|
|
FindNodeByAddr: Function;
|
|
|
|
AddNodeInfo: Function;
|
|
|
|
socketInit: Function;
|
|
|
|
socketRead: Function;
|
|
|
|
socketWrite: Function;
|
|
|
|
CloseSocket: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region terahashlib.js
|
|
|
|
GetHashFromSeqAddr: Function;
|
|
|
|
CalcHashBlockFromSeqAddr: Function;
|
|
|
|
GetHashFromNum2: Function;
|
|
|
|
GetHashFromNum3: Function;
|
|
|
|
GetHashFromArrNum2: Function;
|
|
|
|
XORArr: Function;
|
|
|
|
GetHash: Function;
|
|
|
|
ReadUint32FromArr: Function;
|
|
|
|
ReadUintFromArr: Function;
|
|
|
|
ReadUint16FromArr: Function;
|
|
|
|
WriteUintToArr: Function;
|
|
|
|
WriteUint32ToArr: Function;
|
|
|
|
WriteUint32ToArrOnPos: Function;
|
|
|
|
WriteUint16ToArrOnPos: Function;
|
|
|
|
WriteUintToArrOnPos: Function;
|
|
|
|
WriteArrToArr: Function;
|
|
|
|
WriteArrToArrOnPos: Function;
|
|
|
|
WriteArrToArrHOnPos: Function;
|
|
|
|
ConvertBufferToStr: Function;
|
|
|
|
CopyObjValue: Function;
|
|
|
|
CopyArr: Function;
|
|
|
|
ParseNum: Function;
|
2019-07-12 14:46:26 +00:00
|
|
|
CompareArr: (a: any[], b: any[]) => number;
|
2019-07-10 04:01:15 +00:00
|
|
|
CompareArrL: Function;
|
|
|
|
shaarr2: Function;
|
|
|
|
sha3arr2: Function;
|
|
|
|
arr2: Function;
|
|
|
|
GetBlockArrFromBuffer: Function;
|
|
|
|
shaarrblock2: Function;
|
|
|
|
//#endregion
|
|
|
|
|
2019-07-10 07:59:04 +00:00
|
|
|
//#region wallet-node.js
|
|
|
|
CleanChain: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region lexer.js
|
|
|
|
LexerJS: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region coinlib.js
|
|
|
|
ADD: Function;
|
|
|
|
SUB: Function;
|
|
|
|
DIV: Function;
|
|
|
|
ISZERO: Function;
|
|
|
|
FLOAT_FROM_COIN: Function;
|
|
|
|
COIN_FROM_FLOAT: Function;
|
|
|
|
COIN_FROM_STRING: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region block-exchange.ts
|
|
|
|
CAN_START: boolean;
|
|
|
|
StrWarn: string;
|
|
|
|
SUM_LIST_LENGTH: number;
|
|
|
|
CONSENSUS_TIK_TIME: number;
|
|
|
|
CONSENSUS_CHECK_TIME: number;
|
|
|
|
PERIOD_FOR_NEXT_SEND: number;
|
|
|
|
BLOCK_DELTA_ACTIVATE: number;
|
|
|
|
TIME_END_EXCHANGE: number;
|
|
|
|
TIME_START_POW: number;
|
|
|
|
TIME_START_SAVE: number;
|
|
|
|
TIME_START_LOAD: number;
|
|
|
|
TreeBlockBuf: any;
|
|
|
|
DoTxLog: boolean;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region block-loader.ts
|
|
|
|
HistoryBlockBuf: any
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region block-loader-const.ts
|
|
|
|
PERIOD_GET_BLOCK: number;
|
|
|
|
COUNT_HISTORY_BLOCKS_FOR_LOAD: number;
|
|
|
|
COUNT_BLOCKS_FOR_CHECK_POW: number;
|
|
|
|
MAX_DELTA_COUNT_SUM_FOR_LOAD: number;
|
|
|
|
MAX_COUNT_CHAIN_LOAD: number;
|
|
|
|
PACKET_ALIVE_PERIOD: number;
|
|
|
|
PACKET_ALIVE_PERIOD_NEXT_NODE: number;
|
|
|
|
MAX_BLOCK_SEND: number;
|
|
|
|
COUNT_TASK_FOR_NODE: number;
|
2019-07-13 10:48:51 +00:00
|
|
|
// FORMAT_BLOCK_TRANSFER: string;
|
2019-07-10 07:59:04 +00:00
|
|
|
WRK_BLOCK_TRANSFER: any;
|
|
|
|
MAX_ACCOUNTS_TRANSFER: number;
|
|
|
|
MAX_SMARTS_TRANSFER: number;
|
2019-07-13 10:48:51 +00:00
|
|
|
// FORMAT_REST_TRANSFER: string;
|
|
|
|
// FORMAT_SMART_TRANSFER: string;
|
2019-07-10 07:59:04 +00:00
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region server.ts
|
|
|
|
BUF_TYPE: number;
|
|
|
|
STR_TYPE: number;
|
|
|
|
MAX_STR_BUF_DATA: number;
|
|
|
|
MAX_CONNECTION_ACTIVE: number;
|
|
|
|
STAT_PERIOD: number;
|
|
|
|
FORMAT_POW_TO_CLIENT: string;
|
|
|
|
FORMAT_POW_TO_SERVER: string;
|
|
|
|
INTERNET_IP_FROM_STUN: string;
|
|
|
|
ContextPackets: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region terahashmining.ts
|
|
|
|
CreateHashMinimal: Function;
|
|
|
|
GetNonceHashArr: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region pow-process.ts
|
|
|
|
BlockPump: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region tx-process.ts
|
|
|
|
SetStatMode: Function;
|
|
|
|
TreeFindTX
|
|
|
|
bShowDetail: number;
|
|
|
|
ClearDataBase: Function;
|
|
|
|
RewriteAllTransactions: Function;
|
|
|
|
ReWriteDAppTransactions: Function;
|
|
|
|
TXPrepareLoadRest: Function;
|
|
|
|
TXWriteAccArr: Function;
|
|
|
|
TXWriteSmartArr: Function;
|
|
|
|
TXWriteAccHash: Function;
|
|
|
|
EvalCode: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region messager.ts
|
|
|
|
MESSAGER: any;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region update.ts
|
|
|
|
RunOnUpdate: Function;
|
|
|
|
CheckRewriteTr: Function;
|
|
|
|
//#endregion
|
2019-07-10 04:01:15 +00:00
|
|
|
|
2019-07-10 07:59:04 +00:00
|
|
|
//#region transfer-msg.ts
|
|
|
|
TrName: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region rest_tables.ts
|
|
|
|
DoRest: Function;
|
|
|
|
GetRestArr: Function;
|
|
|
|
GetCurrentRestArr: Function;
|
|
|
|
GetCurrentRestNum: Function;
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
nw: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
GlobalRunMap: any;
|
|
|
|
sha3: any;
|
|
|
|
SHA3BUF: any;
|
|
|
|
shaarr: any;
|
2019-07-10 07:59:04 +00:00
|
|
|
ELECTRON: any;
|
|
|
|
TestTestWaletMode: any;
|
2019-07-18 11:22:32 +00:00
|
|
|
OnExit: any;
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|
|
|
|
interface Process {
|
|
|
|
RunRPC: Function;
|
|
|
|
}
|
2019-07-14 10:27:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
interface TeraChildProcess extends ChildProcess {
|
|
|
|
Num: number;
|
|
|
|
bOnline: boolean
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|
|
|
|
interface TeraProcess {
|
2019-07-14 10:27:58 +00:00
|
|
|
pid?: number;
|
2019-07-10 04:01:15 +00:00
|
|
|
Name: string;
|
|
|
|
idInterval: number | any;
|
|
|
|
idInterval1: number | any;
|
|
|
|
idInterval2: number | any;
|
|
|
|
LastAlive: number;
|
2019-07-14 10:27:58 +00:00
|
|
|
Worker: TeraChildProcess;
|
2019-07-10 04:01:15 +00:00
|
|
|
Path: string;
|
|
|
|
OnMessage: Function;
|
|
|
|
PeriodAlive: number;
|
2019-07-10 07:59:04 +00:00
|
|
|
RunRPC?: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|
|
|
|
interface Worker {
|
|
|
|
connected: boolean;
|
|
|
|
send: Function;
|
|
|
|
}
|
|
|
|
interface Number {
|
|
|
|
//#region library.ts:118
|
|
|
|
toStringZ: Function;
|
|
|
|
//#region
|
|
|
|
}
|
|
|
|
interface String {
|
|
|
|
right: Function;
|
|
|
|
}
|
|
|
|
interface HostingCaller {
|
|
|
|
GetCurrentInfo?: Function;
|
|
|
|
GetAccountList?: Function;
|
|
|
|
GetAccount?: Function;
|
|
|
|
GetBlockList?: Function;
|
|
|
|
GetTransactionList?: Function;
|
|
|
|
GetTransactionAll?: Function;
|
|
|
|
GetDappList?: Function;
|
|
|
|
GetNodeList?: Function;
|
|
|
|
GetAccountListByKey?: Function;
|
|
|
|
GetDappCategory?: Function;
|
|
|
|
SendTransactionHex?: Function;
|
|
|
|
DappSmartHTMLFile?: Function;
|
|
|
|
DappBlockFile?: Function;
|
|
|
|
DappInfo?: Function;
|
|
|
|
DappWalletList?: Function;
|
|
|
|
DappAccountList?: Function;
|
|
|
|
DappSmartList?: Function;
|
|
|
|
DappBlockList?: Function;
|
|
|
|
DappTransactionList?: Function;
|
|
|
|
DappStaticCall?: Function;
|
|
|
|
GetHistoryTransactions?: Function;
|
2019-07-10 07:59:04 +00:00
|
|
|
GetSupply?: Function;
|
2019-07-10 04:01:15 +00:00
|
|
|
GetTotalSupply?: Function;
|
|
|
|
}
|
2019-07-10 07:59:04 +00:00
|
|
|
interface Buffer {
|
|
|
|
Read,
|
|
|
|
Write,
|
|
|
|
len
|
|
|
|
}
|
2019-07-10 04:01:15 +00:00
|
|
|
}
|