Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
49 lines (43 loc) · 2.28 KB
/
Copy pathindex.js
File metadata and controls
49 lines (43 loc) · 2.28 KB
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
// Import modul dotenv untuk memuat variabel lingkungan
require('dotenv').config();
// Import fungsi-fungsi dari folder src
const depositFunction = require('./src/deposit');
const withdrawFunction = require('./src/withdraw');
const transferethFunction = require('./src/transfereth');
const transferdocsFunction = require('./src/transferdocs');
// Fungsi untuk menunggu beberapa milidetik
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// Fungsi untuk menjalankan operasi secara acak
async function randomOperation() {
const operations = [depositFunction, withdrawFunction, transferethFunction, transferdocsFunction];
const randomIndex = Math.floor(Math.random() * operations.length);
await operations[randomIndex]();
}
// Fungsi utama
async function main() {
console.log(`
███ ██ ██████ ██████ ███████ ██ ███ ██ ████████ ███████ ██████
████ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ █████ ██ ██ ██ ██ ██ █████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██████ ██████ ███████ ██ ██ ████ ██ ███████ ██ ██
`);
console.log('Authors : Prastian Hidayat')
for (let i = 0; i < 1000; i++) {
try {
await randomOperation();
console.log(`====================`);
console.log(`Operasi ke-${i + 1} selesai.`);
console.log(`====================`);
// Tunggu beberapa saat sebelum melakukan operasi berikutnya (5 detik)
await delay(1000);
} catch (error) {
console.error(`Error pada operasi ke-${i + 1}: ${error}`);
}
}
console.log(`Proses selesai untuk ${tx_amount} operasi.`);
}
// Panggil fungsi utama
main().catch(error => console.error(error));