-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.js
751 lines (700 loc) · 26.5 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
"use strict";
/**
########################################################
# #
# CODE : SOLIX DEPIN Bot v1.0.1 #
# NodeJs: v23.10.0 #
# Author: CMALF #
# TG : https://t.me/djagocuan #
# GH : https://github.com/cmalf #
# #
########################################################
*/
/**
* This code is open-source and welcomes contributions!
*
* If you'd like to add features or improve this code, please follow these steps:
* 1. Fork this repository to your own GitHub account.
* 2. Make your changes in your forked repository.
* 3. Submit a pull request to the original repository.
*
* This allows me to review your contributions and ensure the codebase maintains high quality.
*
* Let's work together to improve this project!
*
* P.S. Remember to always respect the original author's work and avoid plagiarism.
* Let's build a community of ethical and collaborative developers.
*/
const fs = require("fs");
const axios = require("axios");
const readline = require("readline");
const path = require("path");
const {
Colors,
CoderMark,
ProxyError,
requestWithRetry,
loadProxies,
getRandomProxy,
createProxyAgent,
maskEmail,
UnauthorizedError
} = require("./utils");
const PROXY_FILE = "./proxy.txt";
const COMMON_HEADERS = {
accept: "application/json, text/plain, */*",
"accept-language":
"id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6,zh;q=0.5"
};
// Global object to store interval IDs for each account
const accountIntervals = {};
function createAxiosInstance(accessToken, agent) {
const config = {
baseURL: "https://api.solixdepin.net/api",
headers: { ...COMMON_HEADERS },
timeout: 60000 // 60 seconds timeout
};
if (accessToken) {
config.headers["authorization"] = `Bearer ${accessToken}`;
}
if (agent) {
config.proxy = false;
config.httpAgent = agent;
config.httpsAgent = agent;
}
return axios.create(config);
}
function prompt(question) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
return new Promise((resolve) => {
rl.question(question, (answer) => {
rl.close();
resolve(answer.trim());
});
});
}
function loadAccounts() {
const accountsPath = path.join(__dirname, "accounts.txt");
if (!fs.existsSync(accountsPath)) {
console.error(
Colors.Red +
"accounts.txt file not found. Please create the file with account credentials." +
Colors.RESET
);
process.exit(1);
}
let data;
try {
data = fs.readFileSync(accountsPath, "utf8");
} catch (err) {
console.error(
Colors.Red + "Error reading accounts.txt: " + err.message + Colors.RESET
);
process.exit(1);
}
const lines = data.split(/\r?\n/).filter((line) => line && line.includes(":"));
return lines.map((line) => {
const [email, password] = line.split(":");
return { email: email.trim(), password: password.trim() };
});
}
function saveLoginData(loginData) {
try {
fs.writeFileSync(
path.join(__dirname, "DataAccount.json"),
JSON.stringify(loginData, null, 2)
);
} catch (err) {
console.error(
Colors.Red +
"Error saving DataAccount.json: " +
err.message +
Colors.RESET
);
}
}
function loadLoginData() {
const dataPath = path.join(__dirname, "DataAccount.json");
if (fs.existsSync(dataPath)) {
try {
const raw = fs.readFileSync(dataPath, "utf8");
return JSON.parse(raw);
} catch (error) {
console.error(
Colors.Red + "Error reading DataAccount.json: " + error.message + Colors.RESET
);
return null;
}
}
return null;
}
async function login(instance, account) {
try {
const response = await requestWithRetry(
() =>
instance.post(
"/auth/login-password",
{
email: account.email,
password: account.password
},
{
headers: { "content-type": "application/json" }
}
),
`login for ${account.email}`
);
if (response.data && response.data.result === "success") {
return response.data.data;
} else {
console.error(
Colors.Red +
"Login failed for: " +
account.email +
Colors.RESET
);
return null;
}
} catch (error) {
console.error(
Colors.Red +
"Error during login for " +
account.email +
": " +
error.message +
Colors.RESET
);
return null;
}
}
async function getConnectionQuality(instance) {
const response = await requestWithRetry(
() => instance.get("/point/get-connection-quality"),
`${Colors.RESET}get Connection Quality`
);
return response.data.data;
}
async function getProfile(instance) {
const response = await requestWithRetry(
() => instance.get("/auth/profile"),
`${Colors.RESET}get Profile`
);
return response.data.data;
}
async function getTotalPoint(instance) {
const response = await requestWithRetry(
() => instance.get("/point/get-total-point"),
`${Colors.RESET}get Total Point`
);
return response.data.data;
}
async function getUserTask(instance) {
const response = await requestWithRetry(
() => instance.get("/task/get-user-task"),
`${Colors.RESET}get User Task`
);
return response.data.data;
}
async function doTask(instance, taskId) {
const response = await requestWithRetry(
() =>
instance.post(
"/task/do-task",
{ taskId },
{
headers: { "content-type": "application/json" }
}
),
`do task ${taskId}`
);
return response.data;
}
async function claimTask(instance, taskId) {
const response = await requestWithRetry(
() =>
instance.post(
"/task/claim-task",
{ taskId },
{
headers: { "content-type": "application/json" }
}
),
`claim task ${taskId}`
);
return response.data;
}
async function reLogin(accounts, agent) {
const newLoginData = [];
const existingLoginData = loadLoginData() || []; // Load existing data
const updatedLoginData = [...existingLoginData]; // Start with existing data
const delayMilliseconds = 30000; // Delay of 30 seconds between logins
for (let i = 0; i < accounts.length; i++) {
const account = accounts[i];
const maskedEmail = maskEmail(account.email);
console.log(
`${Colors.Teal}]> ${Colors.Yellow}Attempting re-login for ${Colors.Blue}${maskedEmail}... ${Colors.RESET}`
);
const tempInstance = createAxiosInstance(null, agent);
const data = await login(tempInstance, account);
if (data && data.accessToken) {
const newAccountInfo = {
email: account.email,
userId: data.user ? data.user._id : "unknown",
accessToken: data.accessToken
};
newLoginData.push(newAccountInfo);
// Update existing data or add new if not found
const index = updatedLoginData.findIndex(item => item.email === account.email);
if (index !== -1) {
updatedLoginData[index] = newAccountInfo;
} else {
updatedLoginData.push(newAccountInfo);
}
console.log(
`${Colors.Teal}]> ${Colors.Green}Re-login successful for ${Colors.Blue}${maskedEmail}${Colors.RESET}`
);
} else {
console.error(
`${Colors.Teal}]> ${Colors.Red}Re-login failed for ${Colors.Blue}${maskedEmail}${Colors.RESET}`
);
// If re-login fails, ensure the account is removed from the updated data
const index = updatedLoginData.findIndex(item => item.email === account.email);
if (index !== -1) {
updatedLoginData.splice(index, 1);
}
}
if (i < accounts.length - 1) {
console.log(
`${Colors.Teal}]> ${Colors.Gold}Waiting for ${delayMilliseconds / 1000} seconds before the next login...${Colors.RESET}`
);
await new Promise((resolve) => setTimeout(resolve, delayMilliseconds));
}
}
saveLoginData(updatedLoginData); // Save the updated login data
return newLoginData;
}
async function runMiningPoints(accountData, agent, allAccounts) {
const masked = maskEmail(accountData.email);
console.log(
`\n${Colors.Teal}]> ${Colors.Gold}Processing Account: ${Colors.Blue}${masked}${Colors.RESET}`
);
const instance = createAxiosInstance(accountData.accessToken, agent);
try {
console.log(
`${Colors.Teal}]> ${Colors.RESET}Login Status: ${Colors.Green}Logged In${Colors.RESET}`
);
const profile = await getProfile(instance);
if (!profile) {
console.error(
Colors.Red + "Failed to fetch profile for: " + masked + Colors.RESET
);
return;
}
const earningColor = profile.isEarning ? Colors.Green : Colors.Red;
console.log(
`${Colors.Teal}]> ${Colors.Blue}${masked} ${Colors.RESET}isEarning: ${earningColor}${profile.isEarning}${Colors.RESET}`
);
const initialTotalPointData = await getTotalPoint(instance);
if (initialTotalPointData) {
console.log(`${Colors.Teal}]> ${Colors.Blue}${masked} ${Colors.RESET}Points:`);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPoint : ${Colors.Cyan}${initialTotalPointData.total}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPointInternet : ${Colors.Cyan}${initialTotalPointData.totalPointInternet}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPointTask : ${Colors.Cyan}${initialTotalPointData.totalPointTask}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalReferralPoint : ${Colors.Cyan}${initialTotalPointData.totalReferralPoint}${Colors.RESET}`
);
}
const initialCQ = await getConnectionQuality(instance);
if (initialCQ !== null) {
console.log(
`${Colors.Teal}]> ${Colors.RESET}Connection Quality: ${Colors.Teal}${initialCQ}${Colors.RESET}`
);
}
const cqIntervalId = setInterval(async () => {
try {
const connectionQuality = await getConnectionQuality(instance);
if (connectionQuality !== null) {
console.log(
`${Colors.Teal}]> ${Colors.RESET}Connection Quality ${Colors.Blue}${masked} : ${Colors.Teal}${connectionQuality}${Colors.RESET}`
);
}
} catch (error) {
if (error instanceof UnauthorizedError) {
console.log(
Colors.Yellow +
`Unauthorized error in connection quality check for ${masked}. Triggering re-login for this account.` +
Colors.RESET
);
clearInterval(cqIntervalId);
clearInterval(pointIntervalId);
delete accountIntervals[accountData.email]; // Remove intervals
const accountInfo = allAccounts.find(
(acc) => acc.email === accountData.email
);
const loggedInAccount = await reLogin([accountInfo], agent);
if (loggedInAccount && loggedInAccount.length > 0) {
accountData.accessToken = loggedInAccount[0].accessToken;
console.log(
Colors.Green +
`Re-login successful for ${masked}. Restarting mining.` +
Colors.RESET
);
runMiningPoints(accountData, agent, allAccounts);
} else {
console.error(
Colors.Red +
`Re-login failed for ${masked}. Mining will not be restarted for this account.` +
Colors.RESET
);
}
} else {
console.error(
Colors.Red +
`Error during connection quality interval for ${masked}: ` +
error.message +
Colors.RESET
);
}
}
}, 30000);
const pointIntervalId = setInterval(async () => {
try {
const totalPointData = await getTotalPoint(instance);
if (totalPointData) {
console.log(`\n${Colors.Teal}]> ${Colors.Blue}${masked} ${Colors.RESET}Points Update:`);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPoint : ${Colors.Cyan}${totalPointData.total}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPointInternet : ${Colors.Cyan}${totalPointData.totalPointInternet}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalPointTask : ${Colors.Cyan}${totalPointData.totalPointTask}${Colors.RESET}`
);
console.log(
`${Colors.Gold}[+] ${Colors.RESET}totalReferralPoint : ${Colors.Cyan}${totalPointData.totalReferralPoint}${Colors.RESET}`
);
}
} catch (error) {
if (error instanceof UnauthorizedError) {
console.log(
Colors.Yellow +
`Unauthorized error in point update for ${masked}. Triggering re-login for this account.` +
Colors.RESET
);
clearInterval(cqIntervalId);
clearInterval(pointIntervalId);
delete accountIntervals[accountData.email]; // Remove intervals
const accountInfo = allAccounts.find(
(acc) => acc.email === accountData.email
);
const loggedInAccount = await reLogin([accountInfo], agent);
if (loggedInAccount && loggedInAccount.length > 0) {
accountData.accessToken = loggedInAccount[0].accessToken;
console.log(
Colors.Green +
`Re-login successful for ${masked}. Restarting mining.` +
Colors.RESET
);
runMiningPoints(accountData, agent, allAccounts);
} else {
console.error(
Colors.Red +
`Re-login failed for ${masked}. Mining will not be restarted for this account.` +
Colors.RESET
);
}
} else {
console.error(
Colors.Red +
`Error during point update interval for ${masked}: ` +
error.message +
Colors.RESET
);
}
}
}, 600000);
// Store interval IDs for later clearance if necessary.
accountIntervals[accountData.email] = { cqIntervalId, pointIntervalId };
} catch (error) {
if (error instanceof UnauthorizedError) {
console.log(
Colors.Yellow +
`Unauthorized error for ${masked}. Triggering re-login for this account.` +
Colors.RESET
);
if (accountIntervals[accountData.email]?.cqIntervalId) clearInterval(accountIntervals[accountData.email].cqIntervalId);
if (accountIntervals[accountData.email]?.pointIntervalId) clearInterval(accountIntervals[accountData.email].pointIntervalId);
delete accountIntervals[accountData.email]; // Remove intervals
const accountInfo = allAccounts.find(
(acc) => acc.email === accountData.email
);
const loggedInAccount = await reLogin([accountInfo], agent);
if (loggedInAccount && loggedInAccount.length > 0) {
accountData.accessToken = loggedInAccount[0].accessToken;
console.log(
Colors.Green +
`Re-login successful for ${masked}. Restarting mining.` +
Colors.RESET
);
runMiningPoints(accountData, agent, allAccounts);
} else {
console.error(
Colors.Red +
`Re-login failed for ${masked}. Mining will not be restarted for this account.` +
Colors.RESET
);
}
} else {
console.error(
Colors.Red +
`Error processing account ${masked}: ` +
error.message +
Colors.RESET
);
}
}
}
async function completeTasks(accountData, agent) {
const masked = maskEmail(accountData.email);
console.log(
`\n${Colors.Teal}]> ${Colors.Gold}Processing Tasks for Account: ${Colors.Blue}${masked}${Colors.RESET}`
);
const instance = createAxiosInstance(accountData.accessToken, agent);
let tasks;
try {
tasks = await getUserTask(instance);
} catch (error) {
console.error(
Colors.Red +
`Error fetching tasks for ${masked}: ` +
error.message +
Colors.RESET
);
return;
}
if (!tasks || tasks.length === 0) {
console.log(
Colors.Yellow +
"No tasks available for account: " +
masked +
Colors.RESET
);
return;
}
for (const task of tasks) {
try {
const result = await doTask(instance, task._id);
if (result) {
console.log(
`${Colors.Teal}]> ${Colors.Green}Task Completed: ${task.name} (ID: ${task._id})${Colors.RESET}`
);
// Attempt to claim the task after successful completion
try {
const claimResult = await claimTask(instance, task._id);
if (claimResult && claimResult.result === 'success') {
console.log(
`${Colors.Teal}]> ${Colors.Cyan}Task Claimed: ${task.name} (ID: ${task._id})${Colors.RESET}`
);
// You might want to log or process the claimResult further
} else {
console.log(
`${Colors.Teal}]> ${Colors.Yellow}Could not claim task: ${task.name} (ID: ${task._id})${Colors.RESET}`,
claimResult ? claimResult : '' // Log claimResult if available
);
}
} catch (claimError) {
console.error(
Colors.Red +
`Error claiming task ${task.name} for ${masked}: ` +
claimError.message +
Colors.RESET
);
}
} else {
console.log(
`${Colors.Teal}]> ${Colors.Red}Cannot complete task: ${task.name} (ID: ${task._id})${Colors.RESET}`
);
}
} catch (error) {
console.error(
Colors.Red +
`Error completing task ${task.name} for ${masked}: ` +
error.message +
Colors.RESET
);
}
}
}
function clearAllIntervals() {
for (const email in accountIntervals) {
if (accountIntervals[email].cqIntervalId) {
clearInterval(accountIntervals[email].cqIntervalId);
console.log(
Colors.Yellow +
`Cleared connection quality interval for ${maskEmail(email)}` +
Colors.RESET
);
}
if (accountIntervals[email].pointIntervalId) {
clearInterval(accountIntervals[email].pointIntervalId);
console.log(
Colors.Yellow +
`Cleared point update interval for ${maskEmail(email)}` +
Colors.RESET
);
}
delete accountIntervals[email];
}
}
async function main() {
// Load proxy configuration and create a proxy agent if proxies exist.
const proxyList = loadProxies(PROXY_FILE);
let agent = null;
if (proxyList.length > 0) {
const selectedProxy = getRandomProxy(proxyList);
try {
agent = await createProxyAgent(selectedProxy);
// Uncomment for debugging proxy usage:
// console.log(Colors.Cyan + "Using Proxy: " + selectedProxy + Colors.RESET);
} catch (proxyError) {
console.error(
Colors.Red +
"Proxy error: " +
proxyError.message +
". Proceeding without proxy." +
Colors.RESET
);
}
} else {
console.log(
Colors.Yellow +
"No proxies provided in proxy.txt. Proceeding without proxy." +
Colors.RESET
);
}
const allAccounts = loadAccounts();
let loginData = loadLoginData();
if (loginData && Array.isArray(loginData) && loginData.length > 0) {
const answer = await prompt(
`\n${Colors.Teal}]> ${Colors.Neon}accessToken Already Exists, \n${Colors.Teal}]> ${Colors.RESET}Do You Want to Use It or Create a New One by Re-Login? \n${Colors.Teal}]> ${Colors.Green}Type ${Colors.Neon}> ${Colors.RESET}(use/relogin): `
);
if (answer.toLowerCase() === "relogin") {
loginData = await reLogin(allAccounts, agent);
}
} else {
loginData = await reLogin(allAccounts, agent);
}
// Display menu options.
console.clear();
CoderMark();
console.log(`\n${Colors.Gold}Menu:${Colors.RESET}\n`);
console.log(`${Colors.Gold}1. ${Colors.RESET}Run Mining Points`);
console.log(`${Colors.Gold}2. ${Colors.RESET}Complete tasks`);
console.log(`${Colors.Gold}3. ${Colors.Red}Exit${Colors.RESET}\n`);
const choice = await prompt(`${Colors.RESET}Enter your choice (1 or 3): `);
if (choice === "1") {
console.clear();
CoderMark();
const runningMining = new Set(); // Track accounts being processed
// Process mining points concurrently for each account.
for (const accountData of loginData) {
if (!runningMining.has(accountData.email)) {
runningMining.add(accountData.email);
runMiningPoints(accountData, agent, allAccounts);
}
}
} else if (choice === "2") {
console.clear();
CoderMark();
// comment this if you want to use loop
// Complete tasks sequentially for each account.
for (const accountData of loginData) {
await completeTasks(accountData, agent);
}
// For Loop (bug) uncomment the code below
// // Complete tasks sequentially for each account.
// console.log(`${Colors.Yellow}Running task completion in a continuous loop. Press Ctrl+C to stop.${Colors.RESET}`);
// while (true) {
// for (const accountData of loginData) {
// await completeTasks(accountData, agent);
// // Optional: Add a delay between processing accounts or iterations
// await new Promise(resolve => setTimeout(resolve, 5000)); // Delay of 5 second
// }
// // Optional: Add a delay between full iterations of all accounts
// await new Promise(resolve => setTimeout(resolve, 5000)); // Delay of 5 seconds
// }
} else if (choice === "3") {
console.clear();
CoderMark();
console.log(
`${Colors.Red}Exiting the application. Goodbye!${Colors.RESET}`
);
process.exit(0);
} else {
console.log(Colors.Red + "Invalid choice. Exiting." + Colors.RESET);
process.exit(1);
}
}
// Clear console and start the application.
console.clear();
CoderMark();
main().catch((err) => {
console.error(
Colors.Red +
"An unexpected error occurred: " +
err.message +
Colors.RESET
);
process.exit(1);
});
// Handle Ctrl+C (SIGINT) event.
process.on("SIGINT", () => {
console.log(
Colors.Yellow + "\nExiting... Clearing intervals..." + Colors.RESET
);
clearAllIntervals();
process.exit(0);
});
// Handle process "beforeExit" event.
process.on("beforeExit", (code) => {
console.log(
Colors.Yellow +
`\nProcess exiting with code: ${code}. Clearing intervals...` +
Colors.RESET
);
clearAllIntervals();
});
// Handle uncaught exceptions.
process.on("uncaughtException", (err) => {
console.error(Colors.Red + "Uncaught Exception:", err + Colors.RESET);
console.log(
Colors.Yellow +
"Clearing intervals before exiting due to exception..." +
Colors.RESET
);
clearAllIntervals();
process.exit(1);
});
// Handle unhandled promise rejections.
process.on("unhandledRejection", (reason, promise) => {
console.error(
Colors.Red + "Unhandled Rejection at:", promise, "reason:", reason + Colors.RESET
);
console.log(
Colors.Yellow +
"Clearing intervals before exiting due to rejection..." +
Colors.RESET
);
clearAllIntervals();
process.exit(1);
});