-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebminer.html
411 lines (386 loc) · 19 KB
/
webminer.html
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
<!DOCTYPE html>
<html>
<head>
<!-- Browser standards -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Duino-Coin | Web Miner</title>
<!-- SEO Stuff -->
<meta name="description" content="Duino-Coin Web Miner">
<meta name="keywords" content="miner, webminer, duinocoin, duco, duco webminer, web miner">
<link rel="canonical" href="http://51.15.127.80/webminer.html">
<meta name="robots" content="index, follow">
<meta name="theme-color" content="#f0932b">
<!-- Open Graph Metadata -->
<meta property="og:site_name" content="Duino-Coin Web Miner">
<meta property="og:site" content="http://51.15.127.80/webminer.html">
<meta property="og:title" content="Duino-Coin Web Miner">
<meta property="og:description" content="Duino-Coin Web Miner">
<meta property="og:image" content="https://github.com/revoxhere/duino-coin/blob/master/Resources/WebMiner.png?raw=true">
<meta property="og:url" content="http://51.15.127.80/webminer.html">
<meta property="og:type" content="website">
<!-- Twitter Metadata -->
<meta name="twitter:title" content="Duino-Coin Web Miner">
<meta name="twitter:description" content="Duino-Coin Web Miner">
<meta name="twitter:image" content="https://github.com/revoxhere/duino-coin/blob/master/Resources/WebMiner.png?raw=true">
<meta name="twitter:site" content="@CoinDuino">
<meta name="twitter:creator" content="@CoinDuino">
<link rel="icon" href="https://github.com/revoxhere/duino-coin/blob/master/Resources/WebMiner.png?raw=true" type="image/png">
<link rel="shortcut icon" href="https://github.com/revoxhere/duino-coin/blob/master/Resources/WebMiner.png?raw=true" type="image/png">
<!-- Preload Background Images -->
<link rel="preload" as="image" href="backgrounds/1-min.png">
<link rel="preload" as="image" href="backgrounds/2-min.png">
<link rel="preload" as="image" href="backgrounds/3-min.png">
<link rel="preload" as="image" href="backgrounds/4-min.png">
<link rel="preload" as="image" href="backgrounds/5-min.png">
<link rel="preload" as="image" href="backgrounds/6-min.jpg">
<link rel="preload" as="image" href="backgrounds/7-min.png">
<link rel="preload" as="image" href="backgrounds/8-min.png">
<link rel="preload" as="image" href="backgrounds/9-min.png">
<!-- Bulma -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bulma-pageloader.min.css">
<style>
.is-primary {
/* Override Bulmas primary color to Duco-Colored gradient*/
background: linear-gradient(160deg, #e74c3c, #f39c12) !important;
}
body {
background-size: cover !important;
background-attachment: fixed !important;
width: 100% !important;
height: 500vh !important;
margin: 0 !important;
padding: 0 !important;
background-repeat: no-repeat !important;
}
</style>
<!-- Font Awesome and jQuery-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js" integrity="sha512-RXf+QSDCUQs5uwRKaDoXt55jygZZm2V++WUZduaU/Ui/9EGp3f/2KZVahFZBKGH0s774sd3HmrhUy+SgOFQLVQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.slim.min.js" integrity="sha512-6ORWJX/LrnSjBzwefdNUyLCMTIsGoNP6NftMy2UAm1JBm6PRZCO1d7OHBStWpVFZLO+RerTvqX/Z9mBFfCJZ4A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<script>
/* GLOBAL JS */
window.addEventListener('load', function ()
{
let clickcount = 0;
// RANDOM BACKGROUND
const bg_list = [
'backgrounds/1-min.png',
'backgrounds/2-min.png',
'backgrounds/3-min.png',
'backgrounds/4-min.png',
'backgrounds/5-min.png',
'backgrounds/6-min.jpg',
'backgrounds/7-min.png',
'backgrounds/8-min.png',
'backgrounds/9-min.png'
]
let num = Math.floor(Math.random() * bg_list.length)
document.body.background = bg_list[num];
document.getElementById('darkmode').onclick = function()
{
clickcount++;
if (clickcount % 2 == 1)
{
$('head').append('<link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark">');
}
if (clickcount % 2 == 0)
{
$('head').append('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">');
}
}
});
</script>
<body>
<div id="pageloader" class="pageloader is-active is-primary is-bottom-to-top">
<span class="title">Duino-Coin Web Miner</span>
</div>
<div class="container">
<section class="container">
<div class="hero-body">
<div class="box">
<p class="title">
<img class="icon is-medium" src="https://github.com/revoxhere/duino-coin/blob/master/Resources/WebMiner.png?raw=true">
Duino-Coin Web Miner
</p>
<p class="subtitle">
Official JavaScript miner v2.6.1
<span class="subtitle is-size-6">
by
<a href="https://github.com/revoxhere/">revox</a>,
<a href="https://github.com/LDarki">LDarki</a>
&
<a href="https://github.com/sys-256">sys-256</a>
<span class="has-text-grey">
<br>2020-2021 the Duino-Coin project, distributed under the
<a href="https://opensource.org/licenses/MIT">
MIT license
</a>
<br>This page is open-source - you can improve it
<a href="https://github.com/revoxhere/playground">
here
</a>
</span>
</span>
</p>
<p class="subtitle has-text-info is-size-6">
<i class="fa fa-info-circle"></i>
Make sure you stay on the website during mining - most browsers suspend execution of JavaScript
when tab isn't active
</p>
<form>
<div class="columns">
<div class="column">
<div class="control has-icons-left">
<input class="input has-icons" type="text" id="usernameinput" placeholder="DUCO Username" name="username">
<span class="icon is-left">
<i class="fa fa-user"></i>
</span>
</div>
</div>
<div class="column">
<div class="control has-icons-left">
<input class="input has-icons" type="text" id="threadsinput" placeholder="Amount of threads" name="threads">
<span class="icon is-left">
<i class="fa fa-microchip"></i>
</span>
</div>
</div>
<div class="column">
<div class="control has-icons-left">
<input class="input has-icons" type="text" id="riginput" placeholder="Rig name (optional)" name="rigid">
<span class="icon is-left">
<i class="fa fa-comment"></i>
</span>
</div>
</div>
<div class="column">
<button type="submit" class="button is-link" id="minebuttonclass">
<span id="minebutton">Start mining</span>
</button>
</div>
</div>
</form>
<div class="columns">
<div class="column">
<div class="box">
<p class="subtitle">
<i class="fa fa-check fa-fw" style="color:#6ab04c;"></i>
ACCEPTED SHARES
</p>
<p class="title">
<span id="shares">
0/0
</span>
<span class="subtitle" id="sharesperc">
(0%)
</span>
</p>
</div>
</div>
<div class="column">
<div class="box">
<p class="subtitle">
<i class="fa fa-tachometer-alt fa-fw" style="color:#eb4d4b;"></i>
HASHRATE (of last share)
</p>
<p class="title">
<span id="hashrate">
0 kH/s
</span>
<span class="subtitle" id="time">
0 s
</span>
</p>
</div>
</div>
<div class="column">
<div class="box">
<p class="subtitle">
<i class="fa fa-clock fa-fw" style="color:#f0932b;"></i>
ELAPSED TIME
</p>
<p class="title">
<span data-chronometer>
00:00:00
</span>
</p>
</div>
</div>
</div>
<div class="columns">
<div class="column">
<div class="box">
<p class="subtitle">
<i class="fa fa-list fa-fw" style="color:#f39c12;"></i>
MINER LOG
</p>
<div id="minerlog-scroll-down" style="overflow-y: scroll; word-wrap: break-word; max-height: 9rem;">
<span class="has-text-grey" id="minerlog">Awaiting input...<br><br></span>
</div>
</div>
</div>
</div>
<div class="buttons is-centered">
<button id="darkmode" class="button is-secondary">
<i class="fa fa-fw fa-sun is-small icon"></i>
<span>Switch theme</span>
</button>
<a href="https://wallet.duinocoin.com" class="button is-secondary">
<i class="icon is-small fa fa-wallet" style="color:#f39c12"></i>
<span>Web Wallet</span>
</a>
<a href="https://github.com/revoxhere/duino-coin" class="button is-secondary">
<i class="fab fa-fw fa-github icon is-small"></i>
<span>GitHub</span>
</a>
<a href="https://duinocoin.com" class="button is-secondary">
<img class="icon is-small" src="https://github.com/revoxhere/duino-coin/blob/master/Resources/duco.png?raw=true">
<span>Duino-Coin</span>
</a>
<a href="https://bulma.io" class="button is-secondary">
<span>Made with</span>
<img class="image" width="16em" src="https://seeklogo.com/images/B/bulma-logo-45B5145BF4-seeklogo.com.png" alt="Bulma">
<span><b>BULMA</b></span>
</a>
</div>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle has-text-centered" style="display:block" data-ad-client="ca-pub-4670059148424169" data-ad-slot="4687652378" data-ad-format="horizontal" data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</section>
</div>
</body>
</html>
<script>
let pageloader = document.getElementById("pageloader"); // PAGE LOAGER
pageloader.setAttribute('class', "pageloader is-active is-primary is-bottom-to-top"); // Before page is loaded
window.addEventListener('load', function()
{
pageloader.setAttribute('class', "pageloader is-primary is-bottom-to-top"); // After page is loaded
});
//gets the username, rigid and amount of threads from the url parameters
var url = new URL(window.location);
var username = url.searchParams.get("username");
var rigid = url.searchParams.get("rigid");
let threads = url.searchParams.get("threads");
if (rigid === "")
{
rigid = "None"; //sets the rigid variable to "None", if the user didn't specify one
}
let userThreads = navigator.hardwareConcurrency; //lets userThreads be the amount of threads the user has
if (threads === "")
{
threads = userThreads; //sets the threads variable to the threads the user has if it didn't gave a number
}
if (username != null && username != "" && username != undefined)
{
document.getElementById("minebutton").innerHTML = "<i class='fa fa-cogs fa-fw'></i> Mining started";
document.getElementById("minebuttonclass").style = "background-color: #b8e994;";
document.getElementById("usernameinput").value = username;
document.getElementById("riginput").value = rigid;
document.getElementById("threadsinput").value = threads;
(adsbygoogle = window.adsbygoogle || []).push({});
//borrowed from waynegraham (https://gist.github.com/waynegraham/5766565), and modified it a bit
minerlog = function(message)
{
$('#minerlog').append(message);
}
function getTime()
{
let date = new Date();
let h = date.getHours();
let m = date.getMinutes();
let s = date.getSeconds();
h = (h < 10) ? "0" + h : h;
m = (m < 10) ? "0" + m : m;
s = (s < 10) ? "0" + s : s;
return h + ":" + m + ":" + s;
}
let workerVer = 0;
let sharesCorrect = 0;
let totalShares = 0;
let hours = `00`,
minutes = `00`,
seconds = `00`;
let chronometer = setInterval(function()
{
seconds++
if (seconds < 10){seconds = `0` + seconds}
if (seconds > 59)
{
seconds = `00`;
minutes++;
if (minutes < 10){minutes = `0` + minutes}
}
if (minutes > 59)
{
minutes = `00`;
hours++;
if (hours < 10){hours = `0` + hours}
}
document.querySelector("[data-chronometer]").innerHTML = `${hours}:${minutes}:${seconds}`;
}, 1000);
//makes sure the user gives a valid number
if (threads < 1)
{
threads = 1;
}
//makes sure the user doesn't make more then 50 workers
if (threads > 50)
{
threads = 50;
}
//makes sure the user doesn't give the miner more threads then it actually has
if (threads > userThreads)
{
minerlog(`${getTime()} | ` + "You gave up more threads then you have. You are now using " + userThreads + " threads instead of " + threads + ".<br><br>");
console.log(`${getTime()} | ` + "You gave up more threads then you have. You are now using " + userThreads + " threads instead of " + threads + ".");
threads = userThreads;
}
//makes threads amount of workers (so if threads is 6, it will make 6 workers)
for (let workersAmount = 0; workersAmount < threads; workersAmount++)
{
var socketWorker = new Worker("js/webminer/worker.js"); //creates the worker
socketWorker.postMessage('Start,' + username + "," + rigid + ","+ workerVer); //passes the start command, username, rigid and worker version to the worker
workerVer++; //adds one to workerVer, so you will get CPU0, CPU1, CPU2 etc.
//executes when the worker sends a message
socketWorker.onmessage = function(event)
{
const data = event.data.split(","); //splits the data so you can use data[1] etc.
if (data[0] == "UpdateLog")
{
minerlog(data[1]);
document.getElementById("minerlog-scroll-down").scrollTop = document.getElementById("minerlog-scroll-down").scrollHeight;
}
else if (data[0] == "UpdateHashrate")
{
document.getElementById("time").innerHTML = parseInt(data[1]) + " s";
document.getElementById("hashrate").innerHTML = parseFloat(data[2] / 1000).toFixed(2) + " kH/s";
}
else if (data[0] == "GoodShare")
{
totalShares++;
sharesCorrect++;
document.getElementById("shares").innerHTML = sharesCorrect + "/" + totalShares;
document.getElementById("sharesperc").innerHTML = " (" + (sharesCorrect / totalShares * 100).toFixed(2) + "%)";
}
else if (data[0] == "BadShare")
{
totalShares++;
document.getElementById("shares").innerHTML = sharesCorrect + "/" + totalShares;
document.getElementById("sharesperc").innerHTML = " (" + (sharesCorrect / totalShares * 100).toFixed(2) + "%)";
}
else if (data[0] == "Error")
{
document.getElementById("minebutton").innerHTML = "<i class='fa fa-times fa-fw'></i> Incorrect username";
document.getElementById("minebuttonclass").style = "background-color: #c0392b;";
}
}
}
}
</script>