From b25f1c7fbac972f621c5f634452c5be28e4be539 Mon Sep 17 00:00:00 2001 From: sunk818 Date: Sun, 29 Oct 2017 19:32:13 -0700 Subject: [PATCH 001/367] Update README.md grammar, spelling, formatting --- README.md | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index fe4be07..d80fe52 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # xmr-node-proxy -Setup Instructions -================== +## Setup Instructions Based on a clean Ubuntu 16.04 LTS minimal install -Deployment via Installer ------------------------- +## Deployment via Installer 1. Create a user 'nodeproxy' and assign a password (or add an SSH key. If you prefer that, you should already know how to do it) @@ -49,40 +47,41 @@ or using the pm2 monitor pm2 monit ``` -Known Issues -============ -VM's with 512Mb of ram or less will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew some serious memory during compile. In regards to this, one of our users has put together a guide for T2.Micro servers: https://docs.google.com/document/d/1m8E4_pDwKuFo0TnWJaO13LDHqOmbL6YrzyR6FvzqGgU (Credit goes to MayDay30 for his work with this!) +## Known Issues + +VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew through some serious memory during compile. In regards to this, one of our users has put together a guide for T2.Micro servers: https://docs.google.com/document/d/1m8E4_pDwKuFo0TnWJaO13LDHqOmbL6YrzyR6FvzqGgU (Credit goes to MayDay30 for his work with this!) If not running on an Ubuntu 16.04 system, please make sure your kernel is at least 3.2 or higher, as older versions will not work for this. -Many smaller VM's come with Ulimits set very low, we suggest looking into how to tweak the ulimits for your systems higher. In particular nofile (Number of files open) needs to be raised for high-usage instances. +Many smaller VMs come with ulimits set very low. We suggest looking into setting the ulimit higher. In particular, `nofile` (Number of files open) needs to be raised for high-usage instances. -If your system doesn't have AES-NI, then it will throw an error during the node-multi-hashing install, as this is AES-NI required. If this is the case, go ahead and change the following line: +If your system doesn't have AES-NI, then it will throw an error during the node-multi-hashing install, as this requires AES-NI. If this is the case, go ahead and change the following line: "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git", to: "multi-hashing": "git://github.com/clintar/node-multi-hashing.git#Nan-2.0", -In your packages.json, then do a npm install, and it should pass. +In your `packages.json`, do a `npm install`, and it should pass. + + +## Performance + +The proxy gains a massive boost over a basic pool by accepting that the majority of the hashes submitted _will_ not be valid (does not exceed the required difficulty of the pool). Due to this, the proxy doesn't bother with attempting to validate the hash state nor value until the share difficulty exceeds the pool difficulty. -Performance -=========== -The proxy gains a massive boost over a basic pool, by accepting that the majority of the hashes submitted /will/ not be valid, as they do not exceed the required difficulty of the pool. Due to this the proxy really doesn't bother attempting to validate the hash state and/or value until the difficulty of the share exceeds the difficulty set by the pool. +In testing, we've seen AWS t2.micro instances take upwards of 2k connections, while t2.small taking 6k. The proxy is extremely light weight, and while there are more features on the way, it's our goal to keep the proxy as light weight as possible. -In testing, we've seen AWS T2.Micro instances taking upwards of 2k connections, with T2.Smalls taking 6k. The proxy is extremely light weight, and while there are more features on the way, it's our goal to keep the proxy as light weight as possible. +## Configuration Guidelines -Configuration Guidelines -======================== Please check the [wiki](https://github.com/Snipa22/xmr-node-proxy/wiki/config_review) for information on configuration +## Developer Donations + +The proxy is pre-configured for a 1% donation. This is easily toggled inside of it's configuration. If you'd like to make a one time donation, the addresses are as follows: -Developer Donations -=================== -The proxy comes configured for a 1% donation, this is easily toggled inside of it's configuration. If you'd like to make a one time donation, the addresses are as follows: * XMR - 44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr * BTC - 114DGE2jmPb5CP2RGKZn6u6xtccHhZGFmM -Installation/Configuration Assistance -===================================== +## Installation/Configuration Assistance + If you need help installing the pool from scratch, please have your servers ready, which would be Ubuntu 16.04 servers, blank and clean, DNS records pointed. These need to be x86_64 boxes with AES-NI Available. Installation asstiance is 4 XMR, with a 2 XMR deposit, with remainder to be paid on completion. @@ -92,8 +91,8 @@ SSH access with a sudo-enabled user will be needed for installs, preferably the Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode.net in #monero-pools -Known Working Pools -=================== +## Known Working Pools + * [XMRPool.net](https://xmrpool.net) * [supportXMR.com](https://supportxmr.com) * [pool.xmr.pt](https://pool.xmr.pt) From a2e4f56cbf2ff69dcabacce5be04b4cfefa1b4cc Mon Sep 17 00:00:00 2001 From: "J. Meister" Date: Wed, 13 Dec 2017 00:25:19 +0100 Subject: [PATCH 002/367] Please add SECUmine.net pool XMR mining pool with support for xmr-node-proxy --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d80fe52..ff76ef5 100644 --- a/README.md +++ b/README.md @@ -104,5 +104,6 @@ Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode. * [xmr.p00ls.net](https://www.p00ls.net) * [MoriaXMR.com](https://moriaxmr.com) * [MoneroOcean.stream](https://moneroocean.stream) +* [SECUmine.net](https://secumine.net) If you'd like to have your pool added, please make a pull request here, or contact Snipa on IRC! From 8fe221e449223f407205a22c1da8a5c0607e1a76 Mon Sep 17 00:00:00 2001 From: sunxfof <5805291@qq.com> Date: Sat, 23 Dec 2017 22:21:22 +0800 Subject: [PATCH 003/367] Update README.md add new supporting pool --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff76ef5..7c0036a 100644 --- a/README.md +++ b/README.md @@ -105,5 +105,5 @@ Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode. * [MoriaXMR.com](https://moriaxmr.com) * [MoneroOcean.stream](https://moneroocean.stream) * [SECUmine.net](https://secumine.net) - +* [Chinaenter.cn](http://xmr.chinaenter.cn) If you'd like to have your pool added, please make a pull request here, or contact Snipa on IRC! From 9b4bf44d0f4db9c9d5d023dcefdb495c8e64abba Mon Sep 17 00:00:00 2001 From: Snipa22 Date: Fri, 26 Jan 2018 21:30:26 -0800 Subject: [PATCH 004/367] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c0036a..9fa50d2 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Please check the [wiki](https://github.com/Snipa22/xmr-node-proxy/wiki/config_re The proxy is pre-configured for a 1% donation. This is easily toggled inside of it's configuration. If you'd like to make a one time donation, the addresses are as follows: * XMR - 44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr -* BTC - 114DGE2jmPb5CP2RGKZn6u6xtccHhZGFmM +* BTC - 15fkPTtN8cRXD3moKWDoXjuiTaS9FgA3UE ## Installation/Configuration Assistance From 6c2b8317f1536318790ae4760919a2840c42739d Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 3 Feb 2018 19:31:07 +0100 Subject: [PATCH 005/367] Added XMRPool.eu --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9fa50d2..a390fe1 100644 --- a/README.md +++ b/README.md @@ -106,4 +106,6 @@ Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode. * [MoneroOcean.stream](https://moneroocean.stream) * [SECUmine.net](https://secumine.net) * [Chinaenter.cn](http://xmr.chinaenter.cn) +* [XMRPool.eu](https://xmrpool.eu) + If you'd like to have your pool added, please make a pull request here, or contact Snipa on IRC! From c9268827a37010aba2e8d611593ced6f43f9819e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 16:15:24 +0100 Subject: [PATCH 006/367] Added support for new Monero PoW --- README.md | 21 +++++---------------- config_example.json | 22 +++++----------------- install.sh | 2 +- lib/xmr.js | 8 ++++---- package.json | 12 ++++++------ proxy.js | 2 +- 6 files changed, 22 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index a390fe1..a277aab 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ passwd nodeproxy echo "nodeproxy ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers ``` -3. Log in as the **NON-ROOT USER** you just created and run the [deploy script](https://raw.githubusercontent.com/Snipa22/xmr-node-proxy/master/install.sh). This is very important! This script will install the proxy to whatever user it's running under! +3. Log in as the **NON-ROOT USER** you just created and run the [deploy script](https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh). This is very important! This script will install the proxy to whatever user it's running under! ```bash -curl -L https://raw.githubusercontent.com/Snipa22/xmr-node-proxy/master/install.sh | bash +curl -L https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh | bash ``` 3. Once it's complete, copy `example_config.json` to `config.json` and edit as desired. @@ -56,7 +56,7 @@ If not running on an Ubuntu 16.04 system, please make sure your kernel is at lea Many smaller VMs come with ulimits set very low. We suggest looking into setting the ulimit higher. In particular, `nofile` (Number of files open) needs to be raised for high-usage instances. If your system doesn't have AES-NI, then it will throw an error during the node-multi-hashing install, as this requires AES-NI. If this is the case, go ahead and change the following line: -"multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git", +"multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git", to: "multi-hashing": "git://github.com/clintar/node-multi-hashing.git#Nan-2.0", @@ -71,7 +71,7 @@ In testing, we've seen AWS t2.micro instances take upwards of 2k connections, wh ## Configuration Guidelines -Please check the [wiki](https://github.com/Snipa22/xmr-node-proxy/wiki/config_review) for information on configuration +Please check the [wiki](https://github.com/MoneroOcean/xmr-node-proxy/wiki/config_review) for information on configuration ## Developer Donations @@ -80,17 +80,6 @@ The proxy is pre-configured for a 1% donation. This is easily toggled inside of * XMR - 44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr * BTC - 15fkPTtN8cRXD3moKWDoXjuiTaS9FgA3UE -## Installation/Configuration Assistance - -If you need help installing the pool from scratch, please have your servers ready, which would be Ubuntu 16.04 servers, blank and clean, DNS records pointed. These need to be x86_64 boxes with AES-NI Available. - -Installation asstiance is 4 XMR, with a 2 XMR deposit, with remainder to be paid on completion. -Configuration assistance is 2 XMR with a 1 XMR deposit, and includes debugging your proxy configurations, ensuring that everything is running, and tuning for your uses/needs. - -SSH access with a sudo-enabled user will be needed for installs, preferably the user that is slated to run the pool. - -Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode.net in #monero-pools - ## Known Working Pools * [XMRPool.net](https://xmrpool.net) @@ -108,4 +97,4 @@ Please contact Snipa at: proxy_installs@snipanet.com or via IRC on irc.freenode. * [Chinaenter.cn](http://xmr.chinaenter.cn) * [XMRPool.eu](https://xmrpool.eu) -If you'd like to have your pool added, please make a pull request here, or contact Snipa on IRC! +If you'd like to have your pool added, please make a pull request here, or contact MoneroOcean at support@moneroocean.stream! diff --git a/config_example.json b/config_example.json index 6fbcabe..db3d7d8 100644 --- a/config_example.json +++ b/config_example.json @@ -1,28 +1,16 @@ { "pools": [ { - "hostname": "pool.supportxmr.com", - "port": 7777, + "hostname": "gulf.moneroocean.stream", + "port": 10032, "ssl": false, "allowSelfSignedSSL": false, - "share": 80, - "username": "46XWBqE1iwsVxSDP1qDrxhE1XvsZV6eALG5LwnoMdjbT4GPdy2bZTb99kagzxp2MMjUamTYZ4WgvZdFadvMimTjvR6Gv8hL", - "password": "proxy:totally.valid@snipanet.com", + "share": 100, + "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "password": "proxy", "keepAlive": true, "coin": "xmr", "default": false - }, - { - "hostname": "mine.xmrpool.net", - "port": 7778, - "ssl": false, - "allowSelfSignedSSL": false, - "share": 20, - "username": "46XWBqE1iwsVxSDP1qDrxhE1XvsZV6eALG5LwnoMdjbT4GPdy2bZTb99kagzxp2MMjUamTYZ4WgvZdFadvMimTjvR6Gv8hL", - "password": "proxy:totally.valid@snipanet.com", - "keepAlive": true, - "coin": "xmr", - "default": true } ], "listeningPorts": [ diff --git a/install.sh b/install.sh index f09f059..c50a74f 100644 --- a/install.sh +++ b/install.sh @@ -11,7 +11,7 @@ sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git python-virtualenv python3-virtualenv curl ntp build-essential screen cmake pkg-config libboost-all-dev libevent-dev libunbound-dev libminiupnpc-dev libunwind8-dev liblzma-dev libldns-dev libexpat1-dev libgtest-dev libzmq3-dev cd ~ -git clone https://github.com/Snipa22/xmr-node-proxy +git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash source ~/.nvm/nvm.sh nvm install v6.9.2 diff --git a/lib/xmr.js b/lib/xmr.js index da914ca..1968d38 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -190,7 +190,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { // Validate share with CN hash, then if valid, blast it up to the master. let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex')); let convertedBlob = cnUtil.convert_blob(shareBuffer); - hash = multiHashing.cryptonight(convertedBlob); + hash = multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 7 ? convertedBlob[0] - 6 : 0); if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); @@ -220,11 +220,11 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { } let devPool = { - "hostname": "xmr-donations.snipanet.com", - "port": 7777, + "hostname": "gulf.moneroocean.stream", + "port": 10032, "ssl": false, "share": 0, - "username": "44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr", + "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy_donations", "keepAlive": true, "coin": "xmr", diff --git a/package.json b/package.json index 0591e7c..83506dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.0.1", + "version": "0.1.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -8,14 +8,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/snipa22/xmr-node-proxy.git" + "url": "git+https://github.com/MoneroOcean/xmr-node-proxy.git" }, - "author": "Alexander Blair", + "author": "Multiple", "license": "MIT", "bugs": { - "url": "https://github.com/snipa22/xmr-node-proxy/issues" + "url": "https://github.com/MoneroOcean/xmr-node-proxy/issues" }, - "homepage": "https://github.com/snipa22/xmr-node-proxy#readme", + "homepage": "https://github.com/MoneroOcean/xmr-node-proxy#readme", "dependencies": { "async": "2.1.4", "bignum": "^0.12.5", @@ -37,6 +37,6 @@ }, "optionalDependencies": { "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", - "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git" + "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } diff --git a/proxy.js b/proxy.js index beceb35..71fec72 100644 --- a/proxy.js +++ b/proxy.js @@ -705,7 +705,7 @@ function handlePoolMessage(jsonData, hostname){ function handleNewBlockTemplate(blockTemplate, hostname){ let pool = activePools[hostname]; - console.log(`Received new block template from ${pool.hostname}`); + console.log(`Received new block template on ${blockTemplate.height} height from ${pool.hostname}`); if(pool.activeBlocktemplate){ if (pool.activeBlocktemplate.job_id === blockTemplate.job_id){ debug.pool('No update with this job, it is an upstream dupe'); From 890ac9876d9850d260fa0d3a434f8073500c741a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 17:58:50 +0100 Subject: [PATCH 007/367] Fixed config --- README.md | 2 +- config_example.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a277aab..62cf789 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ pm2 monit ## Known Issues -VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew through some serious memory during compile. In regards to this, one of our users has put together a guide for T2.Micro servers: https://docs.google.com/document/d/1m8E4_pDwKuFo0TnWJaO13LDHqOmbL6YrzyR6FvzqGgU (Credit goes to MayDay30 for his work with this!) +VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew through some serious memory during compile. In regards to this, one of our users has put together a guide for T2.Micro servers: http://moneroocean.blogspot.com/2017/10/setup-of-xmr-node-proxy-on-free-tier.html If not running on an Ubuntu 16.04 system, please make sure your kernel is at least 3.2 or higher, as older versions will not work for this. diff --git a/config_example.json b/config_example.json index db3d7d8..502c7d1 100644 --- a/config_example.json +++ b/config_example.json @@ -10,7 +10,7 @@ "password": "proxy", "keepAlive": true, "coin": "xmr", - "default": false + "default": true } ], "listeningPorts": [ From 64f478aef6fec239c8ab3bfdea8ccd2468e9532f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 18:13:11 +0100 Subject: [PATCH 008/367] Removed info about non aesni hosts --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 62cf789..eed7bde 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,6 @@ If not running on an Ubuntu 16.04 system, please make sure your kernel is at lea Many smaller VMs come with ulimits set very low. We suggest looking into setting the ulimit higher. In particular, `nofile` (Number of files open) needs to be raised for high-usage instances. -If your system doesn't have AES-NI, then it will throw an error during the node-multi-hashing install, as this requires AES-NI. If this is the case, go ahead and change the following line: -"multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git", -to: -"multi-hashing": "git://github.com/clintar/node-multi-hashing.git#Nan-2.0", - In your `packages.json`, do a `npm install`, and it should pass. From bf60935c5ffef816b700f8aa8890031d998dafb6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 20:45:34 +0100 Subject: [PATCH 009/367] Switched to forknote utils --- lib/aeon.js | 2 +- lib/xmr.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/aeon.js b/lib/aeon.js index 3ece059..8264496 100644 --- a/lib/aeon.js +++ b/lib/aeon.js @@ -1,6 +1,6 @@ "use strict"; const multiHashing = require('multi-hashing'); -const cnUtil = require('cryptonote-util'); +const cnUtil = require('forknote-util'); const bignum = require('bignum'); const support = require('./support.js')(); const crypto = require('crypto'); diff --git a/lib/xmr.js b/lib/xmr.js index 1968d38..c98b50f 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -1,6 +1,6 @@ "use strict"; const multiHashing = require('multi-hashing'); -const cnUtil = require('cryptonote-util'); +const cnUtil = require('forknote-util'); const bignum = require('bignum'); const support = require('./support.js')(); const crypto = require('crypto'); diff --git a/package.json b/package.json index 83506dc..2ef29f5 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", + "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From fb002587d8dfe768b4fe1a0573ace3cbfa4ad4f6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 22:03:28 +0100 Subject: [PATCH 010/367] Returned back to cryptonote utils for a while --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2ef29f5..7b8a65a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "express": "4.14.0", "jsonwebtoken": "^7.2.1", "minimist": "1.2.0", - "moment": "2.17.1", + "moment": "2.21.0", "range": "0.0.3", "request": "^2.79.0", "request-json": "0.6.1", @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", + "forknote-util": "git+https://github.com/clintar/node-cryptonote-util.git", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From 2f9ffcc2c367ce8d14a90d2e18ca1d315994cb5c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 22:37:02 +0100 Subject: [PATCH 011/367] Switched back to private forknote --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b8a65a..787fb7c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git+https://github.com/clintar/node-cryptonote-util.git", + "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From 04e4c24fd659e8e04308eaff3b587ca9b01bb8be Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 22:52:49 +0100 Subject: [PATCH 012/367] Back to default utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 787fb7c..3951e6b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", + "forknote-util": "git+https://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From 0ad30c1b70e9d49cce92a8241ed0ebb926bedbb8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 23:21:15 +0100 Subject: [PATCH 013/367] Switched to forknote --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3951e6b..787fb7c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git+https://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", + "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From 3f1c5b2b4845b9c268e5066a08e7940269e4bb3e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Mar 2018 23:39:52 +0100 Subject: [PATCH 014/367] Returned to production version --- lib/xmr.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index c98b50f..1968d38 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -1,6 +1,6 @@ "use strict"; const multiHashing = require('multi-hashing'); -const cnUtil = require('forknote-util'); +const cnUtil = require('cryptonote-util'); const bignum = require('bignum'); const support = require('./support.js')(); const crypto = require('crypto'); diff --git a/package.json b/package.json index 787fb7c..10b42bc 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git+https://github.com/MoneroOcean/node-forknote-util.git", + "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From 6846a38223f06361a5f36a186e7c2eca6bf86288 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 01:58:39 +0100 Subject: [PATCH 015/367] Returned forknote --- lib/xmr.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 1968d38..c98b50f 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -1,6 +1,6 @@ "use strict"; const multiHashing = require('multi-hashing'); -const cnUtil = require('cryptonote-util'); +const cnUtil = require('forknote-util'); const bignum = require('bignum'); const support = require('./support.js')(); const crypto = require('crypto'); diff --git a/package.json b/package.json index 10b42bc..81ab686 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", + "forknote-util": "git://github.com/MoneroOcean/node-forknote-util.git", "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" } } From e3fa634ea4acf2f25ff6f0a5a6f57c00740ab9e8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 15:08:26 +0200 Subject: [PATCH 016/367] Updated repo names --- lib/xmr.js | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index c98b50f..e0f5f11 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -1,6 +1,6 @@ "use strict"; -const multiHashing = require('multi-hashing'); -const cnUtil = require('forknote-util'); +const multiHashing = require('cryptonight-hashing'); +const cnUtil = require('cryptoforknote-util'); const bignum = require('bignum'); const support = require('./support.js')(); const crypto = require('crypto'); diff --git a/package.json b/package.json index 81ab686..352812d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "uuid": "3.0.1" }, "optionalDependencies": { - "forknote-util": "git://github.com/MoneroOcean/node-forknote-util.git", - "multi-hashing": "git+https://github.com/MoneroOcean/node-multi-hashing-aesni.git" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git", + "multi-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git" } } From 0f7143681472aeff2a92a417ac46af8ea5d155cc Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 16:10:40 +0200 Subject: [PATCH 017/367] Added blob_type support from pool --- lib/xmr.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index e0f5f11..266f73f 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -37,6 +37,14 @@ function getRemoteNodes() { ]; // Prefill the array with known good nodes for now. Eventually will try to download them via DNS or http. } +function parse_blob_type(blob_type_str) { + if (typeof(blob_type_str) === 'undefined') return 0; + if (blob_type_str === 'cryptonote') return 0; + if (blob_type_str === 'forknote1') return 1; + if (blob_type_str === 'forknote2') return 2; + return 0; +} + function BlockTemplate(template) { /* We receive something identical to the result portions of the monero GBT call. @@ -45,6 +53,7 @@ function BlockTemplate(template) { */ this.id = template.id; this.blob = template.blocktemplate_blob; + this.blob_type = template.blob_type; this.difficulty = template.difficulty; this.height = template.height; this.reservedOffset = template.reserved_offset; @@ -67,7 +76,7 @@ function BlockTemplate(template) { } else { this.buffer.writeUInt32BE(++this.workerNonce, this.workerOffset); } - return cnUtil.convert_blob(this.buffer).toString('hex'); + return cnUtil.convert_blob(this.buffer, this.blob_type).toString('hex'); }; } @@ -78,6 +87,7 @@ function MasterBlockTemplate(template) { You know. Just in case amirite? */ this.blob = template.blocktemplate_blob; + this.blob_type = parse_blob_type(template.blob_type); this.difficulty = template.difficulty; this.height = template.height; this.reservedOffset = template.reserved_offset; // reserveOffset @@ -137,6 +147,7 @@ function getMasterJob(pool, workerID) { let workerData = { id: crypto.pseudoRandomBytes(21).toString('base64'), blocktemplate_blob: btBlob, + blob_type: activeBlockTemplate.blob_type, difficulty: activeBlockTemplate.difficulty, height: activeBlockTemplate.height, reserved_offset: activeBlockTemplate.reservedOffset, @@ -188,8 +199,8 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { if (hashDiff.ge(blockTemplate.targetDiff)) { // Validate share with CN hash, then if valid, blast it up to the master. - let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex')); - let convertedBlob = cnUtil.convert_blob(shareBuffer); + let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); + let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); hash = multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 7 ? convertedBlob[0] - 6 : 0); if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); From 059ec6373751031151c81eb2fc5c1917b0ff8b8e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 16:20:36 +0200 Subject: [PATCH 018/367] Updated readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index eed7bde..214003a 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,12 @@ In testing, we've seen AWS t2.micro instances take upwards of 2k connections, wh Please check the [wiki](https://github.com/MoneroOcean/xmr-node-proxy/wiki/config_review) for information on configuration -## Developer Donations - -The proxy is pre-configured for a 1% donation. This is easily toggled inside of it's configuration. If you'd like to make a one time donation, the addresses are as follows: - -* XMR - 44Ldv5GQQhP7K7t3ZBdZjkPA7Kg7dhHwk3ZM3RJqxxrecENSFx27Vq14NAMAd2HBvwEPUVVvydPRLcC69JCZDHLT2X5a4gr -* BTC - 15fkPTtN8cRXD3moKWDoXjuiTaS9FgA3UE +Developer Donations +=================== +If you'd like to make a one time donation, the addresses are as follows: +* XMR - ```499fS1Phq64hGeqV8p2AfXbf6Ax7gP6FybcMJq6Wbvg8Hw6xms8tCmdYpPsTLSaTNuLEtW4kF2DDiWCFcw4u7wSvFD8wFWE``` +* ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1``` +* SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy``` ## Known Working Pools From ed114e9b54f2fd73630d51bf273480fe932f7bc1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 16:33:01 +0200 Subject: [PATCH 019/367] Fixed multi-hashing name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 352812d..24242ab 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,6 @@ }, "optionalDependencies": { "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git", - "multi-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git" } } From 933b18b897568620d9f2d75dd0ec28b7bdfcf722 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 18:17:19 +0200 Subject: [PATCH 020/367] Updated version --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 71fec72..410d5f5 100644 --- a/proxy.js +++ b/proxy.js @@ -260,7 +260,7 @@ function Pool(poolData){ this.sendData('login', { login: this.username, pass: this.password, - agent: 'xmr-node-proxy/0.0.1' + agent: 'xmr-node-proxy/0.1.0' }); this.active = true; for (let worker in cluster.workers){ From 694472cea12f8a8fc218fe0b4bd31cc0e22ed8f7 Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Sun, 25 Mar 2018 13:33:17 -0700 Subject: [PATCH 021/367] Update to tagged release for node-multi-hashing-aesni --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0591e7c..ab2f332 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,6 @@ }, "optionalDependencies": { "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", - "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git" + "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1" } } From 6399b7bdb4c5289f262bbb0b19e56bfe34e111c8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 26 Mar 2018 09:25:06 +0200 Subject: [PATCH 022/367] Added BKM on how to switch to this repo --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 214003a..d654cdf 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ Based on a clean Ubuntu 16.04 LTS minimal install +## Switching from other xmr-node-proxy repository + +```bash +git remote set-url origin https://github.com/MoneroOcean/xmr-node-proxy.git && git pull && npm update +``` + ## Deployment via Installer 1. Create a user 'nodeproxy' and assign a password (or add an SSH key. If you prefer that, you should already know how to do it) From dd4e61ac8d9b2a4e76a4a7fc0614e6dc922430aa Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 26 Mar 2018 11:19:27 +0200 Subject: [PATCH 023/367] Added AEON donation address --- README.md | 1 + lib/aeon.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d654cdf..0384ebf 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Developer Donations =================== If you'd like to make a one time donation, the addresses are as follows: * XMR - ```499fS1Phq64hGeqV8p2AfXbf6Ax7gP6FybcMJq6Wbvg8Hw6xms8tCmdYpPsTLSaTNuLEtW4kF2DDiWCFcw4u7wSvFD8wFWE``` +* AEON - ```WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT``` * ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1``` * SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy``` diff --git a/lib/aeon.js b/lib/aeon.js index 8264496..198c019 100644 --- a/lib/aeon.js +++ b/lib/aeon.js @@ -220,11 +220,11 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { } let devPool = { - "hostname": "aeon-donations.snipanet.com", + "hostname": "mine.supportaeon.com", "port": 3333, "ssl": false, "share": 0, - "username": "WmtvM6SoYya4qzkoPB4wX7FACWcXyFPWAYzfz7CADECgKyBemAeb3dVb3QomHjRWwGS3VYzMJAnBXfUx5CfGLFZd1U7ssdXTu", + "username": "WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT", "password": "proxy_donations", "keepAlive": true, "coin": "aeon", From 1c7c65b7922377f21c0b17ed1e7366189ba997cd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 26 Mar 2018 11:48:21 +0200 Subject: [PATCH 024/367] Added support of variant and coin like xmrig-proxy --- lib/xmr.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/xmr.js b/lib/xmr.js index 266f73f..a4499cc 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -54,6 +54,8 @@ function BlockTemplate(template) { this.id = template.id; this.blob = template.blocktemplate_blob; this.blob_type = template.blob_type; + this.variant = template.variant; + this.coin = template.coin; this.difficulty = template.difficulty; this.height = template.height; this.reservedOffset = template.reserved_offset; @@ -88,6 +90,8 @@ function MasterBlockTemplate(template) { */ this.blob = template.blocktemplate_blob; this.blob_type = parse_blob_type(template.blob_type); + this.variant = template.variant; + this.coin = template.coin; this.difficulty = template.difficulty; this.height = template.height; this.reservedOffset = template.reserved_offset; // reserveOffset @@ -132,12 +136,19 @@ function getJob(miner, activeBlockTemplate, bashCache) { }; miner.validJobs.enq(newJob); + miner.cachedJob = { blob: blob, job_id: newJob.id, target: target, id: miner.id }; + if (typeof (activeBlockTemplate.variant) !== 'undefined') { + miner.cachedJob.variant = activeBlockTemplate.variant; + } + if (typeof (activeBlockTemplate.coin) !== 'undefined') { + miner.cachedJob.coin = activeBlockTemplate.coin; + } return miner.cachedJob; } @@ -148,6 +159,8 @@ function getMasterJob(pool, workerID) { id: crypto.pseudoRandomBytes(21).toString('base64'), blocktemplate_blob: btBlob, blob_type: activeBlockTemplate.blob_type, + variant: activeBlockTemplate.variant, + coin: activeBlockTemplate.coin, difficulty: activeBlockTemplate.difficulty, height: activeBlockTemplate.height, reserved_offset: activeBlockTemplate.reservedOffset, From 5714877d66f3f7f0a49731a39e888ff1005a31c7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 27 Mar 2018 07:29:36 +0200 Subject: [PATCH 025/367] Added cd for clarity --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0384ebf..8d68957 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Based on a clean Ubuntu 16.04 LTS minimal install ## Switching from other xmr-node-proxy repository ```bash +cd xmr-node-proxy git remote set-url origin https://github.com/MoneroOcean/xmr-node-proxy.git && git pull && npm update ``` From 9e5bde695c642f070fa9a6e5fd020c6d06c9849b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 27 Mar 2018 09:16:14 +0200 Subject: [PATCH 026/367] Removed useless & --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c50a74f..6b5cea1 100644 --- a/install.sh +++ b/install.sh @@ -25,5 +25,5 @@ pm2 status sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v6.9.2/bin `pwd`/.nvm/versions/node/v6.9.2/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` sudo chown -R $CURUSER. ~/.pm2 echo "Installing pm2-logrotate in the background!" -pm2 install pm2-logrotate & +pm2 install pm2-logrotate echo "You're setup with a shiny new proxy! Now, go configure it and have fun." From 91c542a88e8c66361ee1853cf9b9fa2c3a2df94f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 29 Mar 2018 16:14:46 +0200 Subject: [PATCH 027/367] Fix keepalive --- proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy.js b/proxy.js index 410d5f5..baa6050 100644 --- a/proxy.js +++ b/proxy.js @@ -945,6 +945,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m sendReply('Unauthenticated'); return; } + miner.heartbeat(); sendReply(null, { status: 'KEEPALIVED' }); From ba86189f2a5d36457d7230ce9990440934890dfe Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Wed, 4 Apr 2018 18:52:38 -0700 Subject: [PATCH 028/367] Update with new Cryptonight-Hashing library + the required changes for XMR. Thanks to Mayday30/MoneroOcean for getting an updated lib together. --- lib/xmr.js | 9 ++++++--- package.json | 5 +++-- proxy.js | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index da914ca..cb5eab1 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -1,5 +1,5 @@ "use strict"; -const multiHashing = require('multi-hashing'); +const multiHashing = require("cryptonight-hashing"); const cnUtil = require('cryptonote-util'); const bignum = require('bignum'); const support = require('./support.js')(); @@ -232,11 +232,14 @@ let devPool = { "devPool": true }; +function syncHash (convertedBlob) { + return multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 7 ? convertedBlob[0] - 6 : 0); +} + module.exports = function () { return { devPool: devPool, - hashSync: multiHashing.cryptonight, - hashAsync: multiHashing.CNAsync, + hashSync: syncHash, blockHeightCheck: blockHeightCheck, getRemoteNodes: getRemoteNodes, BlockTemplate: BlockTemplate, diff --git a/package.json b/package.json index ab2f332..d674457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.0.1", + "version": "0.0.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -37,6 +37,7 @@ }, "optionalDependencies": { "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", - "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1" + "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git" } } diff --git a/proxy.js b/proxy.js index beceb35..dc72076 100644 --- a/proxy.js +++ b/proxy.js @@ -260,7 +260,7 @@ function Pool(poolData){ this.sendData('login', { login: this.username, pass: this.password, - agent: 'xmr-node-proxy/0.0.1' + agent: 'xmr-node-proxy/0.0.2' }); this.active = true; for (let worker in cluster.workers){ From 4bc84e92391b1294dd87a5dc62773c0b13cd2364 Mon Sep 17 00:00:00 2001 From: Mike Teehan Date: Sat, 17 Feb 2018 15:26:41 -0500 Subject: [PATCH 029/367] Added a simple http+json server option for monitoring purposes --- config_example.json | 3 +++ index.html | 47 +++++++++++++++++++++++++++++++++++++++++++++ proxy.js | 43 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 index.html diff --git a/config_example.json b/config_example.json index 6fbcabe..4ca07d9 100644 --- a/config_example.json +++ b/config_example.json @@ -48,6 +48,9 @@ "bindAddress": "0.0.0.0", "developerShare": 1, "daemonAddress": "127.0.0.1:18081", + "httpEnable": false, + "httpAddress": "127.0.0.1", + "httpPort": "8080", "coinSettings": { "xmr":{ "minDiff": 100, diff --git a/index.html b/index.html new file mode 100644 index 0000000..25cfa85 --- /dev/null +++ b/index.html @@ -0,0 +1,47 @@ + + + + XNP Hashrate Monitor + + + +
+ + + + + diff --git a/proxy.js b/proxy.js index dc72076..121ce94 100644 --- a/proxy.js +++ b/proxy.js @@ -2,6 +2,7 @@ const cluster = require('cluster'); const net = require('net'); const tls = require('tls'); +const http = require('http'); const fs = require('fs'); const async = require('async'); const uuidV4 = require('uuid/v4'); @@ -578,7 +579,13 @@ function balanceWorkers(){ } } -function enumerateWorkerStats(){ +function enumerateWorkerStats() { + // here we do a bit of a hack and "cache" the activeWorkers + // this file is parsed for the http://host/json endpoint + fs.writeFile("workers.json", JSON.stringify(activeWorkers), function(err) { + if(err) + return console.log(err); + }); let stats, global_stats = {miners: 0, hashes: 0, hashRate: 0, diff: 0}; for (let poolID in activeWorkers){ if (activeWorkers.hasOwnProperty(poolID)){ @@ -803,7 +810,8 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { lastShare: this.lastShareTime, coin: this.coin, pool: this.pool, - id: this.id + id: this.id, + password: this.password }; }; @@ -952,6 +960,33 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m } } +function activateHTTP() { + var jsonServer = http.createServer((req, res) => { + if(req.url == "/") { + res.writeHead(200, {'Content-type':'text/html'}); + fs.readFile('index.html', 'utf8', function(err, contents) { + res.write(contents); + res.end(); + }) + } else if(req.url.substring(0, 5) == "/json") { + fs.readFile('workers.json', 'utf8', (err, data) => { + if(err) { + res.writeHead(503); + } else { + res.writeHead(200, {'Content-type':'application/json'}); + res.write(data + "\r\n"); + } + res.end(); + }); + } else { + res.writeHead(404); + res.end(); + } + }); + + jsonServer.listen(global.config.httpPort || "8080", global.config.httpAddress || "localhost") +} + function activatePorts() { /* Reads the current open ports, and then activates any that aren't active yet @@ -990,7 +1025,7 @@ function activatePorts() { socket.write(sendData); }; handleMinerData(jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, pushMessage, minerSocket); - }; + }; function socketConn(socket) { socket.setKeepAlive(true); @@ -1183,4 +1218,6 @@ if (cluster.isMaster) { }, 10000); setInterval(checkActivePools, 90000); activatePorts(); + if(global.config.httpEnable) + activateHTTP(); } From dc1e131078fab8f23b9762b05e9f93949517ddd2 Mon Sep 17 00:00:00 2001 From: Mike Teehan Date: Sat, 17 Feb 2018 16:56:14 -0500 Subject: [PATCH 030/367] Tiny fixes --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 25cfa85..32acba2 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@ (($) => { var $disp = $('#displaytable').DataTable({ + pageLength: 50, ajax: { url: "/json", type: "GET", @@ -26,7 +27,7 @@ function parseJSON(json) { var res = []; - var worker, miner, name; + var worker, miner, row, name; for(var workerid in json) { worker = json[workerid]; if(worker.length == 0) continue; From a8d9e570ed18985dfc9494e570cd5fd83cacb3c1 Mon Sep 17 00:00:00 2001 From: Mike Teehan Date: Mon, 19 Feb 2018 19:00:01 -0500 Subject: [PATCH 031/367] Added a footer row and some styling to the main datatable --- index.html | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 32acba2..e610759 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ -
+
- - - - From 22c7eb344c6a29b521e76a9ba0f71c8dec370252 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 08:29:06 +0200 Subject: [PATCH 047/367] Fixed miner iteration loop --- proxy.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/proxy.js b/proxy.js index b2adc2d..9e52a1e 100644 --- a/proxy.js +++ b/proxy.js @@ -1017,13 +1017,12 @@ function activateHTTP() { if (req.url == "/") { let totalWorkers = 0, totalHashrate = 0; let tableBody = ""; - for (var workerid in activeWorkers) { - let worker = activeWorkers[workerid]; - if (worker.length == 0) continue; - for (var minerid in worker) { - let miner = worker[minerid]; - if (miner.length == 0) continue; - let name = (miner.identifier.length > 0 && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + for (let workerID in activeWorkers) { + if (!activeWorkers.hasOwnProperty(workerID)) continue; + for (let minerID in activeWorkers[workerID]){ + if (!activeWorkers[workerID].hasOwnProperty(minerID)) continue; + let miner = activeWorkers[workerID][minerID]; + let name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; ++ totalWorkers; totalHashrate += miner.avgSpeed; tableBody += ` From 0afc58cfa176c672936f3b170f15dd6a80f2e0c9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:05:58 +0200 Subject: [PATCH 048/367] Improved html formatting --- proxy.js | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 9e52a1e..0b71087 100644 --- a/proxy.js +++ b/proxy.js @@ -1043,10 +1043,32 @@ function activateHTTP() { XNP Hashrate Monitor +

XNP Hashrate Monitor

Workers: ${totalWorkers}, Hashrate: ${totalHashrate}

-
+
@@ -1060,6 +1082,60 @@ function activateHTTP() { ${tableBody}
Name Hashrate
+ + `); res.end(); From 040f0c55e6339285bbb143d91522476fd46b86f2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:09:50 +0200 Subject: [PATCH 049/367] Fixed sorting --- 111.html | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ proxy.js | 2 +- 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 111.html diff --git a/111.html b/111.html new file mode 100644 index 0000000..a705188 --- /dev/null +++ b/111.html @@ -0,0 +1,159 @@ + + XNP Hashrate Monitor + + + +

XNP Hashrate Monitor

+

Workers: 212, Hashrate: 48337

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameHashrateDifficultySharesHashesShare AgoPing Ago
52.176.152.19676200012000a few secondsa few seconds
40.79.71.1830200000a few secondsa few seconds
52.186.120.15576200012000a few secondsa few seconds
52.186.120.155230200036000a few secondsa few seconds
52.186.120.15576200012000a few secondsa few seconds
52.162.121.1124612000612000a few secondsa few seconds
+ + + diff --git a/proxy.js b/proxy.js index 0b71087..12d2e10 100644 --- a/proxy.js +++ b/proxy.js @@ -1102,7 +1102,7 @@ function activateHTTP() { tbodyHtml = null; $('table.sorted-table > tbody > tr').each(function() { var str = $(this).children('td').eq(thIndex).html(); - var re1 = /^<.+>(\d+)<\\/.+>$/; + var re1 = /^<.+>(\\d+)<\\/.+>$/; var m; if (m = re1.exec(str)) { var pad = "000000000000"; From 8476421b6c5e81a2449e2cff3479a4297ba658a0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:17:05 +0200 Subject: [PATCH 050/367] Removed test html --- 111.html | 159 ------------------------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 111.html diff --git a/111.html b/111.html deleted file mode 100644 index a705188..0000000 --- a/111.html +++ /dev/null @@ -1,159 +0,0 @@ - - XNP Hashrate Monitor - - - -

XNP Hashrate Monitor

-

Workers: 212, Hashrate: 48337

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameHashrateDifficultySharesHashesShare AgoPing Ago
52.176.152.19676200012000a few secondsa few seconds
40.79.71.1830200000a few secondsa few seconds
52.186.120.15576200012000a few secondsa few seconds
52.186.120.155230200036000a few secondsa few seconds
52.186.120.15576200012000a few secondsa few seconds
52.162.121.1124612000612000a few secondsa few seconds
- - - From ba3690ce18e89861e61b2360debfcb8ce79ca58a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:23:23 +0200 Subject: [PATCH 051/367] Added more logging --- proxy.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 12d2e10..01c3129 100644 --- a/proxy.js +++ b/proxy.js @@ -10,6 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); +const PROXY_VERSION = "0.1.1"; /* General file design/where to find things. @@ -264,7 +265,7 @@ function Pool(poolData){ this.sendData('login', { login: this.username, pass: this.password, - agent: 'xmr-node-proxy/0.1.1' + agent: 'xmr-node-proxy/' + PROXY_VERSION }); this.active = true; for (let worker in cluster.workers){ @@ -1149,7 +1150,7 @@ function activateHTTP() { } }); - jsonServer.listen(global.config.httpPort || "8080", global.config.httpAddress || "localhost") + jsonServer.listen(global.config.httpPort || "8081", global.config.httpAddress || "localhost") } function activatePorts() { @@ -1317,6 +1318,7 @@ function checkActivePools() { // System Init if (cluster.isMaster) { + console.log("xmr-node-proxy v" + PROXY_VERSION); let numWorkers; try { let argv = require('minimist')(process.argv.slice(2)); @@ -1351,7 +1353,10 @@ if (cluster.isMaster) { connectPools(); setInterval(enumerateWorkerStats, 15000); setInterval(balanceWorkers, 90000); - if(global.config.httpEnable) activateHTTP(); + if (global.config.httpEnable) { + console.log("Activating Web API server on " + (global.config.httpAddress || "localhost") + ":" (global.config.httpPort || "8081")); + activateHTTP(); + } } else { /* setInterval(checkAliveMiners, 30000); From 6b58b067c7a3b31e691b3d04a74366f172da3dd8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:23:52 +0200 Subject: [PATCH 052/367] Fixed typo --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 01c3129..88dac0a 100644 --- a/proxy.js +++ b/proxy.js @@ -1354,7 +1354,7 @@ if (cluster.isMaster) { setInterval(enumerateWorkerStats, 15000); setInterval(balanceWorkers, 90000); if (global.config.httpEnable) { - console.log("Activating Web API server on " + (global.config.httpAddress || "localhost") + ":" (global.config.httpPort || "8081")); + console.log("Activating Web API server on " + (global.config.httpAddress || "localhost") + ":" + (global.config.httpPort || "8081")); activateHTTP(); } } else { From 44c95d3ba81e049ce89974aa46a857cfceaf43de Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 09:24:58 +0200 Subject: [PATCH 053/367] Adjusted logo message --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 88dac0a..84ec1ab 100644 --- a/proxy.js +++ b/proxy.js @@ -1318,7 +1318,7 @@ function checkActivePools() { // System Init if (cluster.isMaster) { - console.log("xmr-node-proxy v" + PROXY_VERSION); + console.log("Xmr-Node-Proxy (XNP) v" + PROXY_VERSION); let numWorkers; try { let argv = require('minimist')(process.argv.slice(2)); From cf3c25f27197f467633d0e5f9880d37dbd79a56d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 16:32:57 +0200 Subject: [PATCH 054/367] Added connectTime log api --- proxy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy.js b/proxy.js index 84ec1ab..5845adc 100644 --- a/proxy.js +++ b/proxy.js @@ -816,6 +816,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { hashes: this.hashes, avgSpeed: Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))), diff: this.difficulty, + connectTime: this.connectTime, lastContact: Math.floor(this.lastContact/1000), lastShare: this.lastShareTime, coin: this.coin, @@ -1035,6 +1036,7 @@ function activateHTTP() { ${miner.hashes} ${moment.unix(miner.lastShare).fromNow(true)} ${moment.unix(miner.lastContact).fromNow(true)} + ${moment.unix(miner.connectTime).fromNow(true)} `; } @@ -1078,6 +1080,7 @@ function activateHTTP() { Hashes Share Ago Ping Ago + Connected Ago ${tableBody} From c2461a8f3ea0a5d80d75d3af76bc98123cfd1e97 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 23 Apr 2018 16:35:13 +0200 Subject: [PATCH 055/367] Fixed connectTime --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 5845adc..afd5aa1 100644 --- a/proxy.js +++ b/proxy.js @@ -1036,7 +1036,7 @@ function activateHTTP() { ${miner.hashes} ${moment.unix(miner.lastShare).fromNow(true)} ${moment.unix(miner.lastContact).fromNow(true)} - ${moment.unix(miner.connectTime).fromNow(true)} + ${moment(miner.connectTime).fromNow(true)} `; } From 2f75f70f550b5a014bb8bd1cb499686852f74094 Mon Sep 17 00:00:00 2001 From: Learner Date: Tue, 24 Apr 2018 15:06:36 +0700 Subject: [PATCH 056/367] Fix undefined identifier and add 15s refresh (#11) * Fix undefined identifier and add 15s refresh * Remove useless check. * Check if miner is null ! How can it be null ? I'm thinking about running http only on Master --- proxy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy.js b/proxy.js index afd5aa1..ca2f394 100644 --- a/proxy.js +++ b/proxy.js @@ -1024,6 +1024,7 @@ function activateHTTP() { for (let minerID in activeWorkers[workerID]){ if (!activeWorkers[workerID].hasOwnProperty(minerID)) continue; let miner = activeWorkers[workerID][minerID]; + if (!miner) continue; let name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; ++ totalWorkers; totalHashrate += miner.avgSpeed; @@ -1046,6 +1047,7 @@ function activateHTTP() { XNP Hashrate Monitor + -

XNP Hashrate Monitor

+

XNP v${PROXY_VERSION} Hashrate Monitor

Workers: ${totalWorkers}, Hashrate: ${totalHashrate}

${tablePool} From 5b60836fbadb37d07c658dce209966c30a2c82a7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 8 May 2018 15:40:43 +0200 Subject: [PATCH 101/367] Change dev pool donation address to avoid conflics with other pools --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 76fba2a..261e4a1 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -321,7 +321,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { } let devPool = { - "hostname": "gulf.moneroocean.stream", + "hostname": "donations.moneroocean.stream", "port": 10032, "ssl": false, "share": 0, From 54ad8f703bcdf207b65a69dd0a31492797704118 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 8 May 2018 19:49:44 +0200 Subject: [PATCH 102/367] Changed donation address --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 261e4a1..711f01e 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -321,7 +321,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { } let devPool = { - "hostname": "donations.moneroocean.stream", + "hostname": "devshare.moneroocean.stream", "port": 10032, "ssl": false, "share": 0, From f1f5a43d3002fc92294b379c9ac24aa297b44629 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 12 May 2018 08:05:53 +0200 Subject: [PATCH 103/367] Improving worker balancer by removing last miner rfom backup pools --- proxy.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index cdc8db7..e8184af 100644 --- a/proxy.js +++ b/proxy.js @@ -543,6 +543,7 @@ function balanceWorkers(){ for (let pool in lowPools){ if (lowPools.hasOwnProperty(pool)){ minerChanges[pool] = []; + // fit low pools without overflow if (Object.keys(freed_miners).length > 0){ for (let miner in freed_miners){ if (freed_miners.hasOwnProperty(miner)){ @@ -560,7 +561,7 @@ function balanceWorkers(){ if(coinPools.hasOwnProperty(donatorPool) && !lowPools.hasOwnProperty(donatorPool)){ for (let miner in coinPools[donatorPool].miners){ if (coinPools[donatorPool].miners.hasOwnProperty(miner)){ - if (coinPools[donatorPool].miners[miner] < lowPools[pool] && coinPools[donatorPool].miners[miner] !== 0){ + if (coinPools[donatorPool].miners[miner] <= lowPools[pool] && coinPools[donatorPool].miners[miner] !== 0){ minerChanges[pool].push(miner); lowPools[pool] -= coinPools[donatorPool].miners[miner]; debug.balancer(`Moving ${miner} for ${pool} from ${donatorPool} for ${coinPools[donatorPool].miners[miner]} h/s`); @@ -579,6 +580,22 @@ function balanceWorkers(){ } } } + // fit low pools with overflow except devPool + if (Object.keys(freed_miners).length > 0){ + for (let pool in lowPools){ + if (lowPools.hasOwnProperty(pool) && pool !== devPool){ + if (!(pool in minerChanges)) minerChanges[pool] = []; + for (let miner in freed_miners){ + if (freed_miners.hasOwnProperty(miner)){ + minerChanges[pool].push(miner); + lowPools[pool] -= freed_miners[miner]; + debug.balancer(`Moving overflow ${miner} for ${pool} for ${freed_miners[miner]} h/s`); + delete(freed_miners[miner]); + } + } + } + } + } } for (let pool in minerChanges){ if(minerChanges.hasOwnProperty(pool) && minerChanges[pool].length > 0){ From bf6047fa329e45b948b686b4bab38bd5db355220 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 12 May 2018 13:41:58 +0200 Subject: [PATCH 104/367] Fixed https://github.com/MoneroOcean/xmr-node-proxy/issues/31 --- proxy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index e8184af..92d1ef8 100644 --- a/proxy.js +++ b/proxy.js @@ -623,7 +623,8 @@ function enumerateWorkerStats() { hashRate: 0, diff: 0 }; - let inactivityDeadline = Math.floor((Date.now())/1000) - (global.config.minerInactivityTime ? global.config.minerInactivityTime : 120); + let inactivityDeadline = (typeof global.config.minerInactivityTime === 'undefined') ? Math.floor((Date.now())/1000) - 120 + : (global.config.minerInactivityTime <= 0 ? 0 : Math.floor((Date.now())/1000) - global.config.minerInactivityTime); for (let workerID in activeWorkers[poolID]){ if (activeWorkers[poolID].hasOwnProperty(workerID)) { let workerData = activeWorkers[poolID][workerID]; From be57690d7a1fc2be91feaf06ab65522e69bf27cc Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 16 May 2018 21:33:16 +0200 Subject: [PATCH 105/367] Updated list of supported coins --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc2dc29..bc300c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # xmr-node-proxy +Supports all known cryptonight/heavy/light coins: + +* Monero (XMR), MoneroV (XMV), Monero Original (XMO), Monero Classic (XMC), ... +* Wownero (WOW), Masari (MSR), Electroneum (ETN), Graft (GRFT), Intense (ITNS) +* Stellite (XTL) +* Aeon (AEON), Turtlecoin (TRTL), IPBC/BitTube (TUBE) +* Sumokoin (SUMO), Haven (XHV), Loki (LOKI) +* ... + ## Setup Instructions @@ -78,13 +87,13 @@ for all initial miner connections via proxy. 7. Blob type ("blob_type" option in pool config section) can be as follows - * cryptonote - Monero forks like Sumokoin, Electroneum, Graft, Aeon + * cryptonote - Monero forks like Sumokoin, Electroneum, Graft, Aeon, Intense * cryptonote2 - Masari - * forknote - Some old Bytecoin forks + * forknote - Some old Bytecoin forks (do not even know which one) - * forknote2 - Bytecoin forks like Intense, Turtlecoin, IPBC + * forknote2 - Bytecoin forks like Turtlecoin, IPBC ## Known Issues @@ -117,6 +126,8 @@ If you'd like to make a one time donation, the addresses are as follows: * GRFT - ```GACadqdXj5eNLnyNxvQ56wcmsmVCFLkHQKgtaQXNEE5zjMDJkWcMVju2aYtxbTnZgBboWYmHovuiH1Ahm4g2N5a7LuMQrpT``` * MSR - ```5hnMXUKArLDRue5tWsNpbmGLsLQibt23MEsV3VGwY6MGStYwfTqHkff4BgvziprTitbcDYYpFXw2rEgXeipsABTtEmcmnCK``` * ITNS - ```iz53aMEaKJ25zB8xku3FQK5VVvmu2v6DENnbGHRmn659jfrGWBH1beqAzEVYaKhTyMZcxLJAdaCW3Kof1DwTiTbp1DSqLae3e``` +* WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` +* XMV - ```4BDgQohRBqg2wFZ5ezYqCrNGjgECAttARdbh1fNkuAbd3HnNkSgas11QD9VFQMzbnvDD3Mfcky1LAFihkbEYph5oGAMLurw``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` From 02f1b87fc9d1af2f4ae54db6171545caca416e26 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 16 May 2018 21:58:11 +0200 Subject: [PATCH 106/367] Made xmr as default coin choice and putting focus on algo/blob_type coin config --- config_example.json | 10 -- lib/aeon.js | 248 -------------------------------------------- proxy.js | 4 + 3 files changed, 4 insertions(+), 258 deletions(-) delete mode 100644 lib/aeon.js diff --git a/config_example.json b/config_example.json index 3b6365e..b805ea4 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,6 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "coin": "xmr", "algo": "cryptonight/1", "blob_type": "cryptonote", "default": true @@ -23,7 +22,6 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "coin": "xmr", "algo": "cryptonight/1", "blob_type": "cryptonote", "default": false @@ -34,19 +32,16 @@ "port": 8080, "ssl": false, "diff": 5000, - "coin": "xmr" }, { "port": 8443, "ssl": true, "diff": 5000, - "coin": "xmr" }, { "port": 3333, "ssl": false, "diff": 10000, - "coin": "xmr" } ], "bindAddress": "0.0.0.0", @@ -65,11 +60,6 @@ "minDiff": 100, "maxDiff": 300000, "shareTargetTime": 15 - }, - "aeon":{ - "minDiff": 100, - "maxDiff": 300000, - "shareTargetTime": 15 } } } diff --git a/lib/aeon.js b/lib/aeon.js deleted file mode 100644 index 198c019..0000000 --- a/lib/aeon.js +++ /dev/null @@ -1,248 +0,0 @@ -"use strict"; -const multiHashing = require('multi-hashing'); -const cnUtil = require('forknote-util'); -const bignum = require('bignum'); -const support = require('./support.js')(); -const crypto = require('crypto'); - -let debug = { - pool: require('debug')('pool'), - diff: require('debug')('diff'), - blocks: require('debug')('blocks'), - shares: require('debug')('shares'), - miners: require('debug')('miners'), - workers: require('debug')('workers') -}; - -let baseDiff = bignum('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16); - -Buffer.prototype.toByteArray = function () { - return Array.prototype.slice.call(this, 0); -}; - -function blockHeightCheck(nodeList, callback) { - let randomNode = nodeList[Math.floor(Math.random() * nodeList.length)].split(':'); - -} - -function getRemoteNodes() { - let knownNodes = [ - '162.213.38.245:18081', - '116.93.119.79:18081', - '85.204.96.231:18081', - '107.167.87.242:18081', - '107.167.93.58:18081', - '199.231.85.122:18081', - '192.110.160.146:18081' - ]; // Prefill the array with known good nodes for now. Eventually will try to download them via DNS or http. -} - -function BlockTemplate(template) { - /* - We receive something identical to the result portions of the monero GBT call. - Functionally, this could act as a very light-weight solo pool, so we'll prep it as one. - You know. Just in case amirite? - */ - this.id = template.id; - this.blob = template.blocktemplate_blob; - this.difficulty = template.difficulty; - this.height = template.height; - this.reservedOffset = template.reserved_offset; - this.workerOffset = template.worker_offset; // clientNonceLocation - this.targetDiff = template.target_diff; - this.targetHex = template.target_diff_hex; - this.buffer = new Buffer(this.blob, 'hex'); - this.previousHash = new Buffer(32); - this.workerNonce = 0; - this.solo = false; - if (typeof(this.workerOffset) === 'undefined') { - this.solo = true; - global.instanceId.copy(this.buffer, this.reservedOffset + 4, 0, 3); - this.buffer.copy(this.previousHash, 0, 7, 39); - } - this.nextBlob = function () { - if (this.solo) { - // This is running in solo mode. - this.buffer.writeUInt32BE(++this.workerNonce, this.reservedOffset); - } else { - this.buffer.writeUInt32BE(++this.workerNonce, this.workerOffset); - } - return cnUtil.convert_blob(this.buffer).toString('hex'); - }; -} - -function MasterBlockTemplate(template) { - /* - We receive something identical to the result portions of the monero GBT call. - Functionally, this could act as a very light-weight solo pool, so we'll prep it as one. - You know. Just in case amirite? - */ - this.blob = template.blocktemplate_blob; - this.difficulty = template.difficulty; - this.height = template.height; - this.reservedOffset = template.reserved_offset; // reserveOffset - this.workerOffset = template.client_nonce_offset; // clientNonceLocation - this.poolOffset = template.client_pool_offset; // clientPoolLocation - this.targetDiff = template.target_diff; - this.targetHex = template.target_diff_hex; - this.buffer = new Buffer(this.blob, 'hex'); - this.previousHash = new Buffer(32); - this.job_id = template.job_id; - this.workerNonce = 0; - this.poolNonce = 0; - this.solo = false; - if (typeof(this.workerOffset) === 'undefined') { - this.solo = true; - global.instanceId.copy(this.buffer, this.reservedOffset + 4, 0, 3); - this.buffer.copy(this.previousHash, 0, 7, 39); - } - this.blobForWorker = function () { - this.buffer.writeUInt32BE(++this.poolNonce, this.poolOffset); - return this.buffer.toString('hex'); - }; -} - -function getJob(miner, activeBlockTemplate, bashCache) { - if (miner.validJobs.size() >0 && miner.validJobs.get(0).templateID === activeBlockTemplate.id && !miner.newDiff && miner.cachedJob !== null && typeof bashCache === 'undefined') { - return miner.cachedJob; - } - - let blob = activeBlockTemplate.nextBlob(); - let target = getTargetHex(miner); - miner.lastBlockHeight = activeBlockTemplate.height; - - let newJob = { - id: crypto.pseudoRandomBytes(21).toString('base64'), - extraNonce: activeBlockTemplate.workerNonce, - height: activeBlockTemplate.height, - difficulty: miner.difficulty, - diffHex: miner.diffHex, - submissions: [], - templateID: activeBlockTemplate.id - }; - - miner.validJobs.enq(newJob); - miner.cachedJob = { - blob: blob, - job_id: newJob.id, - target: target, - id: miner.id - }; - return miner.cachedJob; -} - -function getMasterJob(pool, workerID) { - let activeBlockTemplate = pool.activeBlocktemplate; - let btBlob = activeBlockTemplate.blobForWorker(); - let workerData = { - id: crypto.pseudoRandomBytes(21).toString('base64'), - blocktemplate_blob: btBlob, - difficulty: activeBlockTemplate.difficulty, - height: activeBlockTemplate.height, - reserved_offset: activeBlockTemplate.reservedOffset, - worker_offset: activeBlockTemplate.workerOffset, - target_diff: activeBlockTemplate.targetDiff, - target_diff_hex: activeBlockTemplate.targetHex - }; - let localData = { - id: workerData.id, - masterJobID: activeBlockTemplate.job_id, - poolNonce: activeBlockTemplate.poolNonce - }; - if (!(workerID in pool.poolJobs)) { - pool.poolJobs[workerID] = support.circularBuffer(4); - } - pool.poolJobs[workerID].enq(localData); - return workerData; -} - -function getTargetHex(miner) { - if (miner.newDiff) { - miner.difficulty = miner.newDiff; - miner.newDiff = null; - } - let padded = Buffer.alloc(32); - let diffBuff = baseDiff.div(miner.difficulty).toBuffer(); - diffBuff.copy(padded, 32 - diffBuff.length); - - let buff = padded.slice(0, 4); - let buffArray = buff.toByteArray().reverse(); - let buffReversed = new Buffer(buffArray); - miner.target = buffReversed.readUInt32BE(0); - return buffReversed.toString('hex'); -} - -function processShare(miner, job, blockTemplate, nonce, resultHash) { - let template = new Buffer(blockTemplate.buffer.length); - blockTemplate.buffer.copy(template); - if (blockTemplate.solo) { - template.writeUInt32BE(job.extraNonce, blockTemplate.reservedOffset); - } else { - template.writeUInt32BE(job.extraNonce, blockTemplate.workerOffset); - } - - let hash = new Buffer(resultHash, 'hex'); - let hashArray = hash.toByteArray().reverse(); - let hashNum = bignum.fromBuffer(new Buffer(hashArray)); - let hashDiff = baseDiff.div(hashNum); - - if (hashDiff.ge(blockTemplate.targetDiff)) { - // Validate share with CN hash, then if valid, blast it up to the master. - let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex')); - let convertedBlob = cnUtil.convert_blob(shareBuffer); - hash = multiHashing.cryptonight_light(convertedBlob); - if (hash.toString('hex') !== resultHash) { - console.error(global.threadName + "Bad share from miner " + miner.logString); - miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); - return false; - } - miner.blocks += 1; - process.send({ - type: 'shareFind', - host: miner.pool, - data: { - btID: blockTemplate.id, - nonce: nonce, - resultHash: resultHash, - workerNonce: job.extraNonce - } - }); - } - else if (hashDiff.lt(job.difficulty)) { - process.send({type: 'invalidShare'}); - console.warn(global.threadName + "Rejected low diff share of " + hashDiff.toString() + " from: " + miner.address + " ID: " + - miner.identifier + " IP: " + miner.ipAddress); - return false; - } - miner.shares += 1; - miner.hashes += job.difficulty; - return true; -} - -let devPool = { - "hostname": "mine.supportaeon.com", - "port": 3333, - "ssl": false, - "share": 0, - "username": "WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT", - "password": "proxy_donations", - "keepAlive": true, - "coin": "aeon", - "default": false, - "devPool": true -}; - -module.exports = function () { - return { - devPool: devPool, - hashSync: multiHashing.cryptonight_light, - hashAsync: multiHashing.CNLAsync, - blockHeightCheck: blockHeightCheck, - getRemoteNodes: getRemoteNodes, - BlockTemplate: BlockTemplate, - getJob: getJob, - processShare: processShare, - MasterBlockTemplate: MasterBlockTemplate, - getMasterJob: getMasterJob - }; -}; \ No newline at end of file diff --git a/proxy.js b/proxy.js index 92d1ef8..41f9126 100644 --- a/proxy.js +++ b/proxy.js @@ -108,6 +108,7 @@ function slaveMessageHandler(message) { message.data.forEach(function(hostname){ if(!(hostname in activePools)){ global.config.pools.forEach(function(poolData){ + if (!poolData.coin) poolData.coin = "xmr"; if (hostname === poolData.hostname){ activePools[hostname] = new Pool(poolData); } @@ -306,6 +307,7 @@ The master performs the following tasks: */ function connectPools(){ global.config.pools.forEach(function (poolData) { + if (!poolData.coin) poolData.coin = "xmr"; if (activePools.hasOwnProperty(poolData.hostname)){ return; } @@ -984,6 +986,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m case 'login': let difficulty = portData.difficulty; let minerId = uuidV4(); + if (!portData.coin) portData.coin = "xmr"; miner = new Miner(minerId, params, ip, pushMessage, portData, minerSocket); if (!miner.valid_miner) { console.warn(global.threadName + "Invalid miner, disconnecting due to: " + miner.error); @@ -1457,6 +1460,7 @@ if (cluster.isMaster) { */ process.on('message', slaveMessageHandler); global.config.pools.forEach(function(poolData){ + if (!poolData.coin) poolData.coin = "xmr"; activePools[poolData.hostname] = new Pool(poolData); if (poolData.default){ defaultPools[poolData.coin] = poolData.hostname; From 3baa4cda8da343adeaec7f1b1395ed0b00df5d0f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 16 May 2018 22:00:02 +0200 Subject: [PATCH 107/367] Removed extra commas --- config_example.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_example.json b/config_example.json index b805ea4..a2d3524 100644 --- a/config_example.json +++ b/config_example.json @@ -31,17 +31,17 @@ { "port": 8080, "ssl": false, - "diff": 5000, + "diff": 5000 }, { "port": 8443, "ssl": true, - "diff": 5000, + "diff": 5000 }, { "port": 3333, "ssl": false, - "diff": 10000, + "diff": 10000 } ], "bindAddress": "0.0.0.0", From 0f50f80283adfe33f170a1bf0008037d10440242 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 17 May 2018 10:08:51 +0200 Subject: [PATCH 108/367] Fixed conneciton to dead default pool --- proxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 41f9126..cdae1f3 100644 --- a/proxy.js +++ b/proxy.js @@ -778,14 +778,14 @@ function handleNewBlockTemplate(blockTemplate, hostname){ function is_active_pool(hostname) { let pool = activePools[hostname]; - if (!pool.socket || !pool.active || pool.activeBlocktemplate === null) return false; + if ((cluster.isMaster && !pool.socket) || !pool.active || pool.activeBlocktemplate === null) return false; let top_height = 0; for (let poolName in activePools){ if (!activePools.hasOwnProperty(poolName)) continue; let pool2 = activePools[poolName]; if (pool2.coin != pool.coin) continue; - if (!pool2.socket || !pool2.active || pool2.activeBlocktemplate === null) continue; + if ((cluster.isMaster && !pool2.socket) || !pool2.active || pool2.activeBlocktemplate === null) continue; if (Math.abs(pool2.activeBlocktemplate.height - pool.activeBlocktemplate.height) > 1000) continue; // different coin templates, can't compare here if (pool2.activeBlocktemplate.height > top_height) top_height = pool2.activeBlocktemplate.height; } @@ -830,6 +830,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (pool.coin != portData.coin) continue; if (is_active_pool(poolName)) { this.pool = poolName; + break; } } } From 9e6153cd1ebc97c179463f06753f34cb7fa0babf Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 17 May 2018 11:19:23 +0200 Subject: [PATCH 109/367] Rolled back previous change --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index cdae1f3..6092a21 100644 --- a/proxy.js +++ b/proxy.js @@ -778,14 +778,14 @@ function handleNewBlockTemplate(blockTemplate, hostname){ function is_active_pool(hostname) { let pool = activePools[hostname]; - if ((cluster.isMaster && !pool.socket) || !pool.active || pool.activeBlocktemplate === null) return false; + if ((!pool.socket) || !pool.active || pool.activeBlocktemplate === null) return false; let top_height = 0; for (let poolName in activePools){ if (!activePools.hasOwnProperty(poolName)) continue; let pool2 = activePools[poolName]; if (pool2.coin != pool.coin) continue; - if ((cluster.isMaster && !pool2.socket) || !pool2.active || pool2.activeBlocktemplate === null) continue; + if ((!pool2.socket) || !pool2.active || pool2.activeBlocktemplate === null) continue; if (Math.abs(pool2.activeBlocktemplate.height - pool.activeBlocktemplate.height) > 1000) continue; // different coin templates, can't compare here if (pool2.activeBlocktemplate.height > top_height) top_height = pool2.activeBlocktemplate.height; } From 0c80c28efd9ded76a180fb604964b0fa156c745a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 17 May 2018 11:25:17 +0200 Subject: [PATCH 110/367] Adjusted keepalive sending from worker processes --- proxy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 6092a21..c106568 100644 --- a/proxy.js +++ b/proxy.js @@ -207,7 +207,7 @@ function Pool(poolData){ this.blob_type = poolData.blob_type; setInterval(function(pool) { - if (pool.keepAlive && is_active_pool(pool.hostname)) pool.sendData('keepalived'); + if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); }, 30000, this); this.connect = function(){ @@ -778,14 +778,14 @@ function handleNewBlockTemplate(blockTemplate, hostname){ function is_active_pool(hostname) { let pool = activePools[hostname]; - if ((!pool.socket) || !pool.active || pool.activeBlocktemplate === null) return false; + if ((cluster.isMaster && !pool.socket) || !pool.active || pool.activeBlocktemplate === null) return false; let top_height = 0; for (let poolName in activePools){ if (!activePools.hasOwnProperty(poolName)) continue; let pool2 = activePools[poolName]; if (pool2.coin != pool.coin) continue; - if ((!pool2.socket) || !pool2.active || pool2.activeBlocktemplate === null) continue; + if ((cluster.isMaster && !pool2.socket) || !pool2.active || pool2.activeBlocktemplate === null) continue; if (Math.abs(pool2.activeBlocktemplate.height - pool.activeBlocktemplate.height) > 1000) continue; // different coin templates, can't compare here if (pool2.activeBlocktemplate.height > top_height) top_height = pool2.activeBlocktemplate.height; } From 5f6388739e830fda2d2ecbd9adfd6bce9f0e2f03 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 18 May 2018 13:52:07 +0200 Subject: [PATCH 111/367] Reduced number of dependencies --- install.sh | 6 +++--- lib/support.js | 1 - package.json | 9 --------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index fa1b295..66636a9 100644 --- a/install.sh +++ b/install.sh @@ -9,12 +9,12 @@ fi CURUSER=$(whoami) sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade -sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git python-virtualenv python3-virtualenv curl ntp build-essential screen cmake pkg-config libboost-all-dev libevent-dev libunbound-dev libminiupnpc-dev libunwind8-dev liblzma-dev libldns-dev libexpat1-dev libgtest-dev libzmq3-dev +sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl build-essential cmake cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash source ~/.nvm/nvm.sh -nvm install v6.9.2 +nvm install v8.9.3 cd ~/xmr-node-proxy npm install || exit 1 npm install -g pm2 @@ -22,7 +22,7 @@ cp config_example.json config.json openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.proxy" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 cd ~ pm2 status -sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v6.9.2/bin `pwd`/.nvm/versions/node/v6.9.2/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` +sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v8.9.3/bin `pwd`/.nvm/versions/node/v8.9.3/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` sudo chown -R $CURUSER. ~/.pm2 echo "Installing pm2-logrotate in the background!" pm2 install pm2-logrotate diff --git a/lib/support.js b/lib/support.js index 7467fdc..e5c7f09 100644 --- a/lib/support.js +++ b/lib/support.js @@ -1,7 +1,6 @@ "use strict"; const CircularBuffer = require('circular-buffer'); const request = require('request'); -const moment = require('moment'); const debug = require('debug')('support'); const fs = require('fs'); diff --git a/package.json b/package.json index 3ed9e36..014715b 100644 --- a/package.json +++ b/package.json @@ -19,20 +19,11 @@ "dependencies": { "async": "2.1.4", "bignum": "^0.12.5", - "body-parser": "^1.16.0", "circular-buffer": "1.0.2", - "cluster": "0.7.7", - "cors": "^2.8.1", - "crypto": "0.0.3", "debug": "2.5.1", "express": "4.14.0", - "jsonwebtoken": "^7.2.1", "minimist": "1.2.0", - "moment": "2.21.0", - "range": "0.0.3", "request": "^2.79.0", - "request-json": "0.6.1", - "sprintf-js": "^1.0.3", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.0.0" From 45c4d38d309461e86030d25edbfaa40163a2f56f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 18 May 2018 14:26:29 +0200 Subject: [PATCH 112/367] Added missing deps --- install.sh | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 66636a9..1f47a92 100644 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ fi CURUSER=$(whoami) sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade -sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl build-essential cmake +sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl build-essential cmake python-virtualenv libboost-all-dev cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash diff --git a/package.json b/package.json index 014715b..100c69b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "debug": "2.5.1", "express": "4.14.0", "minimist": "1.2.0", + "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.0", From 472ed0aa43b05eb535df1d9a5f41f28d1e7e4e6c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:15:40 +0200 Subject: [PATCH 113/367] Added support for Windows host (via Docker) --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e08dcf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:18.04 + +RUN apt-get update \ + && apt-get install -y curl gnupg \ + && curl -fsSL https://deb.nodesource.com/setup_8.x -o /tmp/node_setup.sh \ + && bash /tmp/node_setup.sh \ + && rm /tmp/node_setup.sh \ + && apt-get install -y nodejs git make g++ libboost-dev libboost-system-dev libboost-date-time-dev \ + && git clone https://github.com/MoneroOcean/xmr-node-proxy /xmr-node-proxy \ + && cd /xmr-node-proxy \ + && npm install \ + && cp -n config_example.json config.json \ + && openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.proxy" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 + +EXPOSE 8080 8443 3333 + +WORKDIR /xmr-node-proxy +CMD ./update.sh && node proxy.js From 3629edb60af7f070da9f6e46060f9c5eac4ac745 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:40:25 +0200 Subject: [PATCH 114/367] Added support for Windows host (via Docker) --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc300c1..f02f449 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,57 @@ cd xmr-node-proxy git remote set-url origin https://github.com/MoneroOcean/xmr-node-proxy.git && git pull -X theirs --no-edit && npm update ``` +## Deployment via Docker on Windows 10 with the Fall Creators Update (1709) or newer + +1. Install and run (Docker for Windows)[https://docs.docker.com/docker-for-windows/install/] with Linux containers mode. + +2. Get xmr-node-proxy sources by downloading and unpacking the latest [xmr-node-proxy](https://github.com/MoneroOcean/xmr-node-proxy/archive/master.zip) +archive to xmr-node-proxy-master directory. + +3. Got to xmr-node-proxy-master directory in Windows "Command Prompt" and build xmr-node-proxy Docker image: + +``` +docker build . -t xmr-node-proxy +``` + +4. Copy config_example.json to config.json and edit config.json file as desired (do not forget to update default XMR wallet). + +5. Create xnp Docker contained based on xmr-node-proxy image (make sure to update port numbers if you changed them in config.json): + +``` +docker create -p 3333:3333 -p 8080:8080 -p 8443:8443 --name xnp xmr-node-proxy +``` + +6. Copy your modified config.json to xnp Docker container: + +``` +docker cp config.json xnp:/xmr-node-proxy +``` + +7. Run xnp Docker container (or attach or already running one): + +``` +docker start --attach xnp +``` + +8. Stop xnp Docker container: + +``` +docker stop xnp +``` + +9. Delete xnp Docker container: + +``` +docker rm xnp +``` + +9. Delete xmr-node-proxy Docker image: + +``` +docker rmi xmr-node-proxy +``` + ## Deployment via Installer 1. Create a user 'nodeproxy' and assign a password (or add an SSH key. If you prefer that, you should already know how to do it) @@ -42,13 +93,13 @@ echo "nodeproxy ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers curl -L https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh | bash ``` -3. Once it's complete, copy `example_config.json` to `config.json` and edit as desired. +3. Once it's complete, copy `config_example.json` to `config.json` and edit as desired. 4. Run: `source ~/.bashrc` This will activate NVM and get things working for the following pm2 steps. 8. Once you're happy with the settings, go ahead and start all the proxy daemon, commands follow. ```shell cd ~/xmr-node-proxy/ -pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm Z" +pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm:ss:SSS Z" pm2 save ``` You can check the status of your proxy by either issuing From 905bb784d8411733f5cb969d0e04873d601a43f2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:42:16 +0200 Subject: [PATCH 115/367] Fixed links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f02f449..3f922e4 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ cd xmr-node-proxy git remote set-url origin https://github.com/MoneroOcean/xmr-node-proxy.git && git pull -X theirs --no-edit && npm update ``` -## Deployment via Docker on Windows 10 with the Fall Creators Update (1709) or newer +## Deployment via Docker on Windows 10 with the Fall Creators Update (or newer) -1. Install and run (Docker for Windows)[https://docs.docker.com/docker-for-windows/install/] with Linux containers mode. +1. Install and run [Docker for Windows](https://docs.docker.com/docker-for-windows/install/) with Linux containers mode. 2. Get xmr-node-proxy sources by downloading and unpacking the latest [xmr-node-proxy](https://github.com/MoneroOcean/xmr-node-proxy/archive/master.zip) archive to xmr-node-proxy-master directory. From 95df7f3023cf9b5ffb971859675d94c3eb3b5c3c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:43:32 +0200 Subject: [PATCH 116/367] Fixed numbering --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f922e4..8fad634 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ docker stop xnp docker rm xnp ``` -9. Delete xmr-node-proxy Docker image: +10. Delete xmr-node-proxy Docker image: ``` docker rmi xmr-node-proxy From a9ce09580a5a9a34d23b1c1b83a54a87f9bc578e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:44:39 +0200 Subject: [PATCH 117/367] Grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fad634..971d4a7 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ docker create -p 3333:3333 -p 8080:8080 -p 8443:8443 --name xnp xmr-node-proxy docker cp config.json xnp:/xmr-node-proxy ``` -7. Run xnp Docker container (or attach or already running one): +7. Run xnp Docker container (or attach to already running one): ``` docker start --attach xnp From fd09c7672bb083d3fb29b0cbd3d7ea708f7a38ba Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 19 May 2018 13:48:00 +0200 Subject: [PATCH 118/367] More clear intructions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 971d4a7..c85b939 100644 --- a/README.md +++ b/README.md @@ -54,19 +54,19 @@ docker cp config.json xnp:/xmr-node-proxy docker start --attach xnp ``` -8. Stop xnp Docker container: +8. Stop xnp Docker container (to start it again with update): ``` docker stop xnp ``` -9. Delete xnp Docker container: +9. Delete xnp Docker container (if you want to create it again with different ports): ``` docker rm xnp ``` -10. Delete xmr-node-proxy Docker image: +10. Delete xmr-node-proxy Docker image (if you no longer need proxy): ``` docker rmi xmr-node-proxy From 6469fd4dddac991a2e05b2c60c764df28067bfc8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 20 May 2018 07:57:02 +0200 Subject: [PATCH 119/367] Moved Win instruction below in readme --- README.md | 97 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index c85b939..022edb4 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,55 @@ cd xmr-node-proxy git remote set-url origin https://github.com/MoneroOcean/xmr-node-proxy.git && git pull -X theirs --no-edit && npm update ``` +## Deployment via Installer on Linux + +1. Create a user 'nodeproxy' and assign a password (or add an SSH key. If you prefer that, you should already know how to do it) + +```bash +useradd -d /home/nodeproxy -m -s /bin/bash nodeproxy +passwd nodeproxy +``` + +2. Add your user to `/etc/sudoers`, this must be done so the script can sudo up and do it's job. We suggest passwordless sudo. Suggested line: ` ALL=(ALL) NOPASSWD:ALL`. Our sample builds use: `nodeproxy ALL=(ALL) NOPASSWD:ALL` + +```bash +echo "nodeproxy ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +``` + +3. Log in as the **NON-ROOT USER** you just created and run the [deploy script](https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh). This is very important! This script will install the proxy to whatever user it's running under! + +```bash +curl -L https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh | bash +``` + +3. Once it's complete, copy `config_example.json` to `config.json` and edit as desired. +4. Run: `source ~/.bashrc` This will activate NVM and get things working for the following pm2 steps. +8. Once you're happy with the settings, go ahead and start all the proxy daemon, commands follow. + +```shell +cd ~/xmr-node-proxy/ +pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm:ss:SSS Z" +pm2 save +``` +You can check the status of your proxy by either issuing + +``` +pm2 logs proxy +``` + +or using the pm2 monitor + +``` +pm2 monit +``` + +## Updating xmr-node-proxy + +```bash +cd xmr-node-proxy +./update.sh +``` + ## Deployment via Docker on Windows 10 with the Fall Creators Update (or newer) 1. Install and run [Docker for Windows](https://docs.docker.com/docker-for-windows/install/) with Linux containers mode. @@ -72,54 +121,6 @@ docker rm xnp docker rmi xmr-node-proxy ``` -## Deployment via Installer - -1. Create a user 'nodeproxy' and assign a password (or add an SSH key. If you prefer that, you should already know how to do it) - -```bash -useradd -d /home/nodeproxy -m -s /bin/bash nodeproxy -passwd nodeproxy -``` - -2. Add your user to `/etc/sudoers`, this must be done so the script can sudo up and do it's job. We suggest passwordless sudo. Suggested line: ` ALL=(ALL) NOPASSWD:ALL`. Our sample builds use: `nodeproxy ALL=(ALL) NOPASSWD:ALL` - -```bash -echo "nodeproxy ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers -``` - -3. Log in as the **NON-ROOT USER** you just created and run the [deploy script](https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh). This is very important! This script will install the proxy to whatever user it's running under! - -```bash -curl -L https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh | bash -``` - -3. Once it's complete, copy `config_example.json` to `config.json` and edit as desired. -4. Run: `source ~/.bashrc` This will activate NVM and get things working for the following pm2 steps. -8. Once you're happy with the settings, go ahead and start all the proxy daemon, commands follow. - -```shell -cd ~/xmr-node-proxy/ -pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm:ss:SSS Z" -pm2 save -``` -You can check the status of your proxy by either issuing - -``` -pm2 logs proxy -``` - -or using the pm2 monitor - -``` -pm2 monit -``` - -## Updating xmr-node-proxy - -```bash -cd xmr-node-proxy -./update.sh -``` ## Configuration BKMs From ce5cd42e9ec783207b8a9e86a19d60d23a9e536b Mon Sep 17 00:00:00 2001 From: 1rV1N <34376228+1rV1N-git@users.noreply.github.com> Date: Fri, 8 Jun 2018 10:47:08 +0300 Subject: [PATCH 120/367] Fix algo variant --- lib/xmr.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 711f01e..12df03b 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -65,8 +65,8 @@ function parse_algo_variant(algo_str, variant) { case 'cn-lite/ipbc': case 'cryptonight-lite/ipbc': return 2; - case 'cn-lite/xtl': - case 'cryptonight-lite/xtl': return 3; + case 'cn/xtl': + case 'cryptonight/xtl': return 3; case 'cn': case 'cryptonight': @@ -346,4 +346,4 @@ module.exports = function () { MasterBlockTemplate: MasterBlockTemplate, getMasterJob: getMasterJob }; -}; \ No newline at end of file +}; From 15d5e8f05c83edd32ee564bb6a5eb8016387a074 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 14 Jun 2018 11:27:46 +0200 Subject: [PATCH 121/367] Added XHV and MSR support for new PoW --- install.sh | 1 + lib/xmr.js | 9 +++++++-- package.json | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 1f47a92..73d723a 100644 --- a/install.sh +++ b/install.sh @@ -15,6 +15,7 @@ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash source ~/.nvm/nvm.sh nvm install v8.9.3 +nvm alias default v8.9.3 cd ~/xmr-node-proxy npm install || exit 1 npm install -g pm2 diff --git a/lib/xmr.js b/lib/xmr.js index 12df03b..89c834d 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -60,13 +60,18 @@ function parse_algo_variant(algo_str, variant) { case 'cn/1': case 'cryptonight/1': case 'cn-lite/1': - case 'cryptonight-lite/1': return 1; + case 'cryptonight-lite/1': + case 'cn-heavy/xhv': + case 'cryptonight-heavy/xhv': return 1; case 'cn-lite/ipbc': case 'cryptonight-lite/ipbc': return 2; case 'cn/xtl': - case 'cryptonight/xtl': return 3; + case 'cryptonight/xtl': return 3; + + case 'cn/msr': + case 'cryptonight/msr': return 4; case 'cn': case 'cryptonight': diff --git a/package.json b/package.json index 100c69b..a766d9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.1.5", + "version": "0.1.6", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.0" } } From dd945550382376a90403671a04b30a8da6c21616 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 14 Jun 2018 11:29:41 +0200 Subject: [PATCH 122/367] Fixed version --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index c106568..d206991 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.1.5"; +const PROXY_VERSION = "0.1.6"; /* General file design/where to find things. From cf4008ff082f67e6caf03ae6665534dea8dddeb2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 17 Jun 2018 23:35:12 +0200 Subject: [PATCH 123/367] Fixed case when miner diff exceed pool diff --- proxy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy.js b/proxy.js index d206991..a6a4cfa 100644 --- a/proxy.js +++ b/proxy.js @@ -915,6 +915,9 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (this.newDiff < this.coinSettings.minDiff) { this.newDiff = this.coinSettings.minDiff; } + if (activePools[this.pool].activeBlocktemplate !== null && this.newDiff > activePools[this.pool].activeBlocktemplate.targetDiff) { + this.newDiff = activePools[this.pool].activeBlocktemplate.targetDiff; + } if (this.difficulty === this.newDiff) { return; } From b94c49f0b460a8298ed45894cec9b8d77da5ae8d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 17 Jun 2018 23:47:53 +0200 Subject: [PATCH 124/367] Fixed case when miner diff exceed pool diff --- proxy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy.js b/proxy.js index a6a4cfa..33e89fb 100644 --- a/proxy.js +++ b/proxy.js @@ -931,6 +931,8 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { }; this.getJob = this.coinFuncs.getJob; + + this.setNewDiff(this.difficulty); } // Slave Functions From cd6114be195faf70ec6e15d020f464a408ead989 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 17 Jun 2018 23:52:08 +0200 Subject: [PATCH 125/367] Fixed bug in prev commit --- proxy.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 33e89fb..a528a3e 100644 --- a/proxy.js +++ b/proxy.js @@ -903,7 +903,10 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { // Support functions for how miners activate and run. this.updateDifficulty = function(){ if (this.hashes > 0 && !this.fixed_diff) { - this.setNewDiff(Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * this.coinSettings.shareTargetTime); + const new_diff = Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * this.coinSettings.shareTargetTime; + if (this.setNewDiff(new_diff)) { + this.messageSender('job', this.getJob(activeMiners[this.id], activePools[this.pool].activeBlocktemplate)); + } } }; @@ -919,7 +922,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.newDiff = activePools[this.pool].activeBlocktemplate.targetDiff; } if (this.difficulty === this.newDiff) { - return; + return false; } debug.diff(global.threadName + "Difficulty change to: " + this.newDiff + " For: " + this.logString); if (this.hashes > 0){ @@ -927,7 +930,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))) + " hashes/second or: " + Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))) *this.coinSettings.shareTargetTime + " difficulty versus: " + this.newDiff); } - this.messageSender('job', this.getJob(activeMiners[this.id], activePools[this.pool].activeBlocktemplate)); + return true; }; this.getJob = this.coinFuncs.getJob; From f817993aac3133cc67c2ecd48613abd6d455319e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 00:03:17 +0200 Subject: [PATCH 126/367] More strict worker max_diff limitation --- lib/xmr.js | 7 +++++-- proxy.js | 5 ----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 89c834d..7353e87 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -167,7 +167,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { } let blob = activeBlockTemplate.nextBlob(); - let target = getTargetHex(miner); + let target = getTargetHex(miner, activeBlockTemplate.targetDiff); miner.lastBlockHeight = activeBlockTemplate.height; let newJob = { @@ -225,11 +225,14 @@ function getMasterJob(pool, workerID) { return workerData; } -function getTargetHex(miner) { +function getTargetHex(miner, max_diff) { if (miner.newDiff) { miner.difficulty = miner.newDiff; miner.newDiff = null; } + if (miner.difficulty > max_diff) { + miner.difficulty = max_diff; + } let padded = Buffer.alloc(32); let diffBuff = baseDiff.div(miner.difficulty).toBuffer(); diffBuff.copy(padded, 32 - diffBuff.length); diff --git a/proxy.js b/proxy.js index a528a3e..b4edb04 100644 --- a/proxy.js +++ b/proxy.js @@ -918,9 +918,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (this.newDiff < this.coinSettings.minDiff) { this.newDiff = this.coinSettings.minDiff; } - if (activePools[this.pool].activeBlocktemplate !== null && this.newDiff > activePools[this.pool].activeBlocktemplate.targetDiff) { - this.newDiff = activePools[this.pool].activeBlocktemplate.targetDiff; - } if (this.difficulty === this.newDiff) { return false; } @@ -934,8 +931,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { }; this.getJob = this.coinFuncs.getJob; - - this.setNewDiff(this.difficulty); } // Slave Functions From dd99a5c89ba702605e9e46a7ff8d60490ac5a745 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 16:29:04 +0200 Subject: [PATCH 127/367] Fixed https://github.com/MoneroOcean/xmr-node-proxy/issues/41 --- proxy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index b4edb04..fe48ff3 100644 --- a/proxy.js +++ b/proxy.js @@ -896,7 +896,8 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { pool: this.pool, id: this.id, identifier: this.identifier, - ip: this.ip + ip: this.ip, + agent: this.agent, }; }; @@ -1117,6 +1118,7 @@ function activateHTTP() { + `; } @@ -1170,6 +1172,7 @@ function activateHTTP() { + ${tableBody} From e76ab8913e8694abe3294562f618d7e7033f55c2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 16:32:24 +0200 Subject: [PATCH 128/367] Increased tab --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index fe48ff3..603ccc0 100644 --- a/proxy.js +++ b/proxy.js @@ -1172,7 +1172,7 @@ function activateHTTP() { - + ${tableBody} From 1b978fb952119835cfa333897f942e405281b248 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 17:23:35 +0200 Subject: [PATCH 129/367] Fixed https://github.com/MoneroOcean/xmr-node-proxy/issues/36 --- config_example.json | 2 ++ proxy.js | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/config_example.json b/config_example.json index a2d3524..f39bcdc 100644 --- a/config_example.json +++ b/config_example.json @@ -54,6 +54,8 @@ "httpEnable": false, "httpAddress": "127.0.0.1", "httpPort": "8081", + "httpUser": "", + "httpPass": "", "minerInactivityTime": "120", "coinSettings": { "xmr":{ diff --git a/proxy.js b/proxy.js index 603ccc0..6a30880 100644 --- a/proxy.js +++ b/proxy.js @@ -1091,6 +1091,26 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m function activateHTTP() { var jsonServer = http.createServer((req, res) => { + if (global.config.httpUser && global.config.httpPass) { + var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 + if (!auth) { + res.writeHead(401); + res.end(); + return; + } + var tmp = auth.split(' '); + var buf = new Buffer(tmp[1], 'base64'); + var plain_auth = buf.toString(); + var creds = plain_auth.split(':'); + var username = creds[0]; + var password = creds[1]; + if (username !== global.config.httpUser || password !== global.config.httpPass) { + res.writeHead(401); + res.end(); + return; + } + } + if (req.url == "/") { let totalWorkers = 0, totalHashrate = 0; let poolHashrate = []; From 2467b13be3f25fb904c23ac93f7900bb834db181 Mon Sep 17 00:00:00 2001 From: Learner Date: Tue, 19 Jun 2018 02:41:05 +0700 Subject: [PATCH 130/367] Add http message when access is denied It gives better info. --- proxy.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/proxy.js b/proxy.js index 6a30880..8c540a6 100644 --- a/proxy.js +++ b/proxy.js @@ -1094,10 +1094,12 @@ function activateHTTP() { if (global.config.httpUser && global.config.httpPass) { var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 if (!auth) { - res.writeHead(401); - res.end(); + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Secure Area"'); + res.end('Unauthorized XNP access.'); return; } + console.log("Authorization Header is: ", auth); var tmp = auth.split(' '); var buf = new Buffer(tmp[1], 'base64'); var plain_auth = buf.toString(); @@ -1105,8 +1107,9 @@ function activateHTTP() { var username = creds[0]; var password = creds[1]; if (username !== global.config.httpUser || password !== global.config.httpPass) { - res.writeHead(401); - res.end(); + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Secure Area"'); + res.end('Wrong login.'); return; } } From bcc932db1406109113e1f33692e284dc6420f7e9 Mon Sep 17 00:00:00 2001 From: Learner Date: Tue, 19 Jun 2018 02:51:38 +0700 Subject: [PATCH 131/367] More log --- proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy.js b/proxy.js index 8c540a6..44e2a7a 100644 --- a/proxy.js +++ b/proxy.js @@ -1103,6 +1103,7 @@ function activateHTTP() { var tmp = auth.split(' '); var buf = new Buffer(tmp[1], 'base64'); var plain_auth = buf.toString(); + console.log("Decoded Authorization ", plain_auth); var creds = plain_auth.split(':'); var username = creds[0]; var password = creds[1]; From 6fad74cb972a31b7e54c69a28af2e6bac3e233c9 Mon Sep 17 00:00:00 2001 From: Learner Date: Tue, 19 Jun 2018 03:27:19 +0700 Subject: [PATCH 132/367] Change log to debug Mo --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 44e2a7a..2a6813d 100644 --- a/proxy.js +++ b/proxy.js @@ -1099,7 +1099,7 @@ function activateHTTP() { res.end('Unauthorized XNP access.'); return; } - console.log("Authorization Header is: ", auth); + console.debug("Authorization Header is: ", auth); var tmp = auth.split(' '); var buf = new Buffer(tmp[1], 'base64'); var plain_auth = buf.toString(); From 131d148f28900bac02ce25a3aa1329fdb5111cde Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 22:35:28 +0200 Subject: [PATCH 133/367] Fixed logging --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 2a6813d..732b6fa 100644 --- a/proxy.js +++ b/proxy.js @@ -1099,11 +1099,11 @@ function activateHTTP() { res.end('Unauthorized XNP access.'); return; } - console.debug("Authorization Header is: ", auth); + debug.workers("Authorization Header is: ", auth); var tmp = auth.split(' '); var buf = new Buffer(tmp[1], 'base64'); var plain_auth = buf.toString(); - console.log("Decoded Authorization ", plain_auth); + debug.workers("Decoded Authorization ", plain_auth); var creds = plain_auth.split(':'); var username = creds[0]; var password = creds[1]; From 495299ac2fca6c604aa68b0162d7f73aadb68de2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Jun 2018 22:36:32 +0200 Subject: [PATCH 134/367] Separated http auth log to new class --- proxy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 732b6fa..40e1e41 100644 --- a/proxy.js +++ b/proxy.js @@ -33,7 +33,8 @@ let debug = { shares: require('debug')('shares'), miners: require('debug')('miners'), workers: require('debug')('workers'), - balancer: require('debug')('balancer') + balancer: require('debug')('balancer'), + misc: require('debug')('misc') }; global.threadName = ''; let nonceCheck = new RegExp("^[0-9a-f]{8}$"); @@ -1099,11 +1100,11 @@ function activateHTTP() { res.end('Unauthorized XNP access.'); return; } - debug.workers("Authorization Header is: ", auth); + debug.misc("Authorization Header is: ", auth); var tmp = auth.split(' '); var buf = new Buffer(tmp[1], 'base64'); var plain_auth = buf.toString(); - debug.workers("Decoded Authorization ", plain_auth); + debug.misc("Decoded Authorization ", plain_auth); var creds = plain_auth.split(':'); var username = creds[0]; var password = creds[1]; From 762a96981e9edacb3cf529d3d4911e5b9d59c326 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 19 Jun 2018 17:41:58 +0200 Subject: [PATCH 135/367] Added infor about Fonero --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 022edb4..8a42930 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Supports all known cryptonight/heavy/light coins: * Sumokoin (SUMO), Haven (XHV), Loki (LOKI) * ... +... except Fonero. ## Setup Instructions From 89da8051e2ed2c1b3a4e254b4edb00e8d95b0f20 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 26 Jun 2018 18:31:10 +0200 Subject: [PATCH 136/367] Added ARM support --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a766d9e..d051c7a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.1", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.1" } } From 1c3699ea3d007853eeb24d88d5fa4d5b3c54eab9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 27 Jun 2018 10:31:57 +0200 Subject: [PATCH 137/367] Disabled https://github.com/MoneroOcean/node-cryptonight-hashing/issues/1 fix that breaks stuff on Ubuntu 18.04 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d051c7a..9c5b659 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.1", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.2" } } From 31b2965a9203f1b040e336b3b97ee5474dbead98 Mon Sep 17 00:00:00 2001 From: djfinch Date: Tue, 3 Jul 2018 13:41:09 +0200 Subject: [PATCH 138/367] Dashboard update. Miner agent inside tooltip to save some space in the dashboard. --- proxy.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 40e1e41..799774f 100644 --- a/proxy.js +++ b/proxy.js @@ -1143,7 +1143,7 @@ function activateHTTP() { - + `; } @@ -1181,6 +1181,43 @@ function activateHTTP() { background-color: #eeeeee; cursor: pointer; } + .tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; + } + + .tooltip .tooltiptext { + visibility: hidden; + width: 140px; + background-color: #000; + color: #fff; + text-align: center; + padding: 5px 0; + border-radius: 6px; + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -70px; + opacity: 0; + transition: opacity 0.3s; + } + + .tooltip .tooltiptext::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #000 transparent transparent transparent; + } + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + }

XNP v${PROXY_VERSION} Hashrate Monitor

From 27c9d7499786edbac0f6376adb790d155937393a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 3 Jul 2018 15:24:41 +0200 Subject: [PATCH 139/367] Pretty printing --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 40e1e41..818fd75 100644 --- a/proxy.js +++ b/proxy.js @@ -637,7 +637,7 @@ function enumerateWorkerStats() { delete activeWorkers[poolID][workerID]; continue; } - stats.miners += 1; + ++ stats.miners; stats.hashes += workerData.hashes; stats.hashRate += workerData.avgSpeed; stats.diff += workerData.diff; From d32ad00624346b4f1db5fc716de3802752c77c67 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 3 Jul 2018 15:27:31 +0200 Subject: [PATCH 140/367] More informative short agent version --- proxy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 27bb30e..97947e5 100644 --- a/proxy.js +++ b/proxy.js @@ -1132,6 +1132,7 @@ function activateHTTP() { totalHashrate += miner.avgSpeed; if (!poolHashrate[miner.pool]) poolHashrate[miner.pool] = 0; poolHashrate[miner.pool] += miner.avgSpeed; + let agent_parts = miner.agent.split(" "); tableBody += ` @@ -1143,7 +1144,7 @@ function activateHTTP() { - + `; } From 0a00af7c5d25dd21725f4ee8e4044989f7bfb37c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 3 Jul 2018 17:01:14 +0200 Subject: [PATCH 141/367] Added functionality to keep offline miners --- proxy.js | 83 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/proxy.js b/proxy.js index 97947e5..a1964ca 100644 --- a/proxy.js +++ b/proxy.js @@ -880,11 +880,12 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.identifier = pass_split[0]; this.minerStats = function(){ - if (this.socket.destroyed){ + if (this.socket.destroyed && !global.config.keepOfflineMiners){ delete activeMiners[this.id]; return; } return { + active: !this.socket.destroyed, shares: this.shares, blocks: this.blocks, hashes: this.hashes, @@ -1001,6 +1002,17 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m } process.send({type: 'newMiner', data: miner.port}); activeMiners[minerId] = miner; + // clean old miners with the same name/ip/agent + if (global.config.keepOfflineMiners) { + for (let miner_id in activeMiners) { + if (activeMiners.hasOwnProperty(miner_id)) { + let realMiner = activeMiners[miner_id]; + if (realMiner.socket.destroyed && realMiner.identifier === miner.identifier && realMiner.ip === miner.ip && realMiner.agent === miner.agent) { + delete activeMiners[miner_id]; + } + } + } + } sendReply(null, { id: minerId, job: miner.getJob(miner, activePools[miner.pool].activeBlocktemplate), @@ -1117,38 +1129,59 @@ function activateHTTP() { } if (req.url == "/") { - let totalWorkers = 0, totalHashrate = 0; - let poolHashrate = []; - let tablePool = ""; - let tableBody = ""; + let miners = {}; + let offline_miners = {}; + let miner_names = {}; for (let workerID in activeWorkers) { if (!activeWorkers.hasOwnProperty(workerID)) continue; for (let minerID in activeWorkers[workerID]){ if (!activeWorkers[workerID].hasOwnProperty(minerID)) continue; let miner = activeWorkers[workerID][minerID]; if (typeof(miner) === 'undefined' || !miner) continue; - let name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; - ++ totalWorkers; - totalHashrate += miner.avgSpeed; - if (!poolHashrate[miner.pool]) poolHashrate[miner.pool] = 0; - poolHashrate[miner.pool] += miner.avgSpeed; - let agent_parts = miner.agent.split(" "); - tableBody += ` - - - - - - - - - - - - - `; + if (miner.active) { + miners[miner.id] = miner; + const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + miner_names[name] = 1; + } else { + offline_miners[miner.id] = miner; + } } } + for (let offline_miner_id in offline_miners) { + const miner = offline_miners[offline_miner_id]; + const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + if (name in miner_names) continue; + miners[miner.id] = miner; + miner_names[name] = 1; + } + let totalWorkers = 0, totalHashrate = 0; + let poolHashrate = []; + let tablePool = ""; + let tableBody = ""; + for (let miner_id in miners) { + const miner = miners[miner_id]; + const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + ++ totalWorkers; + totalHashrate += miner.avgSpeed; + if (!poolHashrate[miner.pool]) poolHashrate[miner.pool] = 0; + poolHashrate[miner.pool] += miner.avgSpeed; + let avgSpeed = miner.active ? miner.avgSpeed : "offline"; + let agent_parts = miner.agent.split(" "); + tableBody += ` + + + + + + + + + + + + + `; + } for (let poolName in poolHashrate) { let poolPercentage = (100*poolHashrate[poolName]/totalHashrate).toFixed(2); let targetDiff = activePools[poolName].activeBlocktemplate ? activePools[poolName].activeBlocktemplate.targetDiff : "?"; From d06ccdb809f89f849ecd9303601f917bbd5d20da Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 4 Jul 2018 13:37:15 +0200 Subject: [PATCH 142/367] Do not count ststs for offline miners --- proxy.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proxy.js b/proxy.js index a1964ca..0281181 100644 --- a/proxy.js +++ b/proxy.js @@ -1129,6 +1129,8 @@ function activateHTTP() { } if (req.url == "/") { + let totalWorkers = 0, totalHashrate = 0; + let poolHashrate = []; let miners = {}; let offline_miners = {}; let miner_names = {}; @@ -1142,6 +1144,10 @@ function activateHTTP() { miners[miner.id] = miner; const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; miner_names[name] = 1; + ++ totalWorkers; + totalHashrate += miner.avgSpeed; + if (!poolHashrate[miner.pool]) poolHashrate[miner.pool] = 0; + poolHashrate[miner.pool] += miner.avgSpeed; } else { offline_miners[miner.id] = miner; } @@ -1154,17 +1160,11 @@ function activateHTTP() { miners[miner.id] = miner; miner_names[name] = 1; } - let totalWorkers = 0, totalHashrate = 0; - let poolHashrate = []; let tablePool = ""; let tableBody = ""; for (let miner_id in miners) { const miner = miners[miner_id]; const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; - ++ totalWorkers; - totalHashrate += miner.avgSpeed; - if (!poolHashrate[miner.pool]) poolHashrate[miner.pool] = 0; - poolHashrate[miner.pool] += miner.avgSpeed; let avgSpeed = miner.active ? miner.avgSpeed : "offline"; let agent_parts = miner.agent.split(" "); tableBody += ` From 3a4763efb4bec97157d9eeea4fdd716564b13e36 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 5 Jul 2018 07:40:38 +0200 Subject: [PATCH 143/367] Moved to patched nodejs LTS release --- config_example.json | 1 + install.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config_example.json b/config_example.json index f39bcdc..8015e5b 100644 --- a/config_example.json +++ b/config_example.json @@ -57,6 +57,7 @@ "httpUser": "", "httpPass": "", "minerInactivityTime": "120", + "keepOfflineMiners": 0, "coinSettings": { "xmr":{ "minDiff": 100, diff --git a/install.sh b/install.sh index 73d723a..ccb9ea3 100644 --- a/install.sh +++ b/install.sh @@ -14,8 +14,8 @@ cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash source ~/.nvm/nvm.sh -nvm install v8.9.3 -nvm alias default v8.9.3 +nvm install v8.11.3 +nvm alias default v8.11.3 cd ~/xmr-node-proxy npm install || exit 1 npm install -g pm2 @@ -23,7 +23,7 @@ cp config_example.json config.json openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.proxy" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 cd ~ pm2 status -sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v8.9.3/bin `pwd`/.nvm/versions/node/v8.9.3/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` +sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v8.11.3/bin `pwd`/.nvm/versions/node/v8.11.3/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` sudo chown -R $CURUSER. ~/.pm2 echo "Installing pm2-logrotate in the background!" pm2 install pm2-logrotate From 239a5b585a9861d31e7ed22aceecba1357b2765e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 12 Jul 2018 10:40:35 +0200 Subject: [PATCH 144/367] Added TUBE/XAO/RTO support --- lib/xmr.js | 18 ++++++++++++------ package.json | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 7353e87..b2d0b39 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -55,23 +55,29 @@ function parse_algo_variant(algo_str, variant) { case 'cn/0': case 'cryptonight/0': case 'cn-lite/0': - case 'cryptonight-lite/0': return 0; + case 'cryptonight-lite/0': return 0; case 'cn/1': case 'cryptonight/1': case 'cn-lite/1': case 'cryptonight-lite/1': case 'cn-heavy/xhv': - case 'cryptonight-heavy/xhv': return 1; + case 'cryptonight-heavy/xhv': return 1; - case 'cn-lite/ipbc': - case 'cryptonight-lite/ipbc': return 2; + case 'cn-heavy/tube': + case 'cryptonight-heavy/tube': return 2; case 'cn/xtl': - case 'cryptonight/xtl': return 3; + case 'cryptonight/xtl': return 3; case 'cn/msr': - case 'cryptonight/msr': return 4; + case 'cryptonight/msr': return 4; + + case 'cn/xao': + case 'cryptonight/xao': return 5; + + case 'cn/rto': + case 'cryptonight/rto': return 6; case 'cn': case 'cryptonight': diff --git a/package.json b/package.json index 9c5b659..9418f4f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.1", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.1.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.2.0" } } From e37f2ddbcb3192914e512458a673f3c0d193f6a5 Mon Sep 17 00:00:00 2001 From: djfinch Date: Thu, 12 Jul 2018 21:33:56 +0200 Subject: [PATCH 145/367] favicon --- proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy.js b/proxy.js index 0281181..afdabf6 100644 --- a/proxy.js +++ b/proxy.js @@ -1194,6 +1194,7 @@ function activateHTTP() { XNP v${PROXY_VERSION} Hashrate Monitor + - -

XNP v${PROXY_VERSION} Hashrate Monitor

-

Workers: ${totalWorkers}, Hashrate: ${totalHashrate}

- ${tablePool} -
${moment.unix(miner.lastContact).fromNow(true)} ${moment(miner.connectTime).fromNow(true)} ${miner.pool}${miner.agent}
Ping Ago Connected Ago PoolAgent
Ping Ago Connected Ago PoolAgentAgent
${moment.unix(miner.lastContact).fromNow(true)} ${moment(miner.connectTime).fromNow(true)} ${miner.pool}${miner.agent}
Info${miner.agent}
${name}${moment.unix(miner.lastContact).fromNow(true)} ${moment(miner.connectTime).fromNow(true)} ${miner.pool}
Info${miner.agent}
${agent_parts[0]}${miner.agent}
${name}${miner.avgSpeed}${miner.diff}${miner.shares}${miner.hashes}${moment.unix(miner.lastShare).fromNow(true)}${moment.unix(miner.lastContact).fromNow(true)}${moment(miner.connectTime).fromNow(true)}${miner.pool}
${agent_parts[0]}${miner.agent}
${name}${avgSpeed}${miner.diff}${miner.shares}${miner.hashes}${moment.unix(miner.lastShare).fromNow(true)}${moment.unix(miner.lastContact).fromNow(true)}${moment(miner.connectTime).fromNow(true)}${miner.pool}
${agent_parts[0]}${miner.agent}
- - - - - - - - - - - - - - ${tableBody} - -
NameHashrateDifficultySharesHashesShare AgoPing AgoConnected AgoPoolAgent
+ +

XNP v${PROXY_VERSION} Hashrate Monitor

+
+

Workers: ${totalWorkers}, Hashrate: ${totalHashrate}

+ ${tablePool} + + + + + + + + + + + + + + + ${tableBody} + +
NameHashrateDifficultySharesHashesShare AgoPing AgoConnected AgoPoolAgent
+
`); @@ -1553,7 +1588,7 @@ if (cluster.isMaster) { connectPools(); setInterval(enumerateWorkerStats, 15*1000); setInterval(balanceWorkers, 90*1000); - if (global.config.httpEnable) { + if (global.config.httpEnable) { console.log("Activating Web API server on " + (global.config.httpAddress || "localhost") + ":" + (global.config.httpPort || "8081")); activateHTTP(); } From 5f782813f82c27f624b7f6effb20b28f351cca02 Mon Sep 17 00:00:00 2001 From: djfinch Date: Sun, 15 Jul 2018 17:14:05 +0200 Subject: [PATCH 148/367] Fix sorting of table. --- proxy.js | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 024e816..98d588b 100644 --- a/proxy.js +++ b/proxy.js @@ -1361,7 +1361,70 @@ function activateHTTP() { } window.setInterval(function(){ - $( "#content" ).load( "/ #content" ); + $( "#content" ).load( "/ #content", function() { + $('table.sorted-table thead th').on("mouseover", function() { + var el = $(this), + pos = el.index(); + el.addClass("hover"); + $('table.sorted-table > tbody > tr > td').filter(":nth-child(" + (pos+1) + ")").addClass("hover"); + }).on("mouseout", function() { + $("td, th").removeClass("hover"); + }); + + var thIndex = 0, thInc = 1, curThIndex = null; + + $(function() { + $('table.sorted-table thead th').click(function() { + thIndex = $(this).index(); + sorting = []; + tbodyHtml = null; + $('table.sorted-table > tbody > tr').each(function() { + var str = $(this).children('td').eq(thIndex).html(); + var re1 = /^<.+>(\\d+)<\\/.+>$/; + var m; + if (m = re1.exec(str)) { + var pad = "000000000000"; + str = (pad + Number(m[1])).slice(-pad.length); + } + sorting.push(str + ', ' + $(this).index()); + }); + + if (thIndex != curThIndex || thInc == 1) { + sorting = sorting.sort(); + } else { + sorting = sorting.sort(function(a, b){return b.localeCompare(a)}); + } + + if (thIndex == curThIndex) { + thInc = 1 - thInc; + } else { + thInc = 0; + } + + curThIndex = thIndex; + sortIt(); + }); + }) + + function sortIt() { + for (var sortingIndex = 0; sortingIndex < sorting.length; sortingIndex++) { + rowId = parseInt(sorting[sortingIndex].split(', ')[1]); + tbodyHtml = tbodyHtml + $('table.sorted-table > tbody > tr').eq(rowId)[0].outerHTML; + } + $('table.sorted-table > tbody').html(tbodyHtml); + } + + function theme(body) { + var className = body.getAttribute("class"); + if (className == "light") { + body.className = "dark"; + global.config.theme = "dark"; + } else { + body.className = "light"; + global.config.theme = "light"; + } + } + }); }, ${global.config.refreshTime} * 1000); From 379c0e860a412335beb67f2498bd1d2fc3ec3f61 Mon Sep 17 00:00:00 2001 From: djfinch Date: Sun, 15 Jul 2018 17:52:54 +0200 Subject: [PATCH 149/367] Mobile capable app. --- proxy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy.js b/proxy.js index 98d588b..06c2c8a 100644 --- a/proxy.js +++ b/proxy.js @@ -1193,6 +1193,8 @@ function activateHTTP() { XNP v${PROXY_VERSION} Hashrate Monitor + +

XNP v${PROXY_VERSION} Hashrate Monitor

@@ -1299,135 +1234,14 @@ function activateHTTP() { + `); From d0a3cbb0d48296ebb63aaaf351edd4f1c5e7d054 Mon Sep 17 00:00:00 2001 From: djfinch Date: Tue, 17 Jul 2018 16:49:38 +0200 Subject: [PATCH 151/367] Link to MO dashboard. --- config_example.json | 1 + proxy.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config_example.json b/config_example.json index f16f0b9..fb7f559 100644 --- a/config_example.json +++ b/config_example.json @@ -60,6 +60,7 @@ "keepOfflineMiners": 0, "refreshTime": 30, "theme": "light", + "moDashboard": false, "coinSettings": { "xmr":{ "minDiff": 100, diff --git a/proxy.js b/proxy.js index c6e381d..8584f1b 100644 --- a/proxy.js +++ b/proxy.js @@ -1162,6 +1162,7 @@ function activateHTTP() { } let tablePool = ""; let tableBody = ""; + if (!global.config.moDashboard) global.config.moDashboard = false; for (let miner_id in miners) { const miner = miners[miner_id]; const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; @@ -1185,8 +1186,12 @@ function activateHTTP() { for (let poolName in poolHashrate) { let poolPercentage = (100*poolHashrate[poolName]/totalHashrate).toFixed(2); let targetDiff = activePools[poolName].activeBlocktemplate ? activePools[poolName].activeBlocktemplate.targetDiff : "?"; - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

- `; + let walletId = activePools[poolName].username + if (global.config.moDashboard == true && poolName.includes("moneroocean")) { + tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + } else { + tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + } } //expect old config @@ -1195,7 +1200,7 @@ function activateHTTP() { // cleaner way for icon, stylesheet, scripts let icon = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAABjCAYAAADaWl3LAAAACXBIWXMAAA9hAAAPYQGoP6dpAAANyklEQVR4Ae1daXRU1R2///smKzGQgJpAUgVRbHHBQkAWxSg0aIwgJOmhAc+xFtnUqqcfu+ScfusHETcktGq1aDJD8GgAQVlGsCUgGEsTtKeFGjCkshgge+a9e/u7EzJ5nUzITN5kFph7zpt337v7793lv907xOByVpbVMikruJTlB9av+Jd6F3O+EchZVTaJSbZIMraIVBSAB3+PkzVErNxFWkXNq7+o73l79d4lTV5dNlUTCjBaCBxu6sHCB3g9QcCXsQMMQOpcc9S88sQpT8iV7ikt5VO/GzNTSrmIkQRglO2ryZcDzxxf4GEfIpe7bLbKmpd/fsYceCX47ysttbWeyZgtBS8kRgsYkxkDtctf8Mz56OiSu9EvK/TEuM1fvvj4eXNgNPknFtnjk9IvzOGaXCQlzQdgIwOp/2DAM+ffhYePAWR5G3d9UPfa6hZzYCT6pz/3QpLRMSxPTfgYjgWo4/DB1tMqeOZy2/GwTRKVxyU0b92/5nn1HBFu4qpXU5JZfL5aJdG7HkKlhgWjYsEEz1MfZNqClelDyWRF+9kR2+scxaqHhtRNevbNEbYOVwFHD5PE8lB4YrArMCTgeVUSc6J8nyRVJGec2uUsLdW9woP2OPnJ9aM0G58vJStEmQ8g47igZe4jo1CAZy72LGjISiGo/FBGw15WWqpWcUsOgGVyGz3aPSTZbGSmWcowgMShBs9ctUZG5CDDKD+4fnk1Jm9FV/rlANgPSOMLOcMqydgMJMLoDL0LJ3ie1qIS9RhmdmK84sC6ZYc9ASYPALtJ06iwe5VkOaagsHkjAjyv1iveukJKXqFJHSOcQOXjYuxOr3hhf4xE8MIOir8VCMtc4W/lIj1eDDwLXygGXgw8CwhYSBrreVbBE5q8AyzNH0BrnbSQ19WS9CjEV6VciIluUqW31ZJyVm64F9T+EgAJ/pCN6A27qn0KMLsmDQd0PEd7kPACr+c1Y+OffikhzUiCGEeUAMx8hCT0hl4VPp+AmVveL3jmSEq8E9/ZBdaIAKSb+fYrnTmPKPEPCJi5HQGDkLPqjWxirsVSYGgTu92cWZT6AwLM3MaAwTMnnvzU+ttJpyVEcjGGtk8Nkzl+BPkHDZi5DZbA680oKhaaoADW22Z0F/NDMPwRttAEHTAzRkEHz5x5mBaaIQXM3L4hBc9c0BAvNCEDzNymkIFnLvT/bWPMIYPzf77uybC0I8bbDu57uVPFwIuBZwEBC0ljPc8CeDYLacOWFKtDPfhsJ1S9Tk0YznBVJCrA8war+vWV34QLMHO5EQneYMAqqdyTxYS4HeYcN0H2lo1emU1E2bDuTAcjdQ3kk7g81lEG/OpqwtWIMFi9UiPsaXCX3xokD0+o/ay2dABzkLDQR950XqBgLancm8mkfo9kYiYaPckt3ZEsDUAE07VAun4QH2M/SbFzfN1f93qDGRbwpq4s+8Y8Zw00DIvs29PjuQ12dXwOesY9QGhcMFHyLy/ZyCRtQq/+87vF97tNQsICnj+VXWLfPUGQLMCXfwTxlTFPyKyfBq4f7ZQkf08lm3buh4HNmk5xttJRXKzmgbA5NRyFcJVwYkth0HNH2CriZ8EAb1ePaVc9TGI3CmlsKi+cW+NnesvR1EQvmZEHA7MizF8YlpHUwy7fPDN4npgYy8dgdbgFu4KqGaf97y56oN4TaNHzmH3XGJ1oCqm5i9iDyO5HFrMMW3Kf4PWtjWzEBH8AveMYRO6nYOPbIAzZQBqdSrQlnmnu5HpLynmR0tIibfq1qZRgpDJDSyUyskAu3CgYjYUh4s2wUZ6C3pXZN//ofOMnnUeZ6I0LlNwZIKofxjExqXunq5PFg8lLb4NmkuOKR58Fuowri1n0r0u/3XMD3l9BLsbbWviYMfBi4FlAwELSWM+LgWcBAQtJYz3PAnh+kioWSghd0uOgi/6O4o5jS0s99szWC4M1cEYXyNZ1sUO/pjmtKV4/mX2aZxuG1uFKSpJMyxSGGA3xVSYjPhriq9FIdytoLbXPY8DdkNEKXgsoxr1Csj2QcnyuM+NLR/HcCwF+pzbEP4ertk86ZLq40jmBM2MaQJ0OTkuZ2GV5x/OTw/BOFvpngHVEENsM2vuTb0fxg87c3CHbANindQDzZ47dOVxjC5UXPTNbxYl08OpQUbtgmv29wtyv+zQqDC/u27PHlnVOLoQg9jlabN89G/zqbyE3uz8MdfFVJLaY0kaDGX8KhnSnyG7XOk4kpRmJPB12xCPAn8djjtN0Yhp+2nUS34sEo+kc/0HT4eVTXL4q1N87D7O5xLFrBljSFYiojr8Iyk7o/gr18b4L/PBuTPTvxF2kzW89ntvhI06/r4pK7fEt6QkwsKY7uSQIUdlYgDQWCdQ1Cpennf1m0h3QittZxP6aBDsCPv6IxowjF8+nHnWW9p0m+mS69O0dw4wkbQF6opKvKZE3FCjBdyj4DIQF29ELPkywJe54Y/6sZn9LyV+zZRxxORvpZyHNZFxKrDWUG5MvAFCcpUBbuUturfpVwVlV1z7gqZceh9mxxLHzNkaakr3dCxnJD9E7s0ESBKps+S/yPIbivmRMVJPQqv9SnPtvTzkDeB58adu1xPR89Kq5AAzW+n1XvgGyCGYwtvxjeyvRy5cHr58iVe/Uk+OzNW5kS8FGY4gkAlSbZFiPSLRyyc9D83SeSeM07xDH33ksTw2HgNy8Fz+YYCO15Z0eQe+cjsQRR9DTw2ur9gsm1wzL7Ai7DiNvzfZMG+8qwVyzFF818nUY+WuruuWUarc1yY0ActNHz8wPmQ4DQzKLCz0P4v4iTAfRpcMwgWceVseA6BasXtVSo/3bnsqvNwda8T/8QtUYbNeagjnjHkzA0GHI6NVh9AOeNz6NmNMOYCgdw/x2Cj2kAatxA/awn9K6jDMJcZ16iy1FpHzfIjtSklKFRqkYeqkMOgzwljcq0gEZ3oz00GGwq02HwTIB2gKFqHuMAwX3nUNpmMhZG0tiXBqsLS1JRYFTmg4Vo+fX/fKK+4m4FSyaEI6BZ+FrxcCLgWcBAQtJYz3PAnjRKkn21WTFvB/FGn8CCz3E76wBrN1pyN3aifMOkrIDhkygsGQStrsmIm4a/GNBF4zDhuxxODVoHDINSAgSreCpgw3/BtrTCUK+BkcU/6PqlwUnfCEayLs56z8ZntjWcRdAzgW3lYu003DF95cH+Ukk95c+hO/pKHrPZoiidurMVv3RMw91DnXhBeurklknmwVdyU9RViGuVHOZEQ4eYRhKuyTD8dEzCzwHI5gbECp/0Qv2pFZb4gIYfa9CmUqOiJMXegUDoarHQOW4wMA4hOQvbXs2/8BAkcMRnr92Sy4+6u/ooRe33gsdxq/BUs0NR0VMZSqB6QZdxK3b8dw8mPdbcZLuevrNUQmGMcpgMg3DPQ2yRrVA4M7SsJDEExMtkngzLOWamZDNUhMXibTjB0c11Pt7oiQ+crcDiNMA4jKAqM6qC9V5KmchWanEyleR03ToU29T/Z66Xe7uPomWtB8zyacir9sA0K0ACIrrgZXW/eSr9LlfAZijMCivYUL75NDrT0CLB+7ey3nA63mvlCltI5Ln4flRcPuzsOyP7wkLwh0ibByZzpgTldnT2jRsny/FyuXKwQmOwzWNYdjwn0AZPQvAT0T8oaZXMRLoY/RWR/L1jTuclw6N7QOed8Xd+gOpw5SfZqCit0CQkgHaCEd/y+sRt0eM4p2sBS++w3UCaeowP9TC9L42xdX5heP5YkVmBOQA2K2aDUf2uuV/7G4kDue2gtPogxslZ2/j+KMyJypVeuj1Zc6AWoTIAFYt3dfG6S7qIqGTlqDbEozvq5YXqK5vyeWsLpsoDSrEVAItnrt3WcpvKBIr8LrHsqS9ROKV5Pb4KudbjwekNw1WxaavWDfG4LwkWg686QWvF4EmzHPvMU1UtJ1Orx7q07VzVr4B9siVh2lL/X3C/ajGgFNJb1XD6/MFnrlGavjtwxy3C5PM7qR2W52VXnkf/jahvTHjFslpEqaKmYAJoPX+OYe54GjwDwSedxsw97MGNBr7MbDRRdIxdBO1KLTBtg0MuOiSupZAGs5hF2DAubwO5AP2YkBJ3W3+cBsy7G+R8S4r4p8DFQyAD3dr67Og1J4Nmqq7gbi5x5qAugfLsfs1XoCV8YRHPBKDqOBQ00eDqFL0JImBZ+FbxcCLgWcBAQtJYz3PAniBrrYWihrypGqbZT3W+m8gZvoPlvyTIJMuCilbiXirIqdISNypDdRAHEzhRkJCnA7yYCTijgQ5dT0EDbCbISVo6Ff0bm5F1IIHkL4Cg/4ZGl7DidfohjhyuGy5ZZ4aQog4G8mbDeJ3ECfYBUpIb9wiLjNubn+gRHKfDEL4ogEN2QrOZA9xl/Pz11Yr4WlI3F2r/3iDTcg8gFhsZiEjHDz5Twyr9yEoeP9QxreH/JXwDiWi057ekGXobDGk00sjETwdw9FhaHLt4VeXK8FpxDobtrPPZoL/BjWcE9ZaEoSnEjoMTVsXLX/KeYn5hHZ35Ya7Ie1dBp5V6TAG3LQWHKAJe79EJeH/fm44N/xThyO857oE2iYPeD0J1VG9I0TSPGzieBSM/0ysauN7woJwVztsqkEuOJG/0xBiH1bIgHbdBKEOQcuiD3jeOc9Yse46nTh0GGwGjvhQprHQX3iuRO/4l57V1gG1Gp4E/VQrBHQYnNUxnX0RDHKinzJD/vp/XCBFlIoN7jUAAAAASUVORK5CYII=`; - let stylesheet = `body,html{font-family:'Saira Semi Condensed',sans-serif;font-size:14px;text-align:center}.light{color:#000;background-color:#fff}.dark{color:#ccc;background-color:#2a2a2a}.header{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;o-user-select:none;cursor:hand}.sorted-table{margin:auto;width:95%;text-align:center}.sorted-table td,.sorted-table th{border-bottom:1px solid #d9d9d9}.hover{background-color:#eee;cursor:pointer}.tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.tooltip .tooltiptext{visibility:hidden;width:140px;background-color:#000;color:#fff;text-align:center;padding:5px 0;border-radius:6px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-70px;opacity:0;transition:opacity .3s}.tooltip .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent}.tooltip:hover .tooltiptext{visibility:visible;opacity:1}`; + let stylesheet = `body,html{font-family:'Saira Semi Condensed',sans-serif;font-size:14px;text-align:center}.light{color:#000;background-color:#fff}.dark{color:#ccc;background-color:#2a2a2a}.header{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;o-user-select:none;cursor:hand}.sorted-table{margin:auto;width:95%;text-align:center}.sorted-table td,.sorted-table th{border-bottom:1px solid #d9d9d9}.hover{background-color:#eee;cursor:pointer}.tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.tooltip .tooltiptext{visibility:hidden;width:140px;background-color:#000;color:#fff;text-align:center;padding:5px 0;border-radius:6px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-70px;opacity:0;transition:opacity .3s}.tooltip .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent}.tooltip:hover .tooltiptext{visibility:visible;opacity:1}a:link,a:visited,a:hover,a:active{color:inherit;text-decoration:none;text-shadow: 0px 0px 5px #40c4ff;}`; let helpers = `$("table.sorted-table thead th").on("mouseover",function(){var t=$(this),e=t.index();t.addClass("hover"),$("table.sorted-table > tbody > tr > td").filter(":nth-child("+(e+1)+")").addClass("hover")}).on("mouseout",function(){$("td, th").removeClass("hover")});var thIndex=0,thInc=1,curThIndex=null;function sortIt(){for(var t=0;t tbody > tr").eq(rowId)[0].outerHTML;$("table.sorted-table > tbody").html(tbodyHtml)}function theme(t){var e=t.getAttribute("class");t.className="light"==e?"dark":"light"}$(function(){$("table.sorted-table thead th").click(function(){thIndex=$(this).index(),sorting=[],tbodyHtml=null,$("table.sorted-table > tbody > tr").each(function(){var t,e=$(this).children("td").eq(thIndex).html();if(t=/^<.+>(\\d+)<\\/.+>$/.exec(e)){var n="000000000000";e=(n+Number(t[1])).slice(-n.length)}sorting.push(e+", "+$(this).index())}),sorting=thIndex!=curThIndex||1==thInc?sorting.sort():sorting.sort(function(t,e){return e.localeCompare(t)}),thInc=thIndex==curThIndex?1-thInc:0,curThIndex=thIndex,sortIt()})});`; res.writeHead(200, {'Content-type':'text/html'}); From 1a263326ea712861226fe93d0c5a0472c750ebd8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 17 Jul 2018 16:53:52 +0200 Subject: [PATCH 152/367] Added RYO coin donation addresses --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8a42930..55e83bf 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ If you'd like to make a one time donation, the addresses are as follows: * ITNS - ```iz53aMEaKJ25zB8xku3FQK5VVvmu2v6DENnbGHRmn659jfrGWBH1beqAzEVYaKhTyMZcxLJAdaCW3Kof1DwTiTbp1DSqLae3e``` * WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` * XMV - ```4BDgQohRBqg2wFZ5ezYqCrNGjgECAttARdbh1fNkuAbd3HnNkSgas11QD9VFQMzbnvDD3Mfcky1LAFihkbEYph5oGAMLurw``` +* RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` From 232f77a1e0be97782fe288494961f3c2a2a99f9f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 18 Jul 2018 08:47:06 +0200 Subject: [PATCH 153/367] Removed moDashboard config value --- proxy.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/proxy.js b/proxy.js index 8584f1b..3f9cd4b 100644 --- a/proxy.js +++ b/proxy.js @@ -1162,7 +1162,6 @@ function activateHTTP() { } let tablePool = ""; let tableBody = ""; - if (!global.config.moDashboard) global.config.moDashboard = false; for (let miner_id in miners) { const miner = miners[miner_id]; const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; @@ -1186,12 +1185,12 @@ function activateHTTP() { for (let poolName in poolHashrate) { let poolPercentage = (100*poolHashrate[poolName]/totalHashrate).toFixed(2); let targetDiff = activePools[poolName].activeBlocktemplate ? activePools[poolName].activeBlocktemplate.targetDiff : "?"; - let walletId = activePools[poolName].username - if (global.config.moDashboard == true && poolName.includes("moneroocean")) { - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; - } else { - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; - } + let walletId = activePools[poolName].username + if (poolName.includes("moneroocean")) { + tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + } else { + tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + } } //expect old config From 3ec1c23bce2ef22224c4a6b670178caf0a3a35db Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 31 Jul 2018 11:00:22 +0200 Subject: [PATCH 154/367] Added link to another proxy install guide --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 55e83bf..9aa8b1c 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,10 @@ for all initial miner connections via proxy. ## Known Issues -VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew through some serious memory during compile. In regards to this, one of our users has put together a guide for T2.Micro servers: http://moneroocean.blogspot.com/2017/10/setup-of-xmr-node-proxy-on-free-tier.html +VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. +Bignum and the CN libraries can chew through some serious memory during compile. +In regards to this here is guide for T2.Micro servers: http://moneroocean.blogspot.com/2017/10/setup-of-xmr-node-proxy-on-free-tier.html +There is also more generic proxy instalation guide: https://tjosm.com/7689/install-xmr-node-proxy-vps/ If not running on an Ubuntu 16.04 system, please make sure your kernel is at least 3.2 or higher, as older versions will not work for this. From 64967ad85d3615207ae8b70fb0f4cd42c0b50a0a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 31 Jul 2018 11:02:32 +0200 Subject: [PATCH 155/367] Fixed links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9aa8b1c..8615123 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,8 @@ for all initial miner connections via proxy. VMs with 512Mb or less RAM will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew through some serious memory during compile. -In regards to this here is guide for T2.Micro servers: http://moneroocean.blogspot.com/2017/10/setup-of-xmr-node-proxy-on-free-tier.html -There is also more generic proxy instalation guide: https://tjosm.com/7689/install-xmr-node-proxy-vps/ +In regards to this here is guide for T2.Micro servers: [Setup of xmr-node-proxy on free tier AWS t2.micro instance](http://moneroocean.blogspot.com/2017/10/setup-of-xmr-node-proxy-on-free-tier.html). +There is also more generic proxy instalation guide: [Complete guide to install and configure xmr-node-proxy on a Ubuntu 16.04 VPS](https://tjosm.com/7689/install-xmr-node-proxy-vps/) If not running on an Ubuntu 16.04 system, please make sure your kernel is at least 3.2 or higher, as older versions will not work for this. From a9da6a1a2028689e238de03f75214ab2d487105a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:17:30 +0200 Subject: [PATCH 156/367] algo_perf initial implementation --- config_example.json | 1 - package.json | 2 +- proxy.js | 60 ++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/config_example.json b/config_example.json index fb7f559..f16f0b9 100644 --- a/config_example.json +++ b/config_example.json @@ -60,7 +60,6 @@ "keepOfflineMiners": 0, "refreshTime": 30, "theme": "light", - "moDashboard": false, "coinSettings": { "xmr":{ "minDiff": 100, diff --git a/package.json b/package.json index 9418f4f..5d222ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.1.6", + "version": "0.2.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 3f9cd4b..83cb09a 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.1.6"; +const PROXY_VERSION = "0.2.0"; /* General file design/where to find things. @@ -207,6 +207,10 @@ function Pool(poolData){ this.algo = poolData.algo; this.blob_type = poolData.blob_type; + const algo_default = this.algo ? this.algo : "cryptonight/1"; + this.algos = { algo_default }; + this.algos_perf = { algo_default: 1 }; + setInterval(function(pool) { if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); }, 30000, this); @@ -232,15 +236,15 @@ function Pool(poolData){ if (ssl){ activePools[hostname].socket = tls.connect(port, hostname, {rejectUnauthorized: allowSelfSignedSSL}) - .on('connect', ()=>{ poolSocket(hostname); }) - .on('error', (err)=>{ + .on('connect', () => { poolSocket(hostname); }) + .on('error', (err) => { setTimeout(connect2, 30*1000, ssl, port, hostname, allowSelfSignedSSL); console.warn(`${global.threadName}SSL pool socket connect error from ${hostname}: ${err}`); }); } else { activePools[hostname].socket = net.connect(port, hostname) - .on('connect', ()=>{ poolSocket(hostname); }) - .on('error', (err)=>{ + .on('connect', () => { poolSocket(hostname); }) + .on('error', (err) => { setTimeout(connect2, 30*1000, ssl, port, hostname, allowSelfSignedSSL); console.warn(`${global.threadName}Plain pool socket connect error from ${hostname}: ${err}`); }); @@ -269,10 +273,13 @@ function Pool(poolData){ debug.pool(`Sent ${JSON.stringify(rawSend)} to ${this.hostname}`); }; this.login = function () { + const algo_default = this.algo ? this.algo : "cryptonight/1"; this.sendData('login', { login: this.username, pass: this.password, - agent: 'xmr-node-proxy/' + PROXY_VERSION + agent: 'xmr-node-proxy/' + PROXY_VERSION, + "algo": Object.keys(this.algos), + "algo-perf": this.algos_perf }); this.active = true; for (let worker in cluster.workers){ @@ -281,6 +288,18 @@ function Pool(poolData){ } } }; + this.update_algo_perf = function (algos, algos_perf) { + // do not update not changed algo/algo-perf + if ( Object.keys(this.algos).length == Object.keys(algos).length && + Object.keys(this.algos).every(function(u, i) { return this.algos[u] === algos[u]; }) && + Object.keys(this.algos_perf).length == Object.keys(algos_perf).length && + Object.keys(this.algos_perf).every(function(u, i) { return this.algos_perf[u] === algos_perf[u]; }) + ) return; + this.sendData('getjob', { + "algo": Object.keys(this.algos = algos), + "algo-perf": (this.algos_perf = algos_perf) + }); + }; this.sendShare = function (worker, shareData) { //btID - Block template ID in the poolJobs circ buffer. let job = this.poolJobs[worker.id].toarray().filter(function (job) { @@ -618,6 +637,8 @@ function balanceWorkers(){ function enumerateWorkerStats() { let stats, global_stats = {miners: 0, hashes: 0, hashRate: 0, diff: 0}; + let pool_algos = {}; + let pool_algos_perf = {}; for (let poolID in activeWorkers){ if (activeWorkers.hasOwnProperty(poolID)){ stats = { @@ -641,6 +662,21 @@ function enumerateWorkerStats() { stats.hashes += workerData.hashes; stats.hashRate += workerData.avgSpeed; stats.diff += workerData.diff; + if (workerData.algos && workerData.algos_perf) { // only process smart miners + if (workerData.pool in pool_algos) { // compute union of workerData.algos and pool_algos[workerData.pool] + for (algo in pool_algos[workerData.pool]) { + if (!(algo in workerData.algos)) delete pool_algos[workerData.pool][algo]; + } + } else { + pool_algos[workerData.pool] = workerData.algos; + pool_algos_perf[workerData.pool] = {}; + } + // add algo_perf from all miners + for (algo in workerData.algos_perf) { + if (algo in pool_algos_perf[workerData.pool]) pool_algos_perf[workerData.pool][algo] += workerData.algos_perf[algo]; + else pool_algos_perf[workerData.pool][algo] = workerData.algos_perf[algo]; + } + } } catch (err) { delete activeWorkers[poolID][workerID]; } @@ -668,6 +704,9 @@ function enumerateWorkerStats() { } if (pool_hs != "") pool_hs = " (" + pool_hs + ")"; + // do update of algo/algo-perf if it was changed + for (pool in pool_algos) activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf[pool]); + console.log(`The proxy currently has ${global_stats.miners} miners connected at ${global_stats.hashRate} h/s${pool_hs} with an average diff of ${Math.floor(global_stats.diff/global_stats.miners)}`); } @@ -814,6 +853,13 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.password = params.pass; // For accessControl and workerStats. this.agent = params.agent; // Documentation purposes only. this.ip = ip; // Documentation purposes only. + if (params.algo && (params.algo instanceof Array)) { // To report union of defined algo set to the pool for all its miners + for (i in params.algo) { + this.algos = {}; + for (let i in params.algo) this.algos[algos[i]] = 1; + } + } + this.algos_perf = params["algo-perf"]; // To report sum of defined algo_perf to the pool for all its miners this.socket = minerSocket; this.messageSender = pushMessage; this.error = ""; @@ -900,6 +946,8 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { identifier: this.identifier, ip: this.ip, agent: this.agent, + algo: this.algo, + algo_perf: this.algo_perf, }; }; From 6976f070fc8f2754697d4c462940d592570af6d3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:29:23 +0200 Subject: [PATCH 157/367] Fixed default algos/algos-perf --- proxy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 83cb09a..cfaf233 100644 --- a/proxy.js +++ b/proxy.js @@ -208,8 +208,10 @@ function Pool(poolData){ this.blob_type = poolData.blob_type; const algo_default = this.algo ? this.algo : "cryptonight/1"; - this.algos = { algo_default }; - this.algos_perf = { algo_default: 1 }; + this.algos = {}; + this.algos[algo_default] = 1; + this.algos_perf = {}; + this.algos_perf[algo_default] = 1; setInterval(function(pool) { if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); @@ -273,7 +275,6 @@ function Pool(poolData){ debug.pool(`Sent ${JSON.stringify(rawSend)} to ${this.hostname}`); }; this.login = function () { - const algo_default = this.algo ? this.algo : "cryptonight/1"; this.sendData('login', { login: this.username, pass: this.password, From c93bdb9363a2ebbc0feef4c09e85387f18dea18e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:33:06 +0200 Subject: [PATCH 158/367] Added let to for --- proxy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy.js b/proxy.js index cfaf233..ec1a703 100644 --- a/proxy.js +++ b/proxy.js @@ -665,7 +665,7 @@ function enumerateWorkerStats() { stats.diff += workerData.diff; if (workerData.algos && workerData.algos_perf) { // only process smart miners if (workerData.pool in pool_algos) { // compute union of workerData.algos and pool_algos[workerData.pool] - for (algo in pool_algos[workerData.pool]) { + for (let algo in pool_algos[workerData.pool]) { if (!(algo in workerData.algos)) delete pool_algos[workerData.pool][algo]; } } else { @@ -673,7 +673,7 @@ function enumerateWorkerStats() { pool_algos_perf[workerData.pool] = {}; } // add algo_perf from all miners - for (algo in workerData.algos_perf) { + for (let algo in workerData.algos_perf) { if (algo in pool_algos_perf[workerData.pool]) pool_algos_perf[workerData.pool][algo] += workerData.algos_perf[algo]; else pool_algos_perf[workerData.pool][algo] = workerData.algos_perf[algo]; } @@ -706,7 +706,7 @@ function enumerateWorkerStats() { if (pool_hs != "") pool_hs = " (" + pool_hs + ")"; // do update of algo/algo-perf if it was changed - for (pool in pool_algos) activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf[pool]); + for (let pool in pool_algos) activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf[pool]); console.log(`The proxy currently has ${global_stats.miners} miners connected at ${global_stats.hashRate} h/s${pool_hs} with an average diff of ${Math.floor(global_stats.diff/global_stats.miners)}`); } @@ -855,7 +855,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.agent = params.agent; // Documentation purposes only. this.ip = ip; // Documentation purposes only. if (params.algo && (params.algo instanceof Array)) { // To report union of defined algo set to the pool for all its miners - for (i in params.algo) { + for (let i in params.algo) { this.algos = {}; for (let i in params.algo) this.algos[algos[i]] = 1; } From 905b6c8ff3458a35521c386e96c3deaf54cd5227 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:34:37 +0200 Subject: [PATCH 159/367] Fixed var name --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index ec1a703..1bd2f7b 100644 --- a/proxy.js +++ b/proxy.js @@ -857,7 +857,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (params.algo && (params.algo instanceof Array)) { // To report union of defined algo set to the pool for all its miners for (let i in params.algo) { this.algos = {}; - for (let i in params.algo) this.algos[algos[i]] = 1; + for (let i in params.algo) this.algos[params.algo[i]] = 1; } } this.algos_perf = params["algo-perf"]; // To report sum of defined algo_perf to the pool for all its miners From 6f8b481e0536224dddb259d031fcd5de0113b0d4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:42:38 +0200 Subject: [PATCH 160/367] Fixed var name --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 1bd2f7b..0d9ae22 100644 --- a/proxy.js +++ b/proxy.js @@ -947,8 +947,8 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { identifier: this.identifier, ip: this.ip, agent: this.agent, - algo: this.algo, - algo_perf: this.algo_perf, + algos: this.algos, + algos_perf: this.algos_perf, }; }; From 47ddaa1fc1984b22b83001b30a5a2881794bfffa Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 11:46:37 +0200 Subject: [PATCH 161/367] Fixed this usage --- proxy.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/proxy.js b/proxy.js index 0d9ae22..fbdb0f0 100644 --- a/proxy.js +++ b/proxy.js @@ -291,10 +291,12 @@ function Pool(poolData){ }; this.update_algo_perf = function (algos, algos_perf) { // do not update not changed algo/algo-perf - if ( Object.keys(this.algos).length == Object.keys(algos).length && - Object.keys(this.algos).every(function(u, i) { return this.algos[u] === algos[u]; }) && - Object.keys(this.algos_perf).length == Object.keys(algos_perf).length && - Object.keys(this.algos_perf).every(function(u, i) { return this.algos_perf[u] === algos_perf[u]; }) + const prev_algos = this.algos; + const prev_algos_perf = this.algos_perf; + if ( Object.keys(prev_algos).length == Object.keys(algos).length && + Object.keys(prev_algos).every(function(u, i) { return prev_algos[u] === algos[u]; }) && + Object.keys(prev_algos_perf).length == Object.keys(algos_perf).length && + Object.keys(prev_algos_perf).every(function(u, i) { return prev_algos_perf[u] === algos_perf[u]; }) ) return; this.sendData('getjob', { "algo": Object.keys(this.algos = algos), From c8d7ea893cfee0bdc1ffc9a41bf319e94f88b858 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:08:10 +0200 Subject: [PATCH 162/367] Posible fix for https://github.com/MoneroOcean/xmr-node-proxy/issues/43 --- proxy.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/proxy.js b/proxy.js index fbdb0f0..3a59653 100644 --- a/proxy.js +++ b/proxy.js @@ -217,14 +217,16 @@ function Pool(poolData){ if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); }, 30000, this); - this.connect = function(){ + this.disable = function(){ for (let worker in cluster.workers){ if (cluster.workers.hasOwnProperty(worker)){ cluster.workers[worker].send({type: 'disablePool', pool: this.hostname}); } } this.active = false; + } + this.connect = function(){ function connect2(ssl, port, hostname, allowSelfSignedSSL) { try { if (activePools[hostname].socket !== null){ @@ -253,6 +255,7 @@ function Pool(poolData){ } } + this.disable(); connect2(this.ssl, this.port, this.hostname, this.allowSelfSignedSSL); }; this.sendData = function (method, params) { @@ -753,11 +756,13 @@ function poolSocket(hostname){ dataBuffer = incomplete; } }).on('error', (err) => { - activePools[pool.hostname].connect(); console.warn(`${global.threadName}Pool socket error from ${pool.hostname}: ${err}`); + activePools[pool.hostname].disable(); + setTimeout(activePools[pool.hostname].connect, 30*1000); }).on('close', () => { - activePools[pool.hostname].connect(); console.warn(`${global.threadName}Pool socket closed from ${pool.hostname}`); + activePools[pool.hostname].disable(); + setTimeout(activePools[pool.hostname].connect, 30*1000); }); socket.setKeepAlive(true); socket.setEncoding('utf8'); @@ -775,8 +780,10 @@ function handlePoolMessage(jsonData, hostname){ } } else { if (jsonData.error !== null){ - activePools[hostname].connect(); - return console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); + console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); + activePools[hostname].disable(); + setTimeout(activePools[hostname].connect, 30*1000); + return; } let sendLog = pool.sendLog[jsonData.id]; switch(sendLog.method){ From 5e534fbade88425c744e5ffea477238bfbb93a8b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:11:32 +0200 Subject: [PATCH 163/367] Added missing ; --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 3a59653..c7d46bb 100644 --- a/proxy.js +++ b/proxy.js @@ -224,7 +224,7 @@ function Pool(poolData){ } } this.active = false; - } + }; this.connect = function(){ function connect2(ssl, port, hostname, allowSelfSignedSSL) { From 3c177adcac06170050313529fa2a11693323b1f1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:14:04 +0200 Subject: [PATCH 164/367] Missing disable function fix --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index c7d46bb..d55d61d 100644 --- a/proxy.js +++ b/proxy.js @@ -255,7 +255,7 @@ function Pool(poolData){ } } - this.disable(); + activePools[this.hostname].disable(); connect2(this.ssl, this.port, this.hostname, this.allowSelfSignedSSL); }; this.sendData = function (method, params) { From 750aaac9a55e0cc08d6fbf84963291670437b4e4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:17:45 +0200 Subject: [PATCH 165/367] Missing pool this pointer in timer --- proxy.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/proxy.js b/proxy.js index d55d61d..020f05c 100644 --- a/proxy.js +++ b/proxy.js @@ -226,7 +226,7 @@ function Pool(poolData){ this.active = false; }; - this.connect = function(){ + this.connect = function(hostname){ function connect2(ssl, port, hostname, allowSelfSignedSSL) { try { if (activePools[hostname].socket !== null){ @@ -255,8 +255,9 @@ function Pool(poolData){ } } - activePools[this.hostname].disable(); - connect2(this.ssl, this.port, this.hostname, this.allowSelfSignedSSL); + let pool = activePools[hostname]; + pool.disable(); + connect2(pool.ssl, pool.port, pool.hostname, pool.allowSelfSignedSSL); }; this.sendData = function (method, params) { if (typeof params === 'undefined'){ @@ -758,11 +759,11 @@ function poolSocket(hostname){ }).on('error', (err) => { console.warn(`${global.threadName}Pool socket error from ${pool.hostname}: ${err}`); activePools[pool.hostname].disable(); - setTimeout(activePools[pool.hostname].connect, 30*1000); + setTimeout(activePools[pool.hostname].connect, 30*1000, pool.hostname); }).on('close', () => { console.warn(`${global.threadName}Pool socket closed from ${pool.hostname}`); activePools[pool.hostname].disable(); - setTimeout(activePools[pool.hostname].connect, 30*1000); + setTimeout(activePools[pool.hostname].connect, 30*1000, pool.hostname); }); socket.setKeepAlive(true); socket.setEncoding('utf8'); @@ -782,7 +783,7 @@ function handlePoolMessage(jsonData, hostname){ if (jsonData.error !== null){ console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); activePools[hostname].disable(); - setTimeout(activePools[hostname].connect, 30*1000); + setTimeout(activePools[hostname].connect, 30*1000, pool.hostname); return; } let sendLog = pool.sendLog[jsonData.id]; From 8758d58ffdbc824bb185d33ecb3d3e387cac27e5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:19:06 +0200 Subject: [PATCH 166/367] Missing pool this pointer in timer --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 020f05c..a2b1cdf 100644 --- a/proxy.js +++ b/proxy.js @@ -339,7 +339,7 @@ function connectPools(){ return; } activePools[poolData.hostname] = new Pool(poolData); - activePools[poolData.hostname].connect(); + activePools[poolData.hostname].connect(poolData.hostname); }); let seen_coins = {}; if (global.config.developerShare > 0){ @@ -353,7 +353,7 @@ function connectPools(){ return; } activePools[devPool.hostname] = new Pool(devPool); - activePools[devPool.hostname].connect(); + activePools[devPool.hostname].connect(devPool.hostname); seen_coins[activePools[pool].coin] = true; } } From 95e2bbf6152bf93e846bd94fad9cd8f2f48c7fee Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:27:47 +0200 Subject: [PATCH 167/367] Avoid mulstiple pool reconnections --- proxy.js | 1 - 1 file changed, 1 deletion(-) diff --git a/proxy.js b/proxy.js index a2b1cdf..c48a51b 100644 --- a/proxy.js +++ b/proxy.js @@ -783,7 +783,6 @@ function handlePoolMessage(jsonData, hostname){ if (jsonData.error !== null){ console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); activePools[hostname].disable(); - setTimeout(activePools[hostname].connect, 30*1000, pool.hostname); return; } let sendLog = pool.sendLog[jsonData.id]; From a4a51da211a014a762b359113b6d2cfaed6c23e5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:33:48 +0200 Subject: [PATCH 168/367] Avoid mulstiple pool reconnections --- proxy.js | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/proxy.js b/proxy.js index c48a51b..e24824d 100644 --- a/proxy.js +++ b/proxy.js @@ -217,6 +217,18 @@ function Pool(poolData){ if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); }, 30000, this); + this.close_socket = function(){ + try { + if (this.socket !== null){ + this.socket.end(); + this.socket.destroy(); + } + } catch (e) { + console.warn(global.threadName + "Had issues murdering the old socket. Om nom: " + e) + } + this.socket = null; + }; + this.disable = function(){ for (let worker in cluster.workers){ if (cluster.workers.hasOwnProperty(worker)){ @@ -224,40 +236,34 @@ function Pool(poolData){ } } this.active = false; + + this.close_socket(); }; this.connect = function(hostname){ - function connect2(ssl, port, hostname, allowSelfSignedSSL) { - try { - if (activePools[hostname].socket !== null){ - activePools[hostname].socket.end(); - activePools[hostname].socket.destroy(); - } - } catch (e) { - console.warn(global.threadName + "Had issues murdering the old socket. Om nom: " + e) - } - activePools[hostname].socket = null; + function connect2(pool) { + pool.close_socket(); if (ssl){ - activePools[hostname].socket = tls.connect(port, hostname, {rejectUnauthorized: allowSelfSignedSSL}) - .on('connect', () => { poolSocket(hostname); }) + pool.socket = tls.connect(pool.port, pool.hostname, {rejectUnauthorized: pool.allowSelfSignedSSL}) + .on('connect', () => { poolSocket(pool.hostname); }) .on('error', (err) => { - setTimeout(connect2, 30*1000, ssl, port, hostname, allowSelfSignedSSL); - console.warn(`${global.threadName}SSL pool socket connect error from ${hostname}: ${err}`); + setTimeout(connect2, 30*1000, pool); + console.warn(`${global.threadName}SSL pool socket connect error from ${pool.hostname}: ${err}`); }); } else { - activePools[hostname].socket = net.connect(port, hostname) - .on('connect', () => { poolSocket(hostname); }) + pool.socket = net.connect(pool.port, pool.hostname) + .on('connect', () => { poolSocket(pool.hostname); }) .on('error', (err) => { - setTimeout(connect2, 30*1000, ssl, port, hostname, allowSelfSignedSSL); - console.warn(`${global.threadName}Plain pool socket connect error from ${hostname}: ${err}`); + setTimeout(connect2, 30*1000, port); + console.warn(`${global.threadName}Plain pool socket connect error from ${pool.hostname}: ${err}`); }); } } let pool = activePools[hostname]; pool.disable(); - connect2(pool.ssl, pool.port, pool.hostname, pool.allowSelfSignedSSL); + connect2(pool); }; this.sendData = function (method, params) { if (typeof params === 'undefined'){ From 2ef6085ca1e2997e3ba476a39094b54446290ecd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 12:34:44 +0200 Subject: [PATCH 169/367] Avoid mulstiple pool reconnections --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index e24824d..7268c06 100644 --- a/proxy.js +++ b/proxy.js @@ -244,7 +244,7 @@ function Pool(poolData){ function connect2(pool) { pool.close_socket(); - if (ssl){ + if (pool.ssl){ pool.socket = tls.connect(pool.port, pool.hostname, {rejectUnauthorized: pool.allowSelfSignedSSL}) .on('connect', () => { poolSocket(pool.hostname); }) .on('error', (err) => { From 40501e7fbf2a8d91bffd853d75fb24ddffb50cb2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 14:06:49 +0200 Subject: [PATCH 170/367] Added correct support of non smart miners --- proxy.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/proxy.js b/proxy.js index 7268c06..fe2cbe1 100644 --- a/proxy.js +++ b/proxy.js @@ -11,6 +11,7 @@ const support = require('./lib/support.js')(); global.config = require('./config.json'); const PROXY_VERSION = "0.2.0"; +const DEFAULT_ALGO = "cryptonight/1"; /* General file design/where to find things. @@ -207,7 +208,7 @@ function Pool(poolData){ this.algo = poolData.algo; this.blob_type = poolData.blob_type; - const algo_default = this.algo ? this.algo : "cryptonight/1"; + const algo_default = this.algo ? this.algo : DEFAULT_ALGO; this.algos = {}; this.algos[algo_default] = 1; this.algos_perf = {}; @@ -675,16 +676,18 @@ function enumerateWorkerStats() { stats.hashes += workerData.hashes; stats.hashRate += workerData.avgSpeed; stats.diff += workerData.diff; - if (workerData.algos && workerData.algos_perf) { // only process smart miners - if (workerData.pool in pool_algos) { // compute union of workerData.algos and pool_algos[workerData.pool] - for (let algo in pool_algos[workerData.pool]) { - if (!(algo in workerData.algos)) delete pool_algos[workerData.pool][algo]; - } - } else { - pool_algos[workerData.pool] = workerData.algos; - pool_algos_perf[workerData.pool] = {}; - } - // add algo_perf from all miners + // process smart miners and assume all other miners to only support pool algo + let miner_algos = workerData.algos; + if (!miner_algos) miner_algos[activePools[workerData.pool].algo ? activePools[workerData.pool].algo : DEFAULT_ALGO] = 1; + if (workerData.pool in pool_algos) { // compute union of miner_algos and pool_algos[workerData.pool] + for (let algo in pool_algos[workerData.pool]) { + if (!(algo in miner_algos)) delete pool_algos[workerData.pool][algo]; + } + } else { + pool_algos[workerData.pool] = miner_algos; + pool_algos_perf[workerData.pool] = {}; + } + if (workerData.algos_perf) { // only process smart miners and add algo_perf from all smart miners for (let algo in workerData.algos_perf) { if (algo in pool_algos_perf[workerData.pool]) pool_algos_perf[workerData.pool][algo] += workerData.algos_perf[algo]; else pool_algos_perf[workerData.pool][algo] = workerData.algos_perf[algo]; From 2d537a28d205de0c61374c2798787305cc7c6735 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 14:14:21 +0200 Subject: [PATCH 171/367] Fixed null socket usage --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index fe2cbe1..d898ffa 100644 --- a/proxy.js +++ b/proxy.js @@ -278,7 +278,7 @@ function Pool(poolData){ params.id = this.id; } rawSend.params = params; - if (!this.socket.writable){ + if (this.socket === null || !this.socket.writable){ return false; } this.socket.write(JSON.stringify(rawSend) + '\n'); From 5d3b32ba6415cbb245ed98e1f84b779a73f75548 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 14:20:41 +0200 Subject: [PATCH 172/367] Fixed empty algo-perf --- proxy.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/proxy.js b/proxy.js index d898ffa..7ec64e6 100644 --- a/proxy.js +++ b/proxy.js @@ -208,11 +208,11 @@ function Pool(poolData){ this.algo = poolData.algo; this.blob_type = poolData.blob_type; - const algo_default = this.algo ? this.algo : DEFAULT_ALGO; + const default_algo = this.algo ? this.algo : DEFAULT_ALGO; this.algos = {}; - this.algos[algo_default] = 1; + this.algos[default_algo] = 1; this.algos_perf = {}; - this.algos_perf[algo_default] = 1; + this.algos_perf[default_algo] = 1; setInterval(function(pool) { if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); @@ -676,7 +676,7 @@ function enumerateWorkerStats() { stats.hashes += workerData.hashes; stats.hashRate += workerData.avgSpeed; stats.diff += workerData.diff; - // process smart miners and assume all other miners to only support pool algo + // process smart miners and assume all other miners to only support pool algo let miner_algos = workerData.algos; if (!miner_algos) miner_algos[activePools[workerData.pool].algo ? activePools[workerData.pool].algo : DEFAULT_ALGO] = 1; if (workerData.pool in pool_algos) { // compute union of miner_algos and pool_algos[workerData.pool] @@ -721,7 +721,11 @@ function enumerateWorkerStats() { if (pool_hs != "") pool_hs = " (" + pool_hs + ")"; // do update of algo/algo-perf if it was changed - for (let pool in pool_algos) activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf[pool]); + for (let pool in pool_algos) { + let pool_algos_perf2 = pool_algos_perf[pool]; + if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2[activePools[pool].algo ? activePools[pool].algo : DEFAULT_ALGO] = 1; + activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf2); + } console.log(`The proxy currently has ${global_stats.miners} miners connected at ${global_stats.hashRate} h/s${pool_hs} with an average diff of ${Math.floor(global_stats.diff/global_stats.miners)}`); } From 2b87f0bf57f99929a78abb692f5a6e1206318ab8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Aug 2018 14:24:27 +0200 Subject: [PATCH 173/367] Added info about common algo/algo-perf --- proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy.js b/proxy.js index 7ec64e6..cb37598 100644 --- a/proxy.js +++ b/proxy.js @@ -309,6 +309,7 @@ function Pool(poolData){ Object.keys(prev_algos_perf).length == Object.keys(algos_perf).length && Object.keys(prev_algos_perf).every(function(u, i) { return prev_algos_perf[u] === algos_perf[u]; }) ) return; + console.log("Setting common algo: " + JSON.stringify(Object.keys(algos)) + " with algo-perf: " + JSON.stringify(algos_perf)); this.sendData('getjob', { "algo": Object.keys(this.algos = algos), "algo-perf": (this.algos_perf = algos_perf) From e55bce38237bc8ab4ceae7e2fc159cb3dfa1f593 Mon Sep 17 00:00:00 2001 From: mrmoo85 <42066234+mrmoo85@users.noreply.github.com> Date: Fri, 3 Aug 2018 08:13:03 -0400 Subject: [PATCH 174/367] Language / Text Changed language / text of the web UI --- proxy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/proxy.js b/proxy.js index cb37598..74928c1 100644 --- a/proxy.js +++ b/proxy.js @@ -1242,13 +1242,13 @@ function activateHTTP() { tableBody += ` ${name} - ${avgSpeed} + ${avgSpeed} H/s ${miner.diff} ${miner.shares} ${miner.hashes} - ${moment.unix(miner.lastShare).fromNow(true)} - ${moment.unix(miner.lastContact).fromNow(true)} - ${moment(miner.connectTime).fromNow(true)} + ${moment.unix(miner.lastShare).fromNow(true)} ago + ${moment.unix(miner.lastContact).fromNow(true)} ago + ${moment(miner.connectTime).fromNow(true)} ago ${miner.pool}
${agent_parts[0]}${miner.agent}
@@ -1297,9 +1297,9 @@ function activateHTTP() { Difficulty Shares Hashes - Share Ago - Ping Ago - Connected Ago + Share Recvd + Ping Recvd + Connected Pool Agent From e65eea4a4162d51d8b6f2c40d8d980a6e8cdafe2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 5 Aug 2018 21:26:53 +0200 Subject: [PATCH 175/367] Added more clear message about what pool has common algo set --- README.md | 3 +++ proxy.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8615123..978442f 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,9 @@ If you'd like to make a one time donation, the addresses are as follows: * WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` * XMV - ```4BDgQohRBqg2wFZ5ezYqCrNGjgECAttARdbh1fNkuAbd3HnNkSgas11QD9VFQMzbnvDD3Mfcky1LAFihkbEYph5oGAMLurw``` * RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` +* XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` +* XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` +* TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` diff --git a/proxy.js b/proxy.js index cb37598..d493023 100644 --- a/proxy.js +++ b/proxy.js @@ -309,7 +309,7 @@ function Pool(poolData){ Object.keys(prev_algos_perf).length == Object.keys(algos_perf).length && Object.keys(prev_algos_perf).every(function(u, i) { return prev_algos_perf[u] === algos_perf[u]; }) ) return; - console.log("Setting common algo: " + JSON.stringify(Object.keys(algos)) + " with algo-perf: " + JSON.stringify(algos_perf)); + console.log("Setting common algo: " + JSON.stringify(Object.keys(algos)) + " with algo-perf: " + JSON.stringify(algos_perf) + " for pool " + this.hostname); this.sendData('getjob', { "algo": Object.keys(this.algos = algos), "algo-perf": (this.algos_perf = algos_perf) From 9c8dfedf85a8c116a73d443e71182efb2f7b53d4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 8 Aug 2018 15:30:17 +0200 Subject: [PATCH 176/367] Fixed algo parsing --- lib/xmr.js | 15 +++++++-------- proxy.js | 9 ++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index b2d0b39..db366cc 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -49,9 +49,15 @@ function parse_blob_type(blob_type_str) { } function parse_algo_variant(algo_str, variant) { - if (typeof(variant) === 'undefined') variant = 1; + if (typeof(variant) === 'undefined' && typeof(algo_str) === 'undefined') variant = 1; if (typeof(algo_str) === 'undefined') return variant; switch (algo_str) { + case 'cn': + case 'cryptonight': + case 'cn-lite': + case 'cryptonight-lite': + case 'cn-heavy': + case 'cryptonight-heavy': case 'cn/0': case 'cryptonight/0': case 'cn-lite/0': @@ -78,13 +84,6 @@ function parse_algo_variant(algo_str, variant) { case 'cn/rto': case 'cryptonight/rto': return 6; - - case 'cn': - case 'cryptonight': - case 'cn-lite': - case 'cryptonight-lite': - case 'cn-heavy': - case 'cryptonight-heavy': return variant; } return 1; } diff --git a/proxy.js b/proxy.js index d493023..012f12b 100644 --- a/proxy.js +++ b/proxy.js @@ -817,7 +817,14 @@ function handlePoolMessage(jsonData, hostname){ function handleNewBlockTemplate(blockTemplate, hostname){ let pool = activePools[hostname]; - console.log(`Received new block template on ${blockTemplate.height} height with ${blockTemplate.target_diff} target difficulty from ${pool.hostname}`); + let algo_variant = ""; + if (blockTemplate.algo) algo_variant += "algo: " + blockTemplate.algo; + if (blockTemplate.variant) { + if (algo_variant != "") algo_variant += ", "; + algo_variant += "variant: " + blockTemplate.variant; + } + if (algo_variant != "") algo_variant = " (" + algo_variant + ")"; + console.log(`Received new block template on ${blockTemplate.height} height${algo_variant} with ${blockTemplate.target_diff} target difficulty from ${pool.hostname}`); if(pool.activeBlocktemplate){ if (pool.activeBlocktemplate.job_id === blockTemplate.job_id){ debug.pool('No update with this job, it is an upstream dupe'); From dad1baddcf3675397149670d857e4c56aa838d22 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 8 Aug 2018 15:30:17 +0200 Subject: [PATCH 177/367] Fixed algo parsing --- lib/xmr.js | 15 +++++++-------- proxy.js | 9 ++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index b2d0b39..db366cc 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -49,9 +49,15 @@ function parse_blob_type(blob_type_str) { } function parse_algo_variant(algo_str, variant) { - if (typeof(variant) === 'undefined') variant = 1; + if (typeof(variant) === 'undefined' && typeof(algo_str) === 'undefined') variant = 1; if (typeof(algo_str) === 'undefined') return variant; switch (algo_str) { + case 'cn': + case 'cryptonight': + case 'cn-lite': + case 'cryptonight-lite': + case 'cn-heavy': + case 'cryptonight-heavy': case 'cn/0': case 'cryptonight/0': case 'cn-lite/0': @@ -78,13 +84,6 @@ function parse_algo_variant(algo_str, variant) { case 'cn/rto': case 'cryptonight/rto': return 6; - - case 'cn': - case 'cryptonight': - case 'cn-lite': - case 'cryptonight-lite': - case 'cn-heavy': - case 'cryptonight-heavy': return variant; } return 1; } diff --git a/proxy.js b/proxy.js index d493023..012f12b 100644 --- a/proxy.js +++ b/proxy.js @@ -817,7 +817,14 @@ function handlePoolMessage(jsonData, hostname){ function handleNewBlockTemplate(blockTemplate, hostname){ let pool = activePools[hostname]; - console.log(`Received new block template on ${blockTemplate.height} height with ${blockTemplate.target_diff} target difficulty from ${pool.hostname}`); + let algo_variant = ""; + if (blockTemplate.algo) algo_variant += "algo: " + blockTemplate.algo; + if (blockTemplate.variant) { + if (algo_variant != "") algo_variant += ", "; + algo_variant += "variant: " + blockTemplate.variant; + } + if (algo_variant != "") algo_variant = " (" + algo_variant + ")"; + console.log(`Received new block template on ${blockTemplate.height} height${algo_variant} with ${blockTemplate.target_diff} target difficulty from ${pool.hostname}`); if(pool.activeBlocktemplate){ if (pool.activeBlocktemplate.job_id === blockTemplate.job_id){ debug.pool('No update with this job, it is an upstream dupe'); From c002c90472182db7c841c208b722fa4a59cb896e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 3 Aug 2018 08:13:03 -0400 Subject: [PATCH 178/367] Language / Text Changed language / text of the web UI --- proxy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/proxy.js b/proxy.js index 012f12b..4de600e 100644 --- a/proxy.js +++ b/proxy.js @@ -1249,13 +1249,13 @@ function activateHTTP() { tableBody += ` ${name} - ${avgSpeed} + ${avgSpeed} H/s ${miner.diff} ${miner.shares} ${miner.hashes} - ${moment.unix(miner.lastShare).fromNow(true)} - ${moment.unix(miner.lastContact).fromNow(true)} - ${moment(miner.connectTime).fromNow(true)} + ${moment.unix(miner.lastShare).fromNow(true)} ago + ${moment.unix(miner.lastContact).fromNow(true)} ago + ${moment(miner.connectTime).fromNow(true)} ago ${miner.pool}
${agent_parts[0]}${miner.agent}
@@ -1304,9 +1304,9 @@ function activateHTTP() { Difficulty Shares Hashes - Share Ago - Ping Ago - Connected Ago + Share Recvd + Ping Recvd + Connected Pool Agent From ebb050a51742db1efb5d2c034ef4a702712df8c0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 11 Aug 2018 02:58:36 +0200 Subject: [PATCH 179/367] Merge branch 'master' of https://github.com/MoneroOcean/xmr-node-proxy From 85c84fed48e18f1cfc62ba152933350cfe24108b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 11 Aug 2018 02:59:05 +0200 Subject: [PATCH 180/367] Added auto pull --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 04a136f..549bcc1 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/bin/bash git checkout . &&\ -git pull &&\ +git pull --no-edit &&\ npm install &&\ echo "Proxy updated OK! Please go ahead and restart with the correct pm2 command" echo "This is usually pm2 restart proxy, however, you can use pm2 list to check for your exact proxy command" From 9e1969b47eaa1e5b8e16c479ff6568136a108233 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 11 Aug 2018 22:22:24 +0200 Subject: [PATCH 181/367] Type fix --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 4de600e..116b280 100644 --- a/proxy.js +++ b/proxy.js @@ -256,7 +256,7 @@ function Pool(poolData){ pool.socket = net.connect(pool.port, pool.hostname) .on('connect', () => { poolSocket(pool.hostname); }) .on('error', (err) => { - setTimeout(connect2, 30*1000, port); + setTimeout(connect2, 30*1000, pool); console.warn(`${global.threadName}Plain pool socket connect error from ${pool.hostname}: ${err}`); }); } From b9fde237f209b60b10b97746d181811129ef8c1a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 17 Aug 2018 11:29:37 +0200 Subject: [PATCH 182/367] Removed Fonero --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 978442f..14f6334 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ Supports all known cryptonight/heavy/light coins: * Sumokoin (SUMO), Haven (XHV), Loki (LOKI) * ... -... except Fonero. - ## Setup Instructions Based on a clean Ubuntu 16.04 LTS minimal install @@ -188,6 +186,7 @@ If you'd like to make a one time donation, the addresses are as follows: * XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` * XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` * TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` +* LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` From 2948be66539d33b07e11142bc190d62ab72127e4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 18 Aug 2018 09:14:19 +0200 Subject: [PATCH 183/367] Added RYO support --- lib/xmr.js | 1 + package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index db366cc..9108fca 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -44,6 +44,7 @@ function parse_blob_type(blob_type_str) { case 'forknote1': return 1; case 'forknote2': return 2; // Almost all Forknote coins case 'cryptonote2': return 3; // Masari + case 'cryptonote_ryo': return 4; // Ryo } return 0; } diff --git a/package.json b/package.json index 5d222ad..595b656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.2.0", + "version": "0.2.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v1.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v2.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.2.0" } } From 4f2b7619754a2e7a2f7edecc82d9c51e905cec7f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 18 Aug 2018 09:30:32 +0200 Subject: [PATCH 184/367] Fixed version --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 116b280..8f66c9b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.2.0"; +const PROXY_VERSION = "0.2.1"; const DEFAULT_ALGO = "cryptonight/1"; /* From 5e3c09d313c3d58bbb4a556895f844b3488aeb31 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 20 Aug 2018 08:45:11 +0200 Subject: [PATCH 185/367] More user friendly miner indentification --- lib/xmr.js | 4 ++-- package.json | 2 +- proxy.js | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 9108fca..d8f17b1 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -289,12 +289,12 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { let foo = parse_algo_func(blockTemplate.algo); hash = foo(convertedBlob, parse_algo_variant(blockTemplate.algo, blockTemplate.variant)); if (hash.toString('hex') !== resultHash) { - console.error(global.threadName + "Bad share from miner " + miner.logString); + console.error(global.threadName + "Bad share from miner " + miner.logString()); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); return false; } } else { - console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload " + miner.logString); + console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload: " + miner.logString()); } miner.blocks += 1; const poolName = miner.pool; diff --git a/package.json b/package.json index 595b656..a7b3adf 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "async": "2.1.4", "bignum": "^0.12.5", "circular-buffer": "1.0.2", - "debug": "2.5.1", + "debug": "2.6.9", "express": "4.14.0", "minimist": "1.2.0", "moment": "2.21.0", diff --git a/proxy.js b/proxy.js index 8f66c9b..d355d03 100644 --- a/proxy.js +++ b/proxy.js @@ -947,7 +947,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.shares = 0; this.blocks = 0; this.hashes = 0; - this.logString = this.id + " IP: " + this.ip; this.validJobs = support.circularBuffer(5); @@ -956,6 +955,10 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { let pass_split = params.pass.split(":"); this.identifier = pass_split[0]; + this.logString = function() { + return (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; + }; + this.minerStats = function(){ if (this.socket.destroyed && !global.config.keepOfflineMiners){ delete activeMiners[this.id]; @@ -1003,7 +1006,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (this.difficulty === this.newDiff) { return false; } - debug.diff(global.threadName + "Difficulty change to: " + this.newDiff + " For: " + this.logString); + debug.diff(global.threadName + "Difficulty change to: " + this.newDiff + " For: " + this.logString()); if (this.hashes > 0){ debug.diff(global.threadName + "Hashes: " + this.hashes + " in: " + Math.floor((Date.now() - this.connectTime)/1000) + " seconds gives: " + Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))) + " hashes/second or: " + @@ -1124,13 +1127,13 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m params.nonce = params.nonce.substr(0, 8).toLowerCase(); if (!nonceCheck.test(params.nonce)) { - console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString); + console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString()); sendReply('Duplicate share'); return; } if (job.submissions.indexOf(params.nonce) !== -1) { - console.warn(global.threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString); + console.warn(global.threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString()); sendReply('Duplicate share'); return; } @@ -1144,7 +1147,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m })[0]; if (!blockTemplate) { - console.warn(global.threadName + 'Block expired, Height: ' + job.height + ' from ' + miner.logString); + console.warn(global.threadName + 'Block expired, Height: ' + job.height + ' from ' + miner.logString()); if (miner.incremented === false){ miner.newDiff = miner.difficulty + 1; miner.incremented = true; @@ -1221,7 +1224,7 @@ function activateHTTP() { if (typeof(miner) === 'undefined' || !miner) continue; if (miner.active) { miners[miner.id] = miner; - const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + const name = miner.logString(); miner_names[name] = 1; ++ totalWorkers; totalHashrate += miner.avgSpeed; @@ -1234,7 +1237,7 @@ function activateHTTP() { } for (let offline_miner_id in offline_miners) { const miner = offline_miners[offline_miner_id]; - const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + const name = miner.logString(); if (name in miner_names) continue; miners[miner.id] = miner; miner_names[name] = 1; @@ -1243,7 +1246,7 @@ function activateHTTP() { let tableBody = ""; for (let miner_id in miners) { const miner = miners[miner_id]; - const name = (miner.identifier && miner.identifier != "x") ? miner.identifier + " (" + miner.ip + ")" : miner.ip; + const name = miner.logString(); let avgSpeed = miner.active ? miner.avgSpeed : "offline"; let agent_parts = miner.agent.split(" "); tableBody += ` From 05822a8012c3b76f300d6e5d86637bcbf726d124 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 20 Aug 2018 12:44:16 +0200 Subject: [PATCH 186/367] Fixed logString usage --- lib/xmr.js | 4 ++-- proxy.js | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index d8f17b1..f76b91c 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -289,12 +289,12 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { let foo = parse_algo_func(blockTemplate.algo); hash = foo(convertedBlob, parse_algo_variant(blockTemplate.algo, blockTemplate.variant)); if (hash.toString('hex') !== resultHash) { - console.error(global.threadName + "Bad share from miner " + miner.logString()); + console.error(global.threadName + "Bad share from miner " + miner.logString); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); return false; } } else { - console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload: " + miner.logString()); + console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload: " + miner.logString); } miner.blocks += 1; const poolName = miner.pool; diff --git a/proxy.js b/proxy.js index d355d03..6f5e87e 100644 --- a/proxy.js +++ b/proxy.js @@ -955,9 +955,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { let pass_split = params.pass.split(":"); this.identifier = pass_split[0]; - this.logString = function() { - return (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; - }; + this.logString = (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; this.minerStats = function(){ if (this.socket.destroyed && !global.config.keepOfflineMiners){ @@ -982,6 +980,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { agent: this.agent, algos: this.algos, algos_perf: this.algos_perf, + logString: this.logString, }; }; @@ -1006,7 +1005,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (this.difficulty === this.newDiff) { return false; } - debug.diff(global.threadName + "Difficulty change to: " + this.newDiff + " For: " + this.logString()); + debug.diff(global.threadName + "Difficulty change to: " + this.newDiff + " For: " + this.logString); if (this.hashes > 0){ debug.diff(global.threadName + "Hashes: " + this.hashes + " in: " + Math.floor((Date.now() - this.connectTime)/1000) + " seconds gives: " + Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))) + " hashes/second or: " + @@ -1127,13 +1126,13 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m params.nonce = params.nonce.substr(0, 8).toLowerCase(); if (!nonceCheck.test(params.nonce)) { - console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString()); + console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString); sendReply('Duplicate share'); return; } if (job.submissions.indexOf(params.nonce) !== -1) { - console.warn(global.threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString()); + console.warn(global.threadName + 'Duplicate share: ' + JSON.stringify(params) + ' from ' + miner.logString); sendReply('Duplicate share'); return; } @@ -1147,7 +1146,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m })[0]; if (!blockTemplate) { - console.warn(global.threadName + 'Block expired, Height: ' + job.height + ' from ' + miner.logString()); + console.warn(global.threadName + 'Block expired, Height: ' + job.height + ' from ' + miner.logString); if (miner.incremented === false){ miner.newDiff = miner.difficulty + 1; miner.incremented = true; @@ -1224,7 +1223,7 @@ function activateHTTP() { if (typeof(miner) === 'undefined' || !miner) continue; if (miner.active) { miners[miner.id] = miner; - const name = miner.logString(); + const name = miner.logString; miner_names[name] = 1; ++ totalWorkers; totalHashrate += miner.avgSpeed; @@ -1237,7 +1236,7 @@ function activateHTTP() { } for (let offline_miner_id in offline_miners) { const miner = offline_miners[offline_miner_id]; - const name = miner.logString(); + const name = miner.logString; if (name in miner_names) continue; miners[miner.id] = miner; miner_names[name] = 1; @@ -1246,7 +1245,7 @@ function activateHTTP() { let tableBody = ""; for (let miner_id in miners) { const miner = miners[miner_id]; - const name = miner.logString(); + const name = miner.logString; let avgSpeed = miner.active ? miner.avgSpeed : "offline"; let agent_parts = miner.agent.split(" "); tableBody += ` From 34e18c29ae3df52070b35ff6e7748ad71ca16dc5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 20 Aug 2018 21:51:42 +0200 Subject: [PATCH 187/367] Fixed value type --- config_example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_example.json b/config_example.json index f16f0b9..174c2d9 100644 --- a/config_example.json +++ b/config_example.json @@ -56,7 +56,7 @@ "httpPort": "8081", "httpUser": "", "httpPass": "", - "minerInactivityTime": "120", + "minerInactivityTime": 120, "keepOfflineMiners": 0, "refreshTime": 30, "theme": "light", From 1dce5a5cedf106861ad6159989da28deae741548 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 21 Aug 2018 13:33:10 +0200 Subject: [PATCH 188/367] Implemented https://github.com/MoneroOcean/xmr-node-proxy/issues/57 --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 6f5e87e..43056f0 100644 --- a/proxy.js +++ b/proxy.js @@ -953,7 +953,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.cachedJob = null; let pass_split = params.pass.split(":"); - this.identifier = pass_split[0]; + this.identifier = global.config.addressWorkerID ? miner.user : pass_split[0]; this.logString = (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; From 20530b40d6f7f48a0ede9182ece0a5619e51e410 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 21 Aug 2018 14:07:31 +0200 Subject: [PATCH 189/367] Bug fix --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 43056f0..536596b 100644 --- a/proxy.js +++ b/proxy.js @@ -953,7 +953,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.cachedJob = null; let pass_split = params.pass.split(":"); - this.identifier = global.config.addressWorkerID ? miner.user : pass_split[0]; + this.identifier = global.config.addressWorkerID ? this.user : pass_split[0]; this.logString = (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; From efd4101d85cc54b74e7611e68924601197c2e1d9 Mon Sep 17 00:00:00 2001 From: tinyema Date: Wed, 29 Aug 2018 14:18:21 +0200 Subject: [PATCH 190/367] Add current algo variant if pool is monero ocean I tried by myself ;-) --- proxy.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 536596b..03893f2 100644 --- a/proxy.js +++ b/proxy.js @@ -1268,7 +1268,14 @@ function activateHTTP() { let targetDiff = activePools[poolName].activeBlocktemplate ? activePools[poolName].activeBlocktemplate.targetDiff : "?"; let walletId = activePools[poolName].username if (poolName.includes("moneroocean")) { - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + let algo_variant = ""; + if (activePools[poolName].activeBlocktemplate.algo) algo_variant += "algo: " + activePools[poolName].activeBlocktemplate.algo; + if (activePools[poolName].activeBlocktemplate.variant) { + if (algo_variant != "") algo_variant += ", "; + algo_variant += "variant: " + activePools[poolName].activeBlocktemplate.variant; + } + if (algo_variant != "") algo_variant = " (" + algo_variant + ")"; + tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff) ${algo_variant}

`; } else { tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; } From 3417188a936b1fba65c50d94a12bc945a08f08b7 Mon Sep 17 00:00:00 2001 From: djfinch Date: Thu, 30 Aug 2018 01:26:37 +0200 Subject: [PATCH 191/367] Ugh! --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 03893f2..2324be4 100644 --- a/proxy.js +++ b/proxy.js @@ -1246,12 +1246,12 @@ function activateHTTP() { for (let miner_id in miners) { const miner = miners[miner_id]; const name = miner.logString; - let avgSpeed = miner.active ? miner.avgSpeed : "offline"; + let avgSpeed = miner.active ? miner.avgSpeed + " H/s" : "offline"; let agent_parts = miner.agent.split(" "); tableBody += ` ${name} - ${avgSpeed} H/s + ${avgSpeed} ${miner.diff} ${miner.shares} ${miner.hashes} From 549b7ef2697c082de97e829b4ab3b6e33c031106 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 15 Sep 2018 15:34:04 +0200 Subject: [PATCH 192/367] Added cn/2 support and Loki new utils support --- config_example.json | 1 + lib/xmr.js | 18 +++++++++++------- package.json | 6 +++--- proxy.js | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/config_example.json b/config_example.json index 174c2d9..dc01821 100644 --- a/config_example.json +++ b/config_example.json @@ -56,6 +56,7 @@ "httpPort": "8081", "httpUser": "", "httpPass": "", + "addressWorkerID": false, "minerInactivityTime": 120, "keepOfflineMiners": 0, "refreshTime": 30, diff --git a/lib/xmr.js b/lib/xmr.js index f76b91c..2a82f1d 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -40,11 +40,12 @@ function getRemoteNodes() { function parse_blob_type(blob_type_str) { if (typeof(blob_type_str) === 'undefined') return 0; switch (blob_type_str) { - case 'cryptonote': return 0; // Monero - case 'forknote1': return 1; - case 'forknote2': return 2; // Almost all Forknote coins - case 'cryptonote2': return 3; // Masari - case 'cryptonote_ryo': return 4; // Ryo + case 'cryptonote': return 0; // Monero + case 'forknote1': return 1; + case 'forknote2': return 2; // Almost all Forknote coins + case 'cryptonote2': return 3; // Masari + case 'cryptonote_ryo': return 4; // Ryo + case 'cryptonote_loki': return 5; // Loki } return 0; } @@ -81,10 +82,13 @@ function parse_algo_variant(algo_str, variant) { case 'cryptonight/msr': return 4; case 'cn/xao': - case 'cryptonight/xao': return 5; + case 'cryptonight/xao': return 6; case 'cn/rto': - case 'cryptonight/rto': return 6; + case 'cryptonight/rto': return 7; + + case 'cn/2': + case 'cryptonight/2': return 8; } return 1; } diff --git a/package.json b/package.json index a7b3adf..04720ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.2.1", + "version": "0.3.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v2.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v2.2.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.0" } } diff --git a/proxy.js b/proxy.js index 536596b..1494456 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.2.1"; +const PROXY_VERSION = "0.3.0"; const DEFAULT_ALGO = "cryptonight/1"; /* From ada5fec4b2b5ccdc116d367485653059d667b3ba Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 22 Sep 2018 17:02:08 +0200 Subject: [PATCH 193/367] Added CentOS/RHEL based setup --- install.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ccb9ea3..98eab0f 100644 --- a/install.sh +++ b/install.sh @@ -7,9 +7,16 @@ if [[ `whoami` == "root" ]]; then exit 1 fi CURUSER=$(whoami) -sudo apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade -sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl build-essential cmake python-virtualenv libboost-all-dev + +if which yum >/dev/null; then + sudo yum -y update + sudo yum -y upgrade + sudo yum -y install git curl make gcc-c++ boost-devel boost-system-devel boost-date-time-devel +else + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ libboost-dev libboost-system-dev libboost-date-time-dev +fi cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash From e4700956e37446f2d5cc6bcc3a49bfbed5efd244 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 22 Sep 2018 17:15:58 +0200 Subject: [PATCH 194/367] Added source of .bashrc to add node to path --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 98eab0f..f053001 100644 --- a/install.sh +++ b/install.sh @@ -35,3 +35,4 @@ sudo chown -R $CURUSER. ~/.pm2 echo "Installing pm2-logrotate in the background!" pm2 install pm2-logrotate echo "You're setup with a shiny new proxy! Now, go configure it and have fun." +source ~/.bashrc From c891a5e881a5b852ca0e2536ffd683e5cc171a52 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 22 Sep 2018 17:37:00 +0200 Subject: [PATCH 195/367] Fixed some install stuff --- install.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f053001..173b018 100644 --- a/install.sh +++ b/install.sh @@ -11,11 +11,11 @@ CURUSER=$(whoami) if which yum >/dev/null; then sudo yum -y update sudo yum -y upgrade - sudo yum -y install git curl make gcc-c++ boost-devel boost-system-devel boost-date-time-devel + sudo yum -y install git curl make gcc-c++ python-virtualenv boost-devel boost-system-devel boost-date-time-devel else sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ libboost-dev libboost-system-dev libboost-date-time-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python-virtualenv libboost-dev libboost-system-dev libboost-date-time-dev fi cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy @@ -34,5 +34,4 @@ sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v8.11.3/bin `pwd`/.nvm/versions/nod sudo chown -R $CURUSER. ~/.pm2 echo "Installing pm2-logrotate in the background!" pm2 install pm2-logrotate -echo "You're setup with a shiny new proxy! Now, go configure it and have fun." -source ~/.bashrc +echo "You're setup with a shiny new proxy! Now, do 'source ~/.bashrc' command, go configure it and have fun." From e0761040c2f89824dd8acbac26c04a93fb0588ab Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 1 Oct 2018 20:33:28 +0200 Subject: [PATCH 196/367] Added cn/2 tweak support --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 04720ff..df0db89 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.1" } } diff --git a/proxy.js b/proxy.js index d84f753..494cb98 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.3.0"; +const PROXY_VERSION = "0.3.1"; const DEFAULT_ALGO = "cryptonight/1"; /* From b7b06c65b2e3e0e1895ed5617089ae37719eb32d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 1 Oct 2018 22:25:06 +0200 Subject: [PATCH 197/367] Added cn/2 accelereted support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df0db89..020cd93 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.2" } } From 22fb4ede1ac32229f00a57cb9c495fcc738c6bcf Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 1 Oct 2018 22:54:02 +0200 Subject: [PATCH 198/367] Updated hashing utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 020cd93..ebcf522 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.3" } } From a676562979d89fe64a95d3b34f7e19a26c320cb6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 3 Oct 2018 14:55:55 +0200 Subject: [PATCH 199/367] Fixed stuff on ARM platform --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebcf522..a72aaf0 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.3" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.4" } } From be27b5321ae6b8c723821ad96b31b37ab216f055 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 3 Oct 2018 16:49:17 +0200 Subject: [PATCH 200/367] Fixed stuff on ARM platform --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a72aaf0..fd39817 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.4" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.5" } } From 1f899894428b91438c3344f6b7a700da61ad8d69 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 4 Oct 2018 12:21:58 +0200 Subject: [PATCH 201/367] Moved version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd39817..4bb16c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.3.0", + "version": "0.3.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { From df65bc63caaac8bf9b046c4fff22bf4130d19a59 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 4 Oct 2018 19:55:08 +0200 Subject: [PATCH 202/367] Switched to non short algo name --- package.json | 2 +- proxy.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4bb16c7..28e7b23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.3.1", + "version": "0.3.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 494cb98..8dc6a0b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,8 +10,8 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.3.1"; -const DEFAULT_ALGO = "cryptonight/1"; +const PROXY_VERSION = "0.3.2"; +const DEFAULT_ALGO = "cn/1"; /* General file design/where to find things. From 21f0ee0efce97b92f9db00d7cc1cb2cc5ccbc30b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:02:22 +0200 Subject: [PATCH 203/367] Added support for smooth cn/2 algo transition for non algo compatible pools (use algo: [ cn/1, cn/2 ] in config for that) --- config_example.json | 4 ++-- lib/xmr.js | 10 +++++++++- proxy.js | 22 ++++++++++------------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/config_example.json b/config_example.json index dc01821..a0e5ce5 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cryptonight/1", + "algo": [ "cn/1", "cn/2" ], "blob_type": "cryptonote", "default": true }, @@ -22,7 +22,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cryptonight/1", + "algo": [ "cn/1", "cn/2" ], "blob_type": "cryptonote", "default": false } diff --git a/lib/xmr.js b/lib/xmr.js index 2a82f1d..dca4170 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -93,6 +93,13 @@ function parse_algo_variant(algo_str, variant) { return 1; } +function detectAlgo(pool_algo, block_version) { + if ("cn/2" in pool_algo && "cn/1" in pool_algo) return block_version >= 8 ? "cn/2" : "cn/1"; // monero fork + if (pool_algo.length == 1) return pool_algo[0]; + console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + pool_algo.join(", ")); + return pool_algo[0]; +} + function parse_algo_func(algo_str) { if (typeof(algo_str) === 'undefined') return multiHashing.cryptonight; if (algo_str.includes('lite')) return multiHashing.cryptonight_light; @@ -362,6 +369,7 @@ module.exports = function () { getJob: getJob, processShare: processShare, MasterBlockTemplate: MasterBlockTemplate, - getMasterJob: getMasterJob + getMasterJob: getMasterJob, + detectAlgo: detectAlgo }; }; diff --git a/proxy.js b/proxy.js index 8dc6a0b..558fab9 100644 --- a/proxy.js +++ b/proxy.js @@ -10,8 +10,9 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.3.2"; -const DEFAULT_ALGO = "cn/1"; +const PROXY_VERSION = "0.3.3"; +const DEFAULT_ALGO = [ "cn/1", "cn/2" ]; +const DEFAULT_ALGO_PERF = { "cn": 1, "cn/msr": 1.9 }; /* General file design/where to find things. @@ -205,14 +206,11 @@ function Pool(poolData){ if (poolData.hasOwnProperty('allowSelfSignedSSL')){ this.allowSelfSignedSSL = !poolData.allowSelfSignedSSL; } - this.algo = poolData.algo; - this.blob_type = poolData.blob_type; + this.algo = poolData.algo ? (poolData.algo instanceof Array ? poolData.algo : [poolData.algo]) : DEFAULT_ALGO; + this.algos = this.algo; + this.algos_perf = DEFAULT_ALGO_PERF; + this.blob_type = poolData.blob_type; - const default_algo = this.algo ? this.algo : DEFAULT_ALGO; - this.algos = {}; - this.algos[default_algo] = 1; - this.algos_perf = {}; - this.algos_perf[default_algo] = 1; setInterval(function(pool) { if (pool.keepAlive && pool.socket && is_active_pool(pool.hostname)) pool.sendData('keepalived'); @@ -679,7 +677,7 @@ function enumerateWorkerStats() { stats.diff += workerData.diff; // process smart miners and assume all other miners to only support pool algo let miner_algos = workerData.algos; - if (!miner_algos) miner_algos[activePools[workerData.pool].algo ? activePools[workerData.pool].algo : DEFAULT_ALGO] = 1; + if (!miner_algos) miner_algos = activePools[workerData.pool].algo; if (workerData.pool in pool_algos) { // compute union of miner_algos and pool_algos[workerData.pool] for (let algo in pool_algos[workerData.pool]) { if (!(algo in miner_algos)) delete pool_algos[workerData.pool][algo]; @@ -724,7 +722,7 @@ function enumerateWorkerStats() { // do update of algo/algo-perf if it was changed for (let pool in pool_algos) { let pool_algos_perf2 = pool_algos_perf[pool]; - if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2[activePools[pool].algo ? activePools[pool].algo : DEFAULT_ALGO] = 1; + if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2 = DEFAULT_ALGO_PERF; activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf2); } @@ -833,7 +831,7 @@ function handleNewBlockTemplate(blockTemplate, hostname){ debug.pool('Storing the previous block template'); pool.pastBlockTemplates.enq(pool.activeBlocktemplate); } - if (!blockTemplate.algo) blockTemplate.algo = pool.algo; + if (!blockTemplate.algo) blockTemplate.algo = pool.coinFuncs.detectAlgo(pool.algo, blockTemplate.blocktemplate_blob[0]); if (!blockTemplate.blob_type) blockTemplate.blob_type = pool.blob_type; pool.activeBlocktemplate = new pool.coinFuncs.MasterBlockTemplate(blockTemplate); for (let id in cluster.workers){ From 0bf446ed9ecb3bb7f1a99d8b257a404b84a0c96f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:18:09 +0200 Subject: [PATCH 204/367] Fixed set and arrays for algos --- lib/xmr.js | 11 ++++++----- proxy.js | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index dca4170..a5a6b13 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -93,11 +93,12 @@ function parse_algo_variant(algo_str, variant) { return 1; } -function detectAlgo(pool_algo, block_version) { - if ("cn/2" in pool_algo && "cn/1" in pool_algo) return block_version >= 8 ? "cn/2" : "cn/1"; // monero fork - if (pool_algo.length == 1) return pool_algo[0]; - console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + pool_algo.join(", ")); - return pool_algo[0]; +function detectAlgo(default_pool_algo_set, block_version) { + if ("cn/2" in default_pool_algo_set && "cn/1" in default_pool_algo_set) return block_version >= 8 ? "cn/2" : "cn/1"; // monero fork + const default_pool_algo_arr = Object.keys(default_pool_algo_set); + if (default_pool_algo_arr.length == 1) return default_pool_algo_arr[0]; + console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + default_pool_algo_arr.join(", ")); + return default_pool_algo_arr[0]; } function parse_algo_func(algo_str) { diff --git a/proxy.js b/proxy.js index 558fab9..f89d426 100644 --- a/proxy.js +++ b/proxy.js @@ -206,8 +206,10 @@ function Pool(poolData){ if (poolData.hasOwnProperty('allowSelfSignedSSL')){ this.allowSelfSignedSSL = !poolData.allowSelfSignedSSL; } - this.algo = poolData.algo ? (poolData.algo instanceof Array ? poolData.algo : [poolData.algo]) : DEFAULT_ALGO; - this.algos = this.algo; + const algo_arr = poolData.algo ? (poolData.algo instanceof Array ? poolData.algo : [poolData.algo]) : DEFAULT_ALGO; + this.default_algo_set = {}; + this.algos = {}; + this.algo_arr.forEach(function (algo) { this.algos[algo] = this.default_algo_set[algo] = 1 }); this.algos_perf = DEFAULT_ALGO_PERF; this.blob_type = poolData.blob_type; @@ -677,7 +679,7 @@ function enumerateWorkerStats() { stats.diff += workerData.diff; // process smart miners and assume all other miners to only support pool algo let miner_algos = workerData.algos; - if (!miner_algos) miner_algos = activePools[workerData.pool].algo; + if (!miner_algos) miner_algos = activePools[workerData.pool].default_algo_set; if (workerData.pool in pool_algos) { // compute union of miner_algos and pool_algos[workerData.pool] for (let algo in pool_algos[workerData.pool]) { if (!(algo in miner_algos)) delete pool_algos[workerData.pool][algo]; @@ -831,7 +833,7 @@ function handleNewBlockTemplate(blockTemplate, hostname){ debug.pool('Storing the previous block template'); pool.pastBlockTemplates.enq(pool.activeBlocktemplate); } - if (!blockTemplate.algo) blockTemplate.algo = pool.coinFuncs.detectAlgo(pool.algo, blockTemplate.blocktemplate_blob[0]); + if (!blockTemplate.algo) blockTemplate.algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, blockTemplate.blocktemplate_blob[0]); if (!blockTemplate.blob_type) blockTemplate.blob_type = pool.blob_type; pool.activeBlocktemplate = new pool.coinFuncs.MasterBlockTemplate(blockTemplate); for (let id in cluster.workers){ From 66ac9a1c5dfb046354a17d11d85c488e982f8ae4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:24:14 +0200 Subject: [PATCH 205/367] Fixed bug --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index f89d426..c99d2dc 100644 --- a/proxy.js +++ b/proxy.js @@ -209,7 +209,7 @@ function Pool(poolData){ const algo_arr = poolData.algo ? (poolData.algo instanceof Array ? poolData.algo : [poolData.algo]) : DEFAULT_ALGO; this.default_algo_set = {}; this.algos = {}; - this.algo_arr.forEach(function (algo) { this.algos[algo] = this.default_algo_set[algo] = 1 }); + algo_arr.forEach(function (algo) { this.algos[algo] = this.default_algo_set[algo] = 1 }); this.algos_perf = DEFAULT_ALGO_PERF; this.blob_type = poolData.blob_type; From 2b14dce0e1ec4fe120f009c9b960153d849258b1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:26:30 +0200 Subject: [PATCH 206/367] Fixed this usage --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index c99d2dc..6f1682d 100644 --- a/proxy.js +++ b/proxy.js @@ -209,7 +209,7 @@ function Pool(poolData){ const algo_arr = poolData.algo ? (poolData.algo instanceof Array ? poolData.algo : [poolData.algo]) : DEFAULT_ALGO; this.default_algo_set = {}; this.algos = {}; - algo_arr.forEach(function (algo) { this.algos[algo] = this.default_algo_set[algo] = 1 }); + for (let i in algo_arr) this.algos[algo_arr[i]] = this.default_algo_set[algo_arr[i]] = 1; this.algos_perf = DEFAULT_ALGO_PERF; this.blob_type = poolData.blob_type; From c0f0c62bf163a365d4a359ea686b0af5d740b8d7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:52:50 +0200 Subject: [PATCH 207/367] Fixed block version detection --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 6f1682d..f74a3ed 100644 --- a/proxy.js +++ b/proxy.js @@ -833,7 +833,7 @@ function handleNewBlockTemplate(blockTemplate, hostname){ debug.pool('Storing the previous block template'); pool.pastBlockTemplates.enq(pool.activeBlocktemplate); } - if (!blockTemplate.algo) blockTemplate.algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, blockTemplate.blocktemplate_blob[0]); + if (!blockTemplate.algo) blockTemplate.algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); if (!blockTemplate.blob_type) blockTemplate.blob_type = pool.blob_type; pool.activeBlocktemplate = new pool.coinFuncs.MasterBlockTemplate(blockTemplate); for (let id in cluster.workers){ From df0ea4ca9406f3015bc0a5e4c3b8420715ac43b7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 12 Oct 2018 10:58:29 +0200 Subject: [PATCH 208/367] Put cn/2 transition warning --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 14f6334..ee13f0b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # xmr-node-proxy +:warning: **[Monero will change PoW algorithm on October 18] Please update this proxy to the latest version and if you use it for the pool other than MoneroOcean please put "algo": ["cn/1", "cn/2" ] into your pool section of config.json for smooth transition** :warning: + Supports all known cryptonight/heavy/light coins: * Monero (XMR), MoneroV (XMV), Monero Original (XMO), Monero Classic (XMC), ... From 92539b5dbba99df24dac1dff290f475d765744ec Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 13 Oct 2018 14:46:38 +0200 Subject: [PATCH 209/367] Updated donate address --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee13f0b..7c3b5fa 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ Please check the [wiki](https://github.com/MoneroOcean/xmr-node-proxy/wiki/confi Developer Donations =================== If you'd like to make a one time donation, the addresses are as follows: -* XMR - ```499fS1Phq64hGeqV8p2AfXbf6Ax7gP6FybcMJq6Wbvg8Hw6xms8tCmdYpPsTLSaTNuLEtW4kF2DDiWCFcw4u7wSvFD8wFWE``` +* XMR - ```44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1``` * AEON - ```WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT``` * ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1``` * SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy``` From eeceb1099fa68565daf8f26b967ab47ecdd7b1ee Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 18 Oct 2018 17:14:46 +0200 Subject: [PATCH 210/367] Updated for after fork situation --- README.md | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c3b5fa..0907882 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # xmr-node-proxy -:warning: **[Monero will change PoW algorithm on October 18] Please update this proxy to the latest version and if you use it for the pool other than MoneroOcean please put "algo": ["cn/1", "cn/2" ] into your pool section of config.json for smooth transition** :warning: +:warning: **[Monero will change PoW algorithm on October 18] Please update this proxy to the latest version and please put "algo": "cn/2" into your pool section of config.json** :warning: Supports all known cryptonight/heavy/light coins: diff --git a/proxy.js b/proxy.js index f74a3ed..538c0df 100644 --- a/proxy.js +++ b/proxy.js @@ -11,7 +11,7 @@ const support = require('./lib/support.js')(); global.config = require('./config.json'); const PROXY_VERSION = "0.3.3"; -const DEFAULT_ALGO = [ "cn/1", "cn/2" ]; +const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/msr": 1.9 }; /* From 1e1166a070e1f06482298d655325873b1c8d0751 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 09:20:02 +0200 Subject: [PATCH 211/367] Do not allow connection of miners that will break default pool algo --- proxy.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 538c0df..2f5e7d3 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.3.3"; +const PROXY_VERSION = "0.3.4"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/msr": 1.9 }; @@ -935,6 +935,14 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.valid_miner = false; } + for (let algo in pool.algos) { + if (!(algo in this.algos)) { + this.error = "Your miner does not have " + algo + " algo support. Please update it."; + this.valid_miner = false; + break; + } + } + this.id = id; this.heartbeat = function () { this.lastContact = Date.now(); From 9c09c0feb06797e2b15938cd492ff0fdaf147215 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 09:21:12 +0200 Subject: [PATCH 212/367] Do not allow connection of miners that will break default pool algo --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 2f5e7d3..5b7fbac 100644 --- a/proxy.js +++ b/proxy.js @@ -935,7 +935,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.valid_miner = false; } - for (let algo in pool.algos) { + for (let algo in this.pool.algos) { if (!(algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; From f0140442d06b46e165f3fbaeac75aa1bfbeb73f3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 09:22:50 +0200 Subject: [PATCH 213/367] Do not allow connection of miners that will break default pool algo --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 5b7fbac..3d2217b 100644 --- a/proxy.js +++ b/proxy.js @@ -935,7 +935,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.valid_miner = false; } - for (let algo in this.pool.algos) { + if (this.algos) for (let algo in this.pool.algos) { if (!(algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; From 5453e16d694b612f5b8787b1218a03c417e0cebf Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 09:24:13 +0200 Subject: [PATCH 214/367] Do not allow connection of miners that will break default pool algo --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 3d2217b..c0a9774 100644 --- a/proxy.js +++ b/proxy.js @@ -935,7 +935,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.valid_miner = false; } - if (this.algos) for (let algo in this.pool.algos) { + if (this.algos) for (let algo in this.pool.default_algo_set) { if (!(algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; From c19deb9f9de16c626b3edd85b5136d37f9145670 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 09:36:55 +0200 Subject: [PATCH 215/367] Final 0.3.4 fix --- config_example.json | 4 ++-- proxy.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config_example.json b/config_example.json index a0e5ce5..1708329 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": [ "cn/1", "cn/2" ], + "algo": "cn/2", "blob_type": "cryptonote", "default": true }, @@ -22,7 +22,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": [ "cn/1", "cn/2" ], + "algo": "cn/2", "blob_type": "cryptonote", "default": false } diff --git a/proxy.js b/proxy.js index c0a9774..fca1330 100644 --- a/proxy.js +++ b/proxy.js @@ -915,6 +915,14 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } if (!this.pool) this.pool = defaultPools[portData.coin]; + if (this.algos) for (let algo in activePools[this.pool].default_algo_set) { + if (!(algo in this.algos)) { + this.error = "Your miner does not have " + algo + " algo support. Please update it."; + this.valid_miner = false; + break; + } + } + if (diffSplit.length === 2) { this.fixed_diff = true; this.difficulty = Number(diffSplit[1]); @@ -935,14 +943,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.valid_miner = false; } - if (this.algos) for (let algo in this.pool.default_algo_set) { - if (!(algo in this.algos)) { - this.error = "Your miner does not have " + algo + " algo support. Please update it."; - this.valid_miner = false; - break; - } - } - this.id = id; this.heartbeat = function () { this.lastContact = Date.now(); From f0af0d4124b3094eea51fb83ede49ead57c6afd9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Oct 2018 12:17:48 +0200 Subject: [PATCH 216/367] Added more logs about problem miners during login --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index fca1330..bae4bc4 100644 --- a/proxy.js +++ b/proxy.js @@ -1085,7 +1085,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m if (!portData.coin) portData.coin = "xmr"; miner = new Miner(minerId, params, ip, pushMessage, portData, minerSocket); if (!miner.valid_miner) { - console.warn(global.threadName + "Invalid miner, disconnecting due to: " + miner.error); + console.warn(global.threadName + "Invalid miner: " + miner.logString + ", disconnecting due to: " + miner.error); sendReply(miner.error); return; } From 091f74f5bf002032854fa38bea21d9bd3b3826c3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 20 Oct 2018 22:43:06 +0200 Subject: [PATCH 217/367] reduce common algo notify noise --- proxy.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/proxy.js b/proxy.js index bae4bc4..3715254 100644 --- a/proxy.js +++ b/proxy.js @@ -300,16 +300,21 @@ function Pool(poolData){ } } }; + this.update_algo_perf = function (algos, algos_perf) { // do not update not changed algo/algo-perf - const prev_algos = this.algos; - const prev_algos_perf = this.algos_perf; - if ( Object.keys(prev_algos).length == Object.keys(algos).length && - Object.keys(prev_algos).every(function(u, i) { return prev_algos[u] === algos[u]; }) && - Object.keys(prev_algos_perf).length == Object.keys(algos_perf).length && - Object.keys(prev_algos_perf).every(function(u, i) { return prev_algos_perf[u] === algos_perf[u]; }) - ) return; - console.log("Setting common algo: " + JSON.stringify(Object.keys(algos)) + " with algo-perf: " + JSON.stringify(algos_perf) + " for pool " + this.hostname); + const prev_algos = this.algos; + const prev_algos_perf = this.algos_perf; + const prev_algos_str = JSON.stringify(Object.keys(prev_algos)); + const prev_algos_perf_str = JSON.stringify(prev_algos_perf); + const algos_str = JSON.stringify(Object.keys(algos)); + const algos_perf_str = JSON.stringify(algos_perf); + if ( algos_str === prev_algos_str && algos_perf_str === prev_algos_perf_str) return; + const curr_time = Date.now(); + if (!this.last_common_algo_notify_time || curr_time - this.last_common_algo_notify_time > 5*60*1000 || algos_str !== prev_algos_str) { + console.log("Setting common algo: " + algos_str + " with algo-perf: " + algos_perf_str + " for pool " + this.hostname); + this.last_common_algo_notify_time = curr_time; + } this.sendData('getjob', { "algo": Object.keys(this.algos = algos), "algo-perf": (this.algos_perf = algos_perf) From b66412707701d3f20ed76fb99f5011f28e9b878d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 22 Oct 2018 10:04:08 +0200 Subject: [PATCH 218/367] Added TRTL donate address --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0907882..3445b63 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ If you'd like to make a one time donation, the addresses are as follows: * XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` * TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` * LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` +* TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` From aa81feed4224ea3858b7e4ac4f5d50d3d11f9d37 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 24 Oct 2018 22:22:11 +0200 Subject: [PATCH 219/367] Only break pool connection if it says it does not know us --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 3715254..5417de9 100644 --- a/proxy.js +++ b/proxy.js @@ -799,7 +799,7 @@ function handlePoolMessage(jsonData, hostname){ handleNewBlockTemplate(jsonData.params, hostname); } } else { - if (jsonData.error !== null){ + if (jsonData.error !== null && (jsonData.error instanceof Object) && (typeof jsonData.error.message === 'string') && jsonData.error.message.includes("Unauthenticated")){ console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); activePools[hostname].disable(); return; From 0d5fc5095f7d51911d95810b93c2aab19d6d3cc5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 24 Oct 2018 22:23:16 +0200 Subject: [PATCH 220/367] Print error message in any case --- proxy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 5417de9..a2907ed 100644 --- a/proxy.js +++ b/proxy.js @@ -799,9 +799,9 @@ function handlePoolMessage(jsonData, hostname){ handleNewBlockTemplate(jsonData.params, hostname); } } else { - if (jsonData.error !== null && (jsonData.error instanceof Object) && (typeof jsonData.error.message === 'string') && jsonData.error.message.includes("Unauthenticated")){ + if (jsonData.error !== null){ console.error(`${global.threadName}Error response from pool ${pool.hostname}: ${JSON.stringify(jsonData.error)}`); - activePools[hostname].disable(); + if ((jsonData.error instanceof Object) && (typeof jsonData.error.message === 'string') && jsonData.error.message.includes("Unauthenticated")) activePools[hostname].disable(); return; } let sendLog = pool.sendLog[jsonData.id]; From a0418ba539a1a0f1687ced938a935f88317273f9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 28 Oct 2018 21:00:31 +0100 Subject: [PATCH 221/367] Added suppor of cn-heavy/0 syntax --- lib/xmr.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/xmr.js b/lib/xmr.js index a5a6b13..8d4208b 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -59,7 +59,9 @@ function parse_algo_variant(algo_str, variant) { case 'cn-lite': case 'cryptonight-lite': case 'cn-heavy': + case 'cn-heavy/0': case 'cryptonight-heavy': + case 'cryptonight-heavy/0': case 'cn/0': case 'cryptonight/0': case 'cn-lite/0': From aa7f0611b5171b1be1b4f005e7ac53d4386019a5 Mon Sep 17 00:00:00 2001 From: piratoskratos <43503044+piratoskratos@users.noreply.github.com> Date: Sat, 3 Nov 2018 19:48:56 +0100 Subject: [PATCH 222/367] Avoid crashing of the proxy server. If a miner is using an empty password, the proxy server crash.. Simply set a "x" password as default when password isnt set, avoid the crash. --- proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy.js b/proxy.js index a2907ed..17ab7b6 100644 --- a/proxy.js +++ b/proxy.js @@ -965,6 +965,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.cachedJob = null; + if (!params.pass) params.pass = "x"; let pass_split = params.pass.split(":"); this.identifier = global.config.addressWorkerID ? this.user : pass_split[0]; From de9c8c0b287ee15b9e09aa51f3e9a7f35ecebe72 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 14 Jan 2019 10:03:09 -0800 Subject: [PATCH 223/367] Added cn-half support --- config_example.json | 13 +++++++++++++ lib/xmr.js | 5 +++++ package.json | 4 ++-- proxy.js | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/config_example.json b/config_example.json index 1708329..4bb6b78 100644 --- a/config_example.json +++ b/config_example.json @@ -25,6 +25,19 @@ "algo": "cn/2", "blob_type": "cryptonote", "default": false + }, + { + "hostname": "mine.c3pool.com", + "port": 23333, + "ssl": false, + "allowSelfSignedSSL": false, + "share": 0, + "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "password": "proxy", + "keepAlive": true, + "algo": "cn/2", + "blob_type": "cryptonote", + "default": false } ], "listeningPorts": [ diff --git a/lib/xmr.js b/lib/xmr.js index 8d4208b..7fdf282 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -50,6 +50,8 @@ function parse_blob_type(blob_type_str) { return 0; } +// Names are taken from https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md + function parse_algo_variant(algo_str, variant) { if (typeof(variant) === 'undefined' && typeof(algo_str) === 'undefined') variant = 1; if (typeof(algo_str) === 'undefined') return variant; @@ -91,6 +93,9 @@ function parse_algo_variant(algo_str, variant) { case 'cn/2': case 'cryptonight/2': return 8; + + case 'cn/half': + case 'cryptonight/half': return 9; } return 1; } diff --git a/package.json b/package.json index 28e7b23..636fcd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.3.2", + "version": "0.4.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v3.0.5" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v4.0.0" } } diff --git a/proxy.js b/proxy.js index 17ab7b6..3aa3d26 100644 --- a/proxy.js +++ b/proxy.js @@ -10,9 +10,9 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.3.4"; +const PROXY_VERSION = "0.4.0"; const DEFAULT_ALGO = [ "cn/2" ]; -const DEFAULT_ALGO_PERF = { "cn": 1, "cn/msr": 1.9 }; +const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; /* General file design/where to find things. From 5e708307a78f7e6ebae79975e8ebef95754c4dca Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 15 Jan 2019 09:27:59 -0800 Subject: [PATCH 224/367] Updated hashing package with minor build fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 636fcd9..c158481 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v4.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v4.0.1" } } From c7f0a8daf93327dc0f2ee02511700e82255ab0fd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 23 Jan 2019 18:29:27 -0800 Subject: [PATCH 225/367] Added cn-pico algo support --- README.md | 4 +--- lib/xmr.js | 3 +++ package.json | 4 ++-- proxy.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3445b63..47c2109 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # xmr-node-proxy -:warning: **[Monero will change PoW algorithm on October 18] Please update this proxy to the latest version and please put "algo": "cn/2" into your pool section of config.json** :warning: - -Supports all known cryptonight/heavy/light coins: +Supports all known cryptonight/heavy/light/pico coins: * Monero (XMR), MoneroV (XMV), Monero Original (XMO), Monero Classic (XMC), ... * Wownero (WOW), Masari (MSR), Electroneum (ETN), Graft (GRFT), Intense (ITNS) diff --git a/lib/xmr.js b/lib/xmr.js index 7fdf282..9a2a662 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -66,6 +66,8 @@ function parse_algo_variant(algo_str, variant) { case 'cryptonight-heavy/0': case 'cn/0': case 'cryptonight/0': + case 'cn-pico/trtl': + case 'cryptonight-pico/trtl': case 'cn-lite/0': case 'cryptonight-lite/0': return 0; @@ -112,6 +114,7 @@ function parse_algo_func(algo_str) { if (typeof(algo_str) === 'undefined') return multiHashing.cryptonight; if (algo_str.includes('lite')) return multiHashing.cryptonight_light; if (algo_str.includes('heavy')) return multiHashing.cryptonight_heavy; + if (algo_str.includes('pico')) return multiHashing.cryptonight_pico; return multiHashing.cryptonight; } diff --git a/package.json b/package.json index c158481..25e0923 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.4.0", + "version": "0.5.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v4.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.0" } } diff --git a/proxy.js b/proxy.js index 3aa3d26..96f6b3b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.4.0"; +const PROXY_VERSION = "0.5.0"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From 464a8b32121c86d6ffa126b059b117c8a1243cc2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 24 Jan 2019 14:39:44 -0800 Subject: [PATCH 226/367] Moved to v5.0.1 node-cryptonight-hashing --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25e0923..a8167f6 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.1" } } From 68fbd19326aae7a827baad10cdc7ca5078486731 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 24 Jan 2019 14:55:59 -0800 Subject: [PATCH 227/367] Moved to v5.0.2 node-cryptonight-hashing --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8167f6..3688555 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.2" } } From 410ace3ed5e88a9dfc9ed0b7625d6bb296ab841b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 26 Jan 2019 08:45:58 -0800 Subject: [PATCH 228/367] Fixed MSR blob support --- lib/xmr.js | 1 + package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 9a2a662..b090a71 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -46,6 +46,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote2': return 3; // Masari case 'cryptonote_ryo': return 4; // Ryo case 'cryptonote_loki': return 5; // Loki + case 'cryptonote3': return 6; // Masari } return 0; } diff --git a/package.json b/package.json index 3688555..d5a5bf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.5.0", + "version": "0.5.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v3.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.2" } } diff --git a/proxy.js b/proxy.js index 96f6b3b..55328f3 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.5.0"; +const PROXY_VERSION = "0.5.1"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From e17c0c55de7bf516a543084b1c761695fa065084 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 26 Jan 2019 09:23:07 -0800 Subject: [PATCH 229/367] One more MAsari fix --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d5a5bf7..a069069 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.5.1", + "version": "0.5.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.2" } } diff --git a/proxy.js b/proxy.js index 55328f3..161c1cb 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.5.1"; +const PROXY_VERSION = "0.5.2"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From 86d3f315e193f4d5cdddd97f157ff636f4a11b52 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 7 Feb 2019 13:45:03 -0800 Subject: [PATCH 230/367] Added extra cn/gpu algo support --- lib/xmr.js | 3 +++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index b090a71..0cffc29 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -99,6 +99,9 @@ function parse_algo_variant(algo_str, variant) { case 'cn/half': case 'cryptonight/half': return 9; + + case 'cn/gpu': + case 'cryptonight/gpu': return 10; } return 1; } diff --git a/package.json b/package.json index a069069..7edb3df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.5.2", + "version": "0.6.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v5.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.0" } } diff --git a/proxy.js b/proxy.js index 161c1cb..764e89c 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.5.2"; +const PROXY_VERSION = "0.6.0"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From 9ab92b2fffab04d4cb6a27a9852a53cfb7471238 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 7 Feb 2019 13:55:46 -0800 Subject: [PATCH 231/367] Synced cn/gpu algo number from 10 to 11 to match xmrig enum --- lib/xmr.js | 2 +- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 0cffc29..c52cf8e 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -101,7 +101,7 @@ function parse_algo_variant(algo_str, variant) { case 'cryptonight/half': return 9; case 'cn/gpu': - case 'cryptonight/gpu': return 10; + case 'cryptonight/gpu': return 11; } return 1; } diff --git a/package.json b/package.json index 7edb3df..bf423a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.6.0", + "version": "0.6.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.1" } } diff --git a/proxy.js b/proxy.js index 764e89c..d566260 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.6.0"; +const PROXY_VERSION = "0.6.1"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From 5e47a5de334d88d0fe0ae752e49c7fc0cfa45223 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 8 Feb 2019 10:02:32 -0800 Subject: [PATCH 232/367] Fixed stuff for x86_64 non AVX CPU --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf423a8..be687cf 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.2" } } From ea1c919ee22d8f9c805fd7d1c39423f6a6d3f527 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 9 Feb 2019 09:53:26 -0800 Subject: [PATCH 233/367] Bug fixes for AVX CPUs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be687cf..4c9b73f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.3" } } From df1c2367d592b81cf6d3ab9a8e8aa0f42fbf5e78 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 10 Feb 2019 12:07:10 -0800 Subject: [PATCH 234/367] Added cn/wow support --- lib/xmr.js | 7 ++++++- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index c52cf8e..d90eef8 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -102,6 +102,9 @@ function parse_algo_variant(algo_str, variant) { case 'cn/gpu': case 'cryptonight/gpu': return 11; + + case 'cn/wow': + case 'cryptonight/wow': return 12; } return 1; } @@ -217,6 +220,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { miner.cachedJob = { blob: blob, job_id: newJob.id, + height: activeBlockTemplate.height, target: target, id: miner.id }; @@ -313,7 +317,8 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); let foo = parse_algo_func(blockTemplate.algo); - hash = foo(convertedBlob, parse_algo_variant(blockTemplate.algo, blockTemplate.variant)); + let variant = parse_algo_variant(blockTemplate.algo, blockTemplate.variant); + hash = variant == 12 ? foo(convertedBlob, variant, blockTemplate.height) : foo(convertedBlob, variant); // WOW need 3-rd param height if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); diff --git a/package.json b/package.json index 4c9b73f..3e10d23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.6.1", + "version": "0.7.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v6.0.3" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v7.0.0" } } diff --git a/proxy.js b/proxy.js index d566260..cb92a21 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.6.1"; +const PROXY_VERSION = "0.7.0"; const DEFAULT_ALGO = [ "cn/2" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; From dfbf6e1ee540f9c04e5fe1547e4c8c5df0d27f06 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 10 Feb 2019 20:29:18 -0800 Subject: [PATCH 235/367] arm32 fix? --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e10d23..13df76b 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v7.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v7.0.1" } } From 9f3c274c42b1ca1ff81b89c904eaf25d73d638f1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 15 Feb 2019 18:20:15 -0800 Subject: [PATCH 236/367] Disabled initial connection to devpool --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index cb92a21..6cc9af8 100644 --- a/proxy.js +++ b/proxy.js @@ -910,7 +910,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { for (let poolName in activePools){ if (activePools.hasOwnProperty(poolName)){ let pool = activePools[poolName]; - if (pool.coin != portData.coin) continue; + if (pool.coin != portData.coin || pool.devPool) continue; if (is_active_pool(poolName)) { this.pool = poolName; break; From 24ab00aea43de47a855c99f0dd97ca7359a789ff Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 09:52:00 -0800 Subject: [PATCH 237/367] Added cn/4 algo support --- lib/xmr.js | 8 +++++--- package.json | 4 ++-- proxy.js | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index d90eef8..97c21f0 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -105,12 +105,15 @@ function parse_algo_variant(algo_str, variant) { case 'cn/wow': case 'cryptonight/wow': return 12; + + case 'cn/4': + case 'cryptonight/4': return 13; } return 1; } function detectAlgo(default_pool_algo_set, block_version) { - if ("cn/2" in default_pool_algo_set && "cn/1" in default_pool_algo_set) return block_version >= 8 ? "cn/2" : "cn/1"; // monero fork + if ("cn/4" in default_pool_algo_set && "cn/2" in default_pool_algo_set) return block_version >= 10 ? "cn/4" : "cn/2"; // Monero fork const default_pool_algo_arr = Object.keys(default_pool_algo_set); if (default_pool_algo_arr.length == 1) return default_pool_algo_arr[0]; console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + default_pool_algo_arr.join(", ")); @@ -317,8 +320,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); let foo = parse_algo_func(blockTemplate.algo); - let variant = parse_algo_variant(blockTemplate.algo, blockTemplate.variant); - hash = variant == 12 ? foo(convertedBlob, variant, blockTemplate.height) : foo(convertedBlob, variant); // WOW need 3-rd param height + hash = foo(convertedBlob, variant, blockTemplate.height); if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); diff --git a/package.json b/package.json index 13df76b..c93f46a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.7.0", + "version": "0.8.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v7.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v8.0.0" } } diff --git a/proxy.js b/proxy.js index 6cc9af8..8dc6a88 100644 --- a/proxy.js +++ b/proxy.js @@ -10,8 +10,8 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.7.0"; -const DEFAULT_ALGO = [ "cn/2" ]; +const PROXY_VERSION = "0.8.0"; +const DEFAULT_ALGO = [ "cn/2", "cn/4" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; /* From 9bcfdf4711e465cd626e7f14a1b9bd3c4040e088 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 10:29:47 -0800 Subject: [PATCH 238/367] Returned line that is needed --- lib/xmr.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/xmr.js b/lib/xmr.js index 97c21f0..0553397 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -320,6 +320,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); let foo = parse_algo_func(blockTemplate.algo); + let variant = parse_algo_variant(blockTemplate.algo, blockTemplate.variant); hash = foo(convertedBlob, variant, blockTemplate.height); if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); From d7acb96de2b903f288739a4ca328b4f07904e90d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 11:03:31 -0800 Subject: [PATCH 239/367] Improved pool algo detection --- proxy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 8dc6a88..e211c82 100644 --- a/proxy.js +++ b/proxy.js @@ -920,8 +920,11 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } if (!this.pool) this.pool = defaultPools[portData.coin]; - if (this.algos) for (let algo in activePools[this.pool].default_algo_set) { - if (!(algo in this.algos)) { + const blockTemplate = activePools[this.pool].activeBlocktemplate; + + if (this.algos && blockTemplate !== null) { + const pool_algo = pool.coinFuncs.detectAlgo(activePools[this.pool].default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); + if (!(pool_algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; break; From 12b96a42f77c286c2c8fc9e6d71fada9e064f79e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 11:08:06 -0800 Subject: [PATCH 240/367] Improved pool algo detection --- proxy.js | 1 - 1 file changed, 1 deletion(-) diff --git a/proxy.js b/proxy.js index e211c82..59abc57 100644 --- a/proxy.js +++ b/proxy.js @@ -927,7 +927,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (!(pool_algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; - break; } } From 06b5280407b67585382815d16abf68962d847753 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 11:29:34 -0800 Subject: [PATCH 241/367] Fixed pool usage --- proxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 59abc57..b4b800f 100644 --- a/proxy.js +++ b/proxy.js @@ -920,10 +920,11 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } if (!this.pool) this.pool = defaultPools[portData.coin]; - const blockTemplate = activePools[this.pool].activeBlocktemplate; + const pool = activePools[this.pool]; + const blockTemplate = pool.activeBlocktemplate; if (this.algos && blockTemplate !== null) { - const pool_algo = pool.coinFuncs.detectAlgo(activePools[this.pool].default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); + const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); if (!(pool_algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; this.valid_miner = false; From 4e1ea4cf701b9eb586356ba7a8fcd28d00d17297 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 11:32:10 -0800 Subject: [PATCH 242/367] Fixed pool usage --- proxy.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/proxy.js b/proxy.js index b4b800f..8ebb3f3 100644 --- a/proxy.js +++ b/proxy.js @@ -920,14 +920,17 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } if (!this.pool) this.pool = defaultPools[portData.coin]; - const pool = activePools[this.pool]; - const blockTemplate = pool.activeBlocktemplate; - - if (this.algos && blockTemplate !== null) { - const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); - if (!(pool_algo in this.algos)) { - this.error = "Your miner does not have " + algo + " algo support. Please update it."; - this.valid_miner = false; + if (this.algos) { + const pool = activePools[this.pool]; + if (pool) { + const blockTemplate = pool.activeBlocktemplate; + if (blockTemplate) { + const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); + if (!(pool_algo in this.algos)) { + this.error = "Your miner does not have " + algo + " algo support. Please update it."; + this.valid_miner = false; + } + } } } From 7ff0249080072508c0aff04404d9809f21bbf33b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 11:35:35 -0800 Subject: [PATCH 243/367] Fixed pool usage --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 8ebb3f3..55242c2 100644 --- a/proxy.js +++ b/proxy.js @@ -924,7 +924,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { const pool = activePools[this.pool]; if (pool) { const blockTemplate = pool.activeBlocktemplate; - if (blockTemplate) { + if (blockTemplate && blockTemplate.blocktemplate_blob) { const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); if (!(pool_algo in this.algos)) { this.error = "Your miner does not have " + algo + " algo support. Please update it."; From 04c9ffab6c8880741b459433e8ecbf480843c361 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 21 Feb 2019 19:27:36 -0800 Subject: [PATCH 244/367] Removed cn/4 name --- lib/xmr.js | 6 +++--- package.json | 2 +- proxy.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 0553397..a6f6ce7 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -106,14 +106,14 @@ function parse_algo_variant(algo_str, variant) { case 'cn/wow': case 'cryptonight/wow': return 12; - case 'cn/4': - case 'cryptonight/4': return 13; + case 'cn/r': + case 'cryptonight/r': return 13; } return 1; } function detectAlgo(default_pool_algo_set, block_version) { - if ("cn/4" in default_pool_algo_set && "cn/2" in default_pool_algo_set) return block_version >= 10 ? "cn/4" : "cn/2"; // Monero fork + if ("cn/r" in default_pool_algo_set && "cn/2" in default_pool_algo_set) return block_version >= 10 ? "cn/r" : "cn/2"; // Monero fork const default_pool_algo_arr = Object.keys(default_pool_algo_set); if (default_pool_algo_arr.length == 1) return default_pool_algo_arr[0]; console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + default_pool_algo_arr.join(", ")); diff --git a/package.json b/package.json index c93f46a..00a2884 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.8.0", + "version": "0.8.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 55242c2..30977af 100644 --- a/proxy.js +++ b/proxy.js @@ -10,8 +10,8 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.8.0"; -const DEFAULT_ALGO = [ "cn/2", "cn/4" ]; +const PROXY_VERSION = "0.8.1"; +const DEFAULT_ALGO = [ "cn/2", "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; /* From 81559ad7f61a49fd0b41410ddfd7610992abdb05 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 28 Feb 2019 17:02:59 -0800 Subject: [PATCH 245/367] Fixed https://github.com/MoneroOcean/xmr-node-proxy/issues/86 again --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00a2884..3c36aaa 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v8.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v8.0.1" } } From 86472e1a36b888f97a33022875ff9d837e3cbda9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 6 Mar 2019 15:00:22 -0800 Subject: [PATCH 246/367] Added cn/rwz, cn/zls, cn/double algo support --- lib/xmr.js | 9 +++++++++ package.json | 4 ++-- proxy.js | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index a6f6ce7..e8afbe4 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -108,6 +108,15 @@ function parse_algo_variant(algo_str, variant) { case 'cn/r': case 'cryptonight/r': return 13; + + case 'cn/rwz': + case 'cryptonight/rwz': return 14; + + case 'cn/zls': + case 'cryptonight/zls': return 15; + + case 'cn/double': + case 'cryptonight/double': return 16; } return 1; } diff --git a/package.json b/package.json index 3c36aaa..536d6db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.8.1", + "version": "0.9.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v8.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.0" } } diff --git a/proxy.js b/proxy.js index 30977af..9d9400f 100644 --- a/proxy.js +++ b/proxy.js @@ -10,9 +10,9 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.8.1"; +const PROXY_VERSION = "0.9.0"; const DEFAULT_ALGO = [ "cn/2", "cn/r" ]; -const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9 }; +const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/zls": 1.3, "cn/double": 0.5 }; /* General file design/where to find things. From 36e8dd3ca54621ca80b73520444cc732a4896988 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 6 Mar 2019 15:08:46 -0800 Subject: [PATCH 247/367] Added cn/rwz perf estimation for stock xmrig --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 9d9400f..a9c2bb9 100644 --- a/proxy.js +++ b/proxy.js @@ -12,7 +12,7 @@ global.config = require('./config.json'); const PROXY_VERSION = "0.9.0"; const DEFAULT_ALGO = [ "cn/2", "cn/r" ]; -const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/zls": 1.3, "cn/double": 0.5 }; +const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; /* General file design/where to find things. From 01a15d8585d548077bfc3f2d7c2af53f76599e73 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 6 Mar 2019 15:55:47 -0800 Subject: [PATCH 248/367] Fixed build for ARM --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 536d6db..307d7fc 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.1" } } From b39f8216c74e4175263ad15da73b3f6cffa5f772 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 9 Mar 2019 10:23:43 -0800 Subject: [PATCH 249/367] Updated algo after XMR fork --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index a9c2bb9..47d3b39 100644 --- a/proxy.js +++ b/proxy.js @@ -11,7 +11,7 @@ const support = require('./lib/support.js')(); global.config = require('./config.json'); const PROXY_VERSION = "0.9.0"; -const DEFAULT_ALGO = [ "cn/2", "cn/r" ]; +const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; /* From 2d3a0c304fff7b50b3989447f24802dd3b39d665 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 9 Mar 2019 13:40:10 -0800 Subject: [PATCH 250/367] Updated algo --- config_example.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_example.json b/config_example.json index 4bb6b78..4ac0a70 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/2", + "algo": "cn/r", "blob_type": "cryptonote", "default": true }, @@ -22,7 +22,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/2", + "algo": "cn/r", "blob_type": "cryptonote", "default": false }, @@ -35,7 +35,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/2", + "algo": "cn/r", "blob_type": "cryptonote", "default": false } From abf16d88fee3e000f4cab4f9dd5b658319811b3e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 9 Mar 2019 13:56:58 -0800 Subject: [PATCH 251/367] Fixed issue with old miner detection --- proxy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy.js b/proxy.js index 47d3b39..ebb8296 100644 --- a/proxy.js +++ b/proxy.js @@ -924,10 +924,10 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { const pool = activePools[this.pool]; if (pool) { const blockTemplate = pool.activeBlocktemplate; - if (blockTemplate && blockTemplate.blocktemplate_blob) { - const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1])); + if (blockTemplate && blockTemplate.blob) { + const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blob[0]) + parseInt(blockTemplate.blob[1])); if (!(pool_algo in this.algos)) { - this.error = "Your miner does not have " + algo + " algo support. Please update it."; + this.error = "Your miner does not have " + pool_algo + " algo support. Please update it."; this.valid_miner = false; } } From eab5a7c60e1b49fabcef8f2d0fe65c4e8e3b747d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 18 Mar 2019 08:51:23 -0700 Subject: [PATCH 252/367] Moved to updated LOKI utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 307d7fc..4ce404d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.9.0", + "version": "0.9.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.0.2", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.1" } } diff --git a/proxy.js b/proxy.js index ebb8296..73f1d8c 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.9.0"; +const PROXY_VERSION = "0.9.1"; const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From ed3dd967af1d3e3f1796a75d3dcbd0b22d9d9084 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 4 Apr 2019 18:03:56 -0700 Subject: [PATCH 253/367] Updated to tagged coin utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ce404d..4d99e10 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v4.1.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.1" } } From ab84a27406c74f39af3b6e7281f23cbc44b3978a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Apr 2019 18:48:58 -0700 Subject: [PATCH 254/367] Added XTNC donate address --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 47c2109..09406c9 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ If you'd like to make a one time donation, the addresses are as follows: * TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` * LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` * TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG``` +* XTNC - ```XtazhSxz1bbJLpT2JuiD2UWFUJYSFty5SVWuF6sy2w9v8pn69smkUxkTVCQc8NKCd6CBMNDGzgdPRYBKaHdbgZ5SNptVH1yPCTQ``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` From 76ed070850c48f6623aafd767945235705654d82 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 22 Apr 2019 15:43:15 -0700 Subject: [PATCH 255/367] Updated hashing utils version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d99e10..4a23b9f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.2" } } From 2242b2037643b23dca53dffd798041aace1971c2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 17 Jun 2019 11:17:09 -0700 Subject: [PATCH 256/367] Added RandomWOW support --- lib/xmr.js | 93 ++++++++++++++++++++++++++-------------------------- package.json | 4 +-- proxy.js | 2 +- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index e8afbe4..55813b7 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -53,70 +53,76 @@ function parse_blob_type(blob_type_str) { // Names are taken from https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md -function parse_algo_variant(algo_str, variant) { - if (typeof(variant) === 'undefined' && typeof(algo_str) === 'undefined') variant = 1; - if (typeof(algo_str) === 'undefined') return variant; - switch (algo_str) { +function hash_func(convertedBlob, blockTemplate) { + switch (typeof(blockTemplate.algo) === 'undefined' ? "cn/r" : blockTemplate.algo) { case 'cn': case 'cryptonight': - case 'cn-lite': - case 'cryptonight-lite': - case 'cn-heavy': - case 'cn-heavy/0': - case 'cryptonight-heavy': - case 'cryptonight-heavy/0': case 'cn/0': - case 'cryptonight/0': - case 'cn-pico/trtl': - case 'cryptonight-pico/trtl': - case 'cn-lite/0': - case 'cryptonight-lite/0': return 0; + case 'cryptonight/0': return multiHashing.cryptonight(convertedBlob, 0); case 'cn/1': - case 'cryptonight/1': - case 'cn-lite/1': - case 'cryptonight-lite/1': - case 'cn-heavy/xhv': - case 'cryptonight-heavy/xhv': return 1; - - case 'cn-heavy/tube': - case 'cryptonight-heavy/tube': return 2; + case 'cryptonight/1': return multiHashing.cryptonight(convertedBlob, 1); case 'cn/xtl': - case 'cryptonight/xtl': return 3; + case 'cryptonight/xtl': return multiHashing.cryptonight(convertedBlob, 3); case 'cn/msr': - case 'cryptonight/msr': return 4; + case 'cryptonight/msr': return multiHashing.cryptonight(convertedBlob, 4); case 'cn/xao': - case 'cryptonight/xao': return 6; + case 'cryptonight/xao': return multiHashing.cryptonight(convertedBlob, 6); case 'cn/rto': - case 'cryptonight/rto': return 7; + case 'cryptonight/rto': return multiHashing.cryptonight(convertedBlob, 7); case 'cn/2': - case 'cryptonight/2': return 8; + case 'cryptonight/2': return multiHashing.cryptonight(convertedBlob, 8); case 'cn/half': - case 'cryptonight/half': return 9; + case 'cryptonight/half': return multiHashing.cryptonight(convertedBlob, 9); case 'cn/gpu': - case 'cryptonight/gpu': return 11; + case 'cryptonight/gpu': return multiHashing.cryptonight(convertedBlob, 11); case 'cn/wow': - case 'cryptonight/wow': return 12; + case 'cryptonight/wow': return multiHashing.cryptonight(convertedBlob, 12, blockTemplate.height); case 'cn/r': - case 'cryptonight/r': return 13; + case 'cryptonight/r': return multiHashing.cryptonight(convertedBlob, 13, blockTemplate.height); case 'cn/rwz': - case 'cryptonight/rwz': return 14; + case 'cryptonight/rwz': return multiHashing.cryptonight(convertedBlob, 14); case 'cn/zls': - case 'cryptonight/zls': return 15; + case 'cryptonight/zls': return multiHashing.cryptonight(convertedBlob, 15); case 'cn/double': - case 'cryptonight/double': return 16; + case 'cryptonight/double': return multiHashing.cryptonight(convertedBlob, 16); + + case 'cn-lite': + case 'cryptonight-lite': + case 'cn-lite/0': + case 'cryptonight-lite/0': return multiHashing.cryptonight_light(convertedBlob, 0); + + case 'cn-lite/1': + case 'cryptonight-lite/1': return multiHashing.cryptonight_light(convertedBlob, 1); + + case 'cn-heavy': + case 'cryptonight-heavy': + case 'cn-heavy/0': + case 'cryptonight-heavy/0': return multiHashing.cryptonight_heavy(convertedBlob, 0); + + case 'cn-heavy/xhv': + case 'cryptonight-heavy/xhv': return multiHashing.cryptonight_heavy(convertedBlob, 1); + + case 'cn-heavy/tube': + case 'cryptonight-heavy/tube': return multiHashing.cryptonight_heavy(convertedBlob, 2); + + case 'cn-pico/trtl': + case 'cryptonight-pico/trtl': return multiHashing.cryptonight_pico(convertedBlob, 0); + + case 'rx/wow': + case 'randomx/wow': return multiHashing.random_wow(convertedBlob, blockTemplate.seed_hash); } return 1; } @@ -129,14 +135,6 @@ function detectAlgo(default_pool_algo_set, block_version) { return default_pool_algo_arr[0]; } -function parse_algo_func(algo_str) { - if (typeof(algo_str) === 'undefined') return multiHashing.cryptonight; - if (algo_str.includes('lite')) return multiHashing.cryptonight_light; - if (algo_str.includes('heavy')) return multiHashing.cryptonight_heavy; - if (algo_str.includes('pico')) return multiHashing.cryptonight_pico; - return multiHashing.cryptonight; -} - function BlockTemplate(template) { /* We receive something identical to the result portions of the monero GBT call. @@ -150,6 +148,7 @@ function BlockTemplate(template) { this.algo = template.algo; this.difficulty = template.difficulty; this.height = template.height; + this.seed_hash = template.seed_hash; this.reservedOffset = template.reserved_offset; this.workerOffset = template.worker_offset; // clientNonceLocation this.targetDiff = template.target_diff; @@ -186,6 +185,7 @@ function MasterBlockTemplate(template) { this.algo = template.algo; this.difficulty = template.difficulty; this.height = template.height; + this.seed_hash = template.seed_hash; this.reservedOffset = template.reserved_offset; // reserveOffset this.workerOffset = template.client_nonce_offset; // clientNonceLocation this.poolOffset = template.client_pool_offset; // clientPoolLocation @@ -221,6 +221,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { id: crypto.pseudoRandomBytes(21).toString('base64'), extraNonce: activeBlockTemplate.workerNonce, height: activeBlockTemplate.height, + seed_hash: activeBlockTemplate.seed_hash, difficulty: miner.difficulty, diffHex: miner.diffHex, submissions: [], @@ -233,6 +234,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { blob: blob, job_id: newJob.id, height: activeBlockTemplate.height, + seed_hash: activeBlockTemplate.seed_hash, target: target, id: miner.id }; @@ -256,6 +258,7 @@ function getMasterJob(pool, workerID) { algo: activeBlockTemplate.algo, difficulty: activeBlockTemplate.difficulty, height: activeBlockTemplate.height, + seed_hash: activeBlockTemplate.seed_hash, reserved_offset: activeBlockTemplate.reservedOffset, worker_offset: activeBlockTemplate.workerOffset, target_diff: activeBlockTemplate.targetDiff, @@ -328,9 +331,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { // Validate share with CN hash, then if valid, blast it up to the master. let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); - let foo = parse_algo_func(blockTemplate.algo); - let variant = parse_algo_variant(blockTemplate.algo, blockTemplate.variant); - hash = foo(convertedBlob, variant, blockTemplate.height); + hash = hash_func(convertedBlob, blockTemplate); if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); diff --git a/package.json b/package.json index 4a23b9f..c178354 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.9.1", + "version": "0.10.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v9.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v10.0.0" } } diff --git a/proxy.js b/proxy.js index 73f1d8c..37dd9ba 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.9.1"; +const PROXY_VERSION = "0.10.0"; const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From 5f6cc34c61e5f4f7cc45a73e983a8b7253f8e6a4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 17 Jun 2019 15:14:41 -0700 Subject: [PATCH 257/367] Fixed rx/wow seed_hash usage --- lib/xmr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 55813b7..d1cd5e2 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -122,9 +122,9 @@ function hash_func(convertedBlob, blockTemplate) { case 'cryptonight-pico/trtl': return multiHashing.cryptonight_pico(convertedBlob, 0); case 'rx/wow': - case 'randomx/wow': return multiHashing.random_wow(convertedBlob, blockTemplate.seed_hash); + case 'randomx/wow': return multiHashing.random_wow(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex')); } - return 1; + return ""; } function detectAlgo(default_pool_algo_set, block_version) { From 9e831c305b743ab396f4642cef073afc23cb0876 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 20 Jul 2019 16:55:42 -0700 Subject: [PATCH 258/367] Added rx/loki support --- lib/xmr.js | 5 ++++- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index d1cd5e2..7b3d108 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -122,7 +122,10 @@ function hash_func(convertedBlob, blockTemplate) { case 'cryptonight-pico/trtl': return multiHashing.cryptonight_pico(convertedBlob, 0); case 'rx/wow': - case 'randomx/wow': return multiHashing.random_wow(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex')); + case 'randomx/wow': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 17); + + case 'rx/loki': + case 'randomx/loki': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 18); } return ""; } diff --git a/package.json b/package.json index c178354..5be041d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.10.0", + "version": "0.11.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v10.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v11.0.0" } } diff --git a/proxy.js b/proxy.js index 37dd9ba..b6c57a6 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.10.0"; +const PROXY_VERSION = "0.11.0"; const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From b264219c511a310e759df6b0ee8bbe35bdcd34eb Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 15 Aug 2019 13:55:21 -0700 Subject: [PATCH 259/367] Added XLA support --- lib/xmr.js | 2 ++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 7b3d108..a4dfce2 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -126,6 +126,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'rx/loki': case 'randomx/loki': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 18); + + case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); } return ""; } diff --git a/package.json b/package.json index 5be041d..f44f6ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.11.0", + "version": "0.12.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v11.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v12.0.0" } } diff --git a/proxy.js b/proxy.js index b6c57a6..aa17f5f 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.11.0"; +const PROXY_VERSION = "0.12.0"; const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From 478e452f2b67ef089f492cee1ca1b492f3eec772 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 18 Aug 2019 23:02:59 -0700 Subject: [PATCH 260/367] Argon2 algo support --- lib/xmr.js | 5 +++++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index a4dfce2..6878d64 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -128,6 +128,11 @@ function hash_func(convertedBlob, blockTemplate) { case 'randomx/loki': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 18); case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); + + case 'argon2/chukwa': + case 'chukwa': return multiHashing.argon2(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 0); + + case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); } return ""; } diff --git a/package.json b/package.json index f44f6ff..82ef928 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.12.0", + "version": "0.13.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v12.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.0" } } diff --git a/proxy.js b/proxy.js index aa17f5f..edd8e7b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.12.0"; +const PROXY_VERSION = "0.13.0"; const DEFAULT_ALGO = [ "cn/r" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From 4e6d8381919f665637264cd0e48bcb6e0343ff13 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 19 Aug 2019 14:23:15 -0700 Subject: [PATCH 261/367] Moved version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 82ef928..396a75f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.1" } } From 7f78feac067d1e5d14074eb51701b234cc698c0c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 28 Aug 2019 09:12:48 -0700 Subject: [PATCH 262/367] Moved version of hashing utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 396a75f..29c7e15 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.2" } } From e27da841e16b4209983bf0f693374ac3508815ac Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 28 Aug 2019 11:20:42 -0700 Subject: [PATCH 263/367] Moved version of hashing utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29c7e15..e2f1e40 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.3" } } From d508c6a4e4f9c49e418fda490b23a2b803d174e2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 28 Aug 2019 11:32:35 -0700 Subject: [PATCH 264/367] Moved version of hashing utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2f1e40..c0ef59c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.3" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.4" } } From cfd9119091fb10a24cd538a7c8103d7954965497 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 30 Aug 2019 08:50:46 -0700 Subject: [PATCH 265/367] Fixed TRTL support --- lib/xmr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 6878d64..8806a2f 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -130,9 +130,9 @@ function hash_func(convertedBlob, blockTemplate) { case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); case 'argon2/chukwa': - case 'chukwa': return multiHashing.argon2(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 0); + case 'chukwa': return multiHashing.argon2(convertedBlob, 0); - case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); + case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); } return ""; } From 1b4cdba20bf1ca4cc2991d7d9eb03da9de53aa29 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 11 Oct 2019 14:53:19 -0700 Subject: [PATCH 266/367] rx/0, rx/arq and k12 algo support --- config_example.json | 6 +++--- lib/xmr.js | 12 ++++++++++-- package.json | 4 ++-- proxy.js | 4 ++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config_example.json b/config_example.json index 4ac0a70..04235bd 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/r", + "algo": [ "cn/r", "rx/0" ], "blob_type": "cryptonote", "default": true }, @@ -22,7 +22,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/r", + "algo": [ "cn/r", "rx/0" ], "blob_type": "cryptonote", "default": false }, @@ -35,7 +35,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": "cn/r", + "algo": [ "cn/r", "rx/0" ], "blob_type": "cryptonote", "default": false } diff --git a/lib/xmr.js b/lib/xmr.js index 8806a2f..875b382 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -54,7 +54,11 @@ function parse_blob_type(blob_type_str) { // Names are taken from https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md function hash_func(convertedBlob, blockTemplate) { - switch (typeof(blockTemplate.algo) === 'undefined' ? "cn/r" : blockTemplate.algo) { + const block_version = 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1]); + const algo2 = typeof(blockTemplate.algo) === 'undefined' ? (block_version >= 12 ? "rx/0" : "cn/r") : blockTemplate.algo; + switch (algo2) { + case 'rx/0': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 0); + case 'cn': case 'cryptonight': case 'cn/0': @@ -129,16 +133,20 @@ function hash_func(convertedBlob, blockTemplate) { case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); + case 'rx/arq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 2); + case 'argon2/chukwa': case 'chukwa': return multiHashing.argon2(convertedBlob, 0); case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); + + case 'k12': return multiHashing.k12(convertedBlob); } return ""; } function detectAlgo(default_pool_algo_set, block_version) { - if ("cn/r" in default_pool_algo_set && "cn/2" in default_pool_algo_set) return block_version >= 10 ? "cn/r" : "cn/2"; // Monero fork + if ("cn/r" in default_pool_algo_set && "rx/0" in default_pool_algo_set) return block_version >= 12 ? "rx/0" : "cn/r"; // Monero fork const default_pool_algo_arr = Object.keys(default_pool_algo_set); if (default_pool_algo_arr.length == 1) return default_pool_algo_arr[0]; console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + default_pool_algo_arr.join(", ")); diff --git a/package.json b/package.json index c0ef59c..e3be5b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.13.0", + "version": "0.14.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v13.0.4" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.0.0" } } diff --git a/proxy.js b/proxy.js index edd8e7b..888beb3 100644 --- a/proxy.js +++ b/proxy.js @@ -10,8 +10,8 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.13.0"; -const DEFAULT_ALGO = [ "cn/r" ]; +const PROXY_VERSION = "0.14.0"; +const DEFAULT_ALGO = [ "cn/r", "rx/0" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; /* From 3b59fba929b65f722baa772acb41444a4d04f3e5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 11 Oct 2019 15:10:17 -0700 Subject: [PATCH 267/367] Fixed BT version --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 875b382..44055a9 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -54,7 +54,7 @@ function parse_blob_type(blob_type_str) { // Names are taken from https://github.com/xmrig/xmrig-proxy/blob/master/doc/STRATUM_EXT.md function hash_func(convertedBlob, blockTemplate) { - const block_version = 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1]); + const block_version = typeof(blockTemplate.blocktemplate_blob) !== 'undefined' ? 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1]) : 0; const algo2 = typeof(blockTemplate.algo) === 'undefined' ? (block_version >= 12 ? "rx/0" : "cn/r") : blockTemplate.algo; switch (algo2) { case 'rx/0': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 0); From 7410696f0e4b5d46b3ca5f135229a9112ab4266d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 25 Oct 2019 17:52:04 -0700 Subject: [PATCH 268/367] Aeon support --- lib/xmr.js | 4 +++- package.json | 4 ++-- proxy.js | 10 ++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 44055a9..5555668 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -47,6 +47,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_ryo': return 4; // Ryo case 'cryptonote_loki': return 5; // Loki case 'cryptonote3': return 6; // Masari + case 'aeon': return 7; // Aeon } return 0; } @@ -140,7 +141,7 @@ function hash_func(convertedBlob, blockTemplate) { case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); - case 'k12': return multiHashing.k12(convertedBlob); + case 'kangarootwelve': return multiHashing.k12(convertedBlob); } return ""; } @@ -237,6 +238,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { let newJob = { id: crypto.pseudoRandomBytes(21).toString('base64'), + blob_type: activeBlockTemplate.blob_type, extraNonce: activeBlockTemplate.workerNonce, height: activeBlockTemplate.height, seed_hash: activeBlockTemplate.seed_hash, diff --git a/package.json b/package.json index e3be5b0..2eb7b53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.14.0", + "version": "0.15.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,7 +26,7 @@ "moment": "2.21.0", "request": "^2.79.0", "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v5.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v6.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.0.0" } } diff --git a/proxy.js b/proxy.js index 888beb3..1a08a43 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.14.0"; +const PROXY_VERSION = "0.15.0"; const DEFAULT_ALGO = [ "cn/r", "rx/0" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; @@ -39,7 +39,8 @@ let debug = { misc: require('debug')('misc') }; global.threadName = ''; -let nonceCheck = new RegExp("^[0-9a-f]{8}$"); +const nonceCheck32 = new RegExp("^[0-9a-f]{8}$"); +const nonceCheck64 = new RegExp("^[0-9a-f]{16}$"); let activePorts = []; let httpResponse = ' 200 OK\nContent-Type: text/plain\nContent-Length: 19\n\nMining Proxy Online'; let activeMiners = {}; @@ -1144,8 +1145,9 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m return; } - params.nonce = params.nonce.substr(0, 8).toLowerCase(); - if (!nonceCheck.test(params.nonce)) { + const nonceCheck = job.blob_type == 7 ? nonceCheck64 : nonceCheck32; + + if ((typeof params.nonce !== 'string') || !nonceCheck.test(params.nonce)) { console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString); sendReply('Duplicate share'); return; From 9081f151a0994cadba27e2df3c59c39bf5a8ee90 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 25 Oct 2019 18:05:15 -0700 Subject: [PATCH 269/367] Aeon support --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 5555668..b27f179 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -141,7 +141,7 @@ function hash_func(convertedBlob, blockTemplate) { case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); - case 'kangarootwelve': return multiHashing.k12(convertedBlob); + case 'k12': return multiHashing.k12(convertedBlob); } return ""; } From cfb7fc6e90101cae4fa44ff230f16fc870ab8efd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 25 Oct 2019 18:22:12 -0700 Subject: [PATCH 270/367] Aeon support --- lib/xmr.js | 6 +++--- package.json | 2 +- proxy.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index b27f179..ed0bd07 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -233,7 +233,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { } let blob = activeBlockTemplate.nextBlob(); - let target = getTargetHex(miner, activeBlockTemplate.targetDiff); + let target = getTargetHex(miner, activeBlockTemplate.targetDiff, activeBlockTemplate.blob_type == 7 ? 8 : 4); miner.lastBlockHeight = activeBlockTemplate.height; let newJob = { @@ -296,7 +296,7 @@ function getMasterJob(pool, workerID) { return workerData; } -function getTargetHex(miner, max_diff) { +function getTargetHex(miner, max_diff, size) { if (miner.newDiff) { miner.difficulty = miner.newDiff; miner.newDiff = null; @@ -308,7 +308,7 @@ function getTargetHex(miner, max_diff) { let diffBuff = baseDiff.div(miner.difficulty).toBuffer(); diffBuff.copy(padded, 32 - diffBuff.length); - let buff = padded.slice(0, 4); + let buff = padded.slice(0, size); let buffArray = buff.toByteArray().reverse(); let buffReversed = new Buffer(buffArray); miner.target = buffReversed.readUInt32BE(0); diff --git a/package.json b/package.json index 2eb7b53..e958637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.15.0", + "version": "0.15.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 1a08a43..1680f5b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.15.0"; +const PROXY_VERSION = "0.15.1"; const DEFAULT_ALGO = [ "cn/r", "rx/0" ]; const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; From 3f2d83696c63e391bd9b543eaea09374d01f4a61 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 30 Nov 2019 11:24:09 -0800 Subject: [PATCH 271/367] Post rx/0 update --- config_example.json | 6 +++--- lib/xmr.js | 2 +- package.json | 2 +- proxy.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config_example.json b/config_example.json index 04235bd..d45a9bc 100644 --- a/config_example.json +++ b/config_example.json @@ -9,7 +9,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": [ "cn/r", "rx/0" ], + "algo": "rx/0", "blob_type": "cryptonote", "default": true }, @@ -22,7 +22,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": [ "cn/r", "rx/0" ], + "algo": "rx/0", "blob_type": "cryptonote", "default": false }, @@ -35,7 +35,7 @@ "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", "password": "proxy", "keepAlive": true, - "algo": [ "cn/r", "rx/0" ], + "algo": "rx/0", "blob_type": "cryptonote", "default": false } diff --git a/lib/xmr.js b/lib/xmr.js index ed0bd07..2700f50 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -56,7 +56,7 @@ function parse_blob_type(blob_type_str) { function hash_func(convertedBlob, blockTemplate) { const block_version = typeof(blockTemplate.blocktemplate_blob) !== 'undefined' ? 16 * parseInt(blockTemplate.blocktemplate_blob[0]) + parseInt(blockTemplate.blocktemplate_blob[1]) : 0; - const algo2 = typeof(blockTemplate.algo) === 'undefined' ? (block_version >= 12 ? "rx/0" : "cn/r") : blockTemplate.algo; + const algo2 = typeof(blockTemplate.algo) === 'undefined' ? "rx/0" : blockTemplate.algo; switch (algo2) { case 'rx/0': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 0); diff --git a/package.json b/package.json index e958637..2d58dab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.15.1", + "version": "0.15.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 1680f5b..8be6be8 100644 --- a/proxy.js +++ b/proxy.js @@ -10,9 +10,9 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.15.1"; -const DEFAULT_ALGO = [ "cn/r", "rx/0" ]; -const DEFAULT_ALGO_PERF = { "cn": 1, "cn/half": 1.9, "cn/rwz": 1.3, "cn/zls": 1.3, "cn/double": 0.5 }; +const PROXY_VERSION = "0.15.2"; +const DEFAULT_ALGO = [ "rx/0" ]; +const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; /* General file design/where to find things. From f437f57000ba8ec840ef0ff0afc797b2fd4a3688 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 2 Dec 2019 16:30:51 -0800 Subject: [PATCH 272/367] Fixed fail when pool does not send job --- proxy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy.js b/proxy.js index 8be6be8..db58943 100644 --- a/proxy.js +++ b/proxy.js @@ -808,6 +808,11 @@ function handlePoolMessage(jsonData, hostname){ let sendLog = pool.sendLog[jsonData.id]; switch(sendLog.method){ case 'login': + if (typeof jsonData.result.job == 'undefined') { + console.error(`${global.threadName}Empty response from pool ${pool.hostname}`); + activePools[hostname].disable(); + return; + } pool.id = jsonData.result.id; handleNewBlockTemplate(jsonData.result.job, hostname); break; From 227247983a1e75e0f8c1a3f070a54531f034baf4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 10 Dec 2019 21:49:19 -0800 Subject: [PATCH 273/367] Added configurable algo_perf --- config_example.json | 3 +++ package.json | 2 +- proxy.js | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config_example.json b/config_example.json index d45a9bc..bca6f30 100644 --- a/config_example.json +++ b/config_example.json @@ -10,6 +10,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", + "algo_perf": { "rx/0": 1, "rx/loki": 1 }, "blob_type": "cryptonote", "default": true }, @@ -23,6 +24,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", + "algo_perf": { "rx/0": 1, "rx/loki": 1 }, "blob_type": "cryptonote", "default": false }, @@ -36,6 +38,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", + "algo_perf": { "rx/0": 1, "rx/loki": 1 }, "blob_type": "cryptonote", "default": false } diff --git a/package.json b/package.json index 2d58dab..5f48fce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.15.2", + "version": "0.15.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index db58943..a9fb9ef 100644 --- a/proxy.js +++ b/proxy.js @@ -10,7 +10,7 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.15.2"; +const PROXY_VERSION = "0.15.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; @@ -211,7 +211,7 @@ function Pool(poolData){ this.default_algo_set = {}; this.algos = {}; for (let i in algo_arr) this.algos[algo_arr[i]] = this.default_algo_set[algo_arr[i]] = 1; - this.algos_perf = DEFAULT_ALGO_PERF; + this.algos_perf = this.default_algos_perf = poolData.algo_perf && poolData.algo_perf instanceof Object ? poolData.algo_perf : DEFAULT_ALGO_PERF; this.blob_type = poolData.blob_type; @@ -730,7 +730,7 @@ function enumerateWorkerStats() { // do update of algo/algo-perf if it was changed for (let pool in pool_algos) { let pool_algos_perf2 = pool_algos_perf[pool]; - if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2 = DEFAULT_ALGO_PERF; + if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2 = activePools[pool].default_algos_perf; activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf2); } From 8c80d715a795c9f5d249f7783bc5defed2b4cc3a Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 10 Dec 2019 22:06:57 -0800 Subject: [PATCH 274/367] Updated maxdiff --- config_example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_example.json b/config_example.json index bca6f30..e7e16ca 100644 --- a/config_example.json +++ b/config_example.json @@ -80,7 +80,7 @@ "coinSettings": { "xmr":{ "minDiff": 100, - "maxDiff": 300000, + "maxDiff": 10000000, "shareTargetTime": 15 } } From 1d733c0efdd2623fa751222b4e4f208b9bf59140 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 15 Dec 2019 16:01:19 -0800 Subject: [PATCH 275/367] Added rx/v support --- config_example.json | 6 +++--- lib/xmr.js | 2 ++ package.json | 2 +- proxy.js | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config_example.json b/config_example.json index e7e16ca..37a480b 100644 --- a/config_example.json +++ b/config_example.json @@ -10,7 +10,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1 }, + "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, "blob_type": "cryptonote", "default": true }, @@ -24,7 +24,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1 }, + "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, "blob_type": "cryptonote", "default": false }, @@ -38,7 +38,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1 }, + "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, "blob_type": "cryptonote", "default": false } diff --git a/lib/xmr.js b/lib/xmr.js index 2700f50..8501e51 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -132,6 +132,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'rx/loki': case 'randomx/loki': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 18); + case 'rx/v': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 19); + case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); case 'rx/arq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 2); diff --git a/package.json b/package.json index 5f48fce..29572f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.15.3", + "version": "0.15.4", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index a9fb9ef..ba41f4b 100644 --- a/proxy.js +++ b/proxy.js @@ -10,9 +10,9 @@ const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.15.3"; +const PROXY_VERSION = "0.15.4"; const DEFAULT_ALGO = [ "rx/0" ]; -const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; +const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }; /* General file design/where to find things. From b6ea254db4460193c545809fb7b78526b6867b6c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 15 Dec 2019 19:58:42 -0800 Subject: [PATCH 276/367] Updated utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29572f6..1fcd07f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v6.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.1.0" } } From e7b8f2eecc8cfecd42927fa42b4a900e500e0966 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 15 Dec 2019 20:02:18 -0800 Subject: [PATCH 277/367] Updated utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1fcd07f..ba792ea 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "request": "^2.79.0", "uuid": "3.0.1", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v6.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.1.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.1.1" } } From 1473a54bdde03cabc983d2fe1939c9b49630aaa0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 25 Dec 2019 23:01:53 -0800 Subject: [PATCH 278/367] c29 algo support --- README.md | 5 +- config_example.json | 21 +-- lib/support.js | 21 +++ lib/xmr.js | 111 ++++++++++------ package.json | 7 +- proxy.js | 317 ++++++++++++++++++++++++++++---------------- 6 files changed, 313 insertions(+), 169 deletions(-) diff --git a/README.md b/README.md index 09406c9..35b2d83 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ If you'd like to make a one time donation, the addresses are as follows: * MSR - ```5hnMXUKArLDRue5tWsNpbmGLsLQibt23MEsV3VGwY6MGStYwfTqHkff4BgvziprTitbcDYYpFXw2rEgXeipsABTtEmcmnCK``` * ITNS - ```iz53aMEaKJ25zB8xku3FQK5VVvmu2v6DENnbGHRmn659jfrGWBH1beqAzEVYaKhTyMZcxLJAdaCW3Kof1DwTiTbp1DSqLae3e``` * WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` -* XMV - ```4BDgQohRBqg2wFZ5ezYqCrNGjgECAttARdbh1fNkuAbd3HnNkSgas11QD9VFQMzbnvDD3Mfcky1LAFihkbEYph5oGAMLurw``` +* XMV - ```XvyVfpAYp3zSuvdtoHgnDzMUf7GAeiumeUgVC7RTq6SfgtzGEzy4dUgfEEfD5adk1kN4dfVZdT3zZdgSD2xmVBs627Vwt2C3Ey``` * RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` * XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` * XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` @@ -189,6 +189,9 @@ If you'd like to make a one time donation, the addresses are as follows: * LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` * TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG``` * XTNC - ```XtazhSxz1bbJLpT2JuiD2UWFUJYSFty5SVWuF6sy2w9v8pn69smkUxkTVCQc8NKCd6CBMNDGzgdPRYBKaHdbgZ5SNptVH1yPCTQ``` +* IRD - ```ir3DHyB8Ub1aAHEewMeUxQ7b7tQdWa7VL8M5oXDPohS3Me4nhwvALXM4mym2kWg9VsceT75dm6XWiWF1K4zu8RVQ1HJD8Z3R9``` +* ARQ - ```ar4Ha6ZQCkKRhkKQLfexv7VZQM2MhUmMmU9hmzswCPK4T3o2rbPKZM1GxEoYg4AFQsh57PsEets7sbpU958FAvxo2RkkTQ1gE``` +* XWP - ```fh4MCJrakhWGoS6Meqp6UxGE1GNfAjKaRdPjW36rTffDiqvEq2HWEKZhrbYRw7XJb3CXxkjL3tcYGTT39m5qgjvk1ap4bVu1R``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` diff --git a/config_example.json b/config_example.json index 37a480b..46f7911 100644 --- a/config_example.json +++ b/config_example.json @@ -10,7 +10,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, + "algo_perf": { "rx/0": 1, "rx/loki": 1 }, "blob_type": "cryptonote", "default": true }, @@ -24,7 +24,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, + "algo_perf": { "rx/0": 1 }, "blob_type": "cryptonote", "default": false }, @@ -38,7 +38,7 @@ "password": "proxy", "keepAlive": true, "algo": "rx/0", - "algo_perf": { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }, + "algo_perf": { "rx/0": 1, "rx/loki": 1 }, "blob_type": "cryptonote", "default": false } @@ -47,17 +47,22 @@ { "port": 8080, "ssl": false, - "diff": 5000 + "diff": 10000 }, { "port": 8443, "ssl": true, - "diff": 5000 + "diff": 10000 }, { "port": 3333, "ssl": false, - "diff": 10000 + "diff": 1000 + }, + { + "port": 1111, + "ssl": false, + "diff": 1 } ], "bindAddress": "0.0.0.0", @@ -79,9 +84,9 @@ "theme": "light", "coinSettings": { "xmr":{ - "minDiff": 100, + "minDiff": 1, "maxDiff": 10000000, - "shareTargetTime": 15 + "shareTargetTime": 30 } } } diff --git a/lib/support.js b/lib/support.js index e5c7f09..ae33238 100644 --- a/lib/support.js +++ b/lib/support.js @@ -4,6 +4,25 @@ const request = require('request'); const debug = require('debug')('support'); const fs = require('fs'); +function get_new_id() { + const min = 100000000000000; + const max = 999999999999999; + const id = Math.floor(Math.random() * (max - min + 1)) + min; + return id.toString(); +}; + +function human_hashrate(hashes, algo) { + const power = Math.pow(10, 2 || 0); + const unit = algo === "c29s" || algo === "c29v" ? "G" : "H"; + if (algo === "c29s") hashes *= 32; + if (algo === "c29v") hashes *= 16; + if (hashes > 1000000000000) return String(Math.round((hashes / 1000000000000) * power) / power) + " T" + unit + "/s"; + if (hashes > 1000000000) return String(Math.round((hashes / 1000000000) * power) / power) + " G" + unit + "/s"; + if (hashes > 1000000) return String(Math.round((hashes / 1000000) * power) / power) + " M" + unit + "/s"; + if (hashes > 1000) return String(Math.round((hashes / 1000) * power) / power) + " K" + unit + "/s"; + return ( hashes || 0.0 ).toFixed(2) + " " + unit + "/s" +}; + function circularBuffer(size) { let buffer = CircularBuffer(size); @@ -92,6 +111,8 @@ function currentUnixTimestamp(){ module.exports = function () { return { + get_new_id: get_new_id, + human_hashrate: human_hashrate, circularBuffer: circularBuffer, coinToDecimal: coinToDecimal, decimalToCoin: decimalToCoin, diff --git a/lib/xmr.js b/lib/xmr.js index 8501e51..949e21e 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -3,7 +3,6 @@ const multiHashing = require('cryptonight-hashing'); const cnUtil = require('cryptoforknote-util'); const bignum = require('bignum'); const support = require('./support.js')(); -const crypto = require('crypto'); let debug = { pool: require('debug')('pool'), @@ -22,7 +21,6 @@ Buffer.prototype.toByteArray = function () { function blockHeightCheck(nodeList, callback) { let randomNode = nodeList[Math.floor(Math.random() * nodeList.length)].split(':'); - } function getRemoteNodes() { @@ -48,6 +46,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_loki': return 5; // Loki case 'cryptonote3': return 6; // Masari case 'aeon': return 7; // Aeon + case 'cuckaroo': return 8; // Swap/XTNC/MoneroV } return 0; } @@ -148,6 +147,14 @@ function hash_func(convertedBlob, blockTemplate) { return ""; } +function hash_func_c29(algo, header, ring) { + switch (algo) { + case 'c29s': return multiHashing.c29s(header, ring); + case 'c29v': return multiHashing.c29v(header, ring); + default: return 1; + } +} + function detectAlgo(default_pool_algo_set, block_version) { if ("cn/r" in default_pool_algo_set && "rx/0" in default_pool_algo_set) return block_version >= 12 ? "rx/0" : "cn/r"; // Monero fork const default_pool_algo_arr = Object.keys(default_pool_algo_set); @@ -234,12 +241,12 @@ function getJob(miner, activeBlockTemplate, bashCache) { return miner.cachedJob; } - let blob = activeBlockTemplate.nextBlob(); - let target = getTargetHex(miner, activeBlockTemplate.targetDiff, activeBlockTemplate.blob_type == 7 ? 8 : 4); + const blob = activeBlockTemplate.nextBlob(); + adjustMinerDiff(miner, activeBlockTemplate.targetDiff); miner.lastBlockHeight = activeBlockTemplate.height; let newJob = { - id: crypto.pseudoRandomBytes(21).toString('base64'), + id: support.get_new_id(), blob_type: activeBlockTemplate.blob_type, extraNonce: activeBlockTemplate.workerNonce, height: activeBlockTemplate.height, @@ -252,13 +259,23 @@ function getJob(miner, activeBlockTemplate, bashCache) { miner.validJobs.enq(newJob); - miner.cachedJob = { - blob: blob, - job_id: newJob.id, - height: activeBlockTemplate.height, - seed_hash: activeBlockTemplate.seed_hash, - target: target, - id: miner.id + if (activeBlockTemplate.blob_type == 8) miner.cachedJob = { + pre_pow: blob, + algo: "cuckaroo", + edgebits: 29, + proofsize: 32, + noncebytes: 4, + height: activeBlockTemplate.height, + job_id: newJob.id, + difficulty: miner.difficulty, + id: miner.id + }; else miner.cachedJob = { + blob: blob, + job_id: newJob.id, + height: activeBlockTemplate.height, + seed_hash: activeBlockTemplate.seed_hash, + target: getTargetHex(miner.difficulty, activeBlockTemplate.blob_type == 7 ? 8 : 4), + id: miner.id }; if (typeof (activeBlockTemplate.variant) !== 'undefined') { miner.cachedJob.variant = activeBlockTemplate.variant; @@ -273,7 +290,7 @@ function getMasterJob(pool, workerID) { let activeBlockTemplate = pool.activeBlocktemplate; let btBlob = activeBlockTemplate.blobForWorker(); let workerData = { - id: crypto.pseudoRandomBytes(21).toString('base64'), + id: support.get_new_id(), blocktemplate_blob: btBlob, blob_type: activeBlockTemplate.blob_type, variant: activeBlockTemplate.variant, @@ -298,7 +315,7 @@ function getMasterJob(pool, workerID) { return workerData; } -function getTargetHex(miner, max_diff, size) { +function adjustMinerDiff(miner, max_diff) { if (miner.newDiff) { miner.difficulty = miner.newDiff; miner.newDiff = null; @@ -306,16 +323,18 @@ function getTargetHex(miner, max_diff, size) { if (miner.difficulty > max_diff) { miner.difficulty = max_diff; } - let padded = Buffer.alloc(32); - let diffBuff = baseDiff.div(miner.difficulty).toBuffer(); - diffBuff.copy(padded, 32 - diffBuff.length); +} - let buff = padded.slice(0, size); - let buffArray = buff.toByteArray().reverse(); - let buffReversed = new Buffer(buffArray); - miner.target = buffReversed.readUInt32BE(0); +function getTargetHex(difficulty, size) { + let padded = new Buffer(32); + padded.fill(0); + const diffBuff = baseDiff.div(difficulty).toBuffer(); + diffBuff.copy(padded, 32 - diffBuff.length); + const buff = padded.slice(0, size); + const buffArray = buff.toByteArray().reverse(); + const buffReversed = new Buffer(buffArray); return buffReversed.toString('hex'); -} +}; // MAX_VER_SHARES_PER_SEC is maximum amount of verified shares for VER_SHARES_PERIOD second period // other shares are just dumped to the pool to avoid proxy CPU overload during low difficulty adjustement period @@ -329,7 +348,14 @@ let poolShareSize = {}; let poolShareCount = {}; let poolShareTime = {}; -function processShare(miner, job, blockTemplate, nonce, resultHash) { +function hash_buff_diff(hash) { + return baseDiff.div(bignum.fromBuffer(new Buffer(hash.toByteArray().reverse()))); +} + +function processShare(miner, job, blockTemplate, params) { + const blob_type = job.blob_type; + const nonce = params.nonce; + let template = new Buffer(blockTemplate.buffer.length); blockTemplate.buffer.copy(template); if (blockTemplate.solo) { @@ -338,10 +364,7 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { template.writeUInt32BE(job.extraNonce, blockTemplate.workerOffset); } - let hash = new Buffer(resultHash, 'hex'); - let hashArray = hash.toByteArray().reverse(); - let hashNum = bignum.fromBuffer(new Buffer(hashArray)); - let hashDiff = baseDiff.div(hashNum); + const hashDiff = hash_buff_diff(blob_type == 8 ? multiHashing.c29_cycle_hash(params.pow) : new Buffer(params.result, 'hex')); if (hashDiff.ge(blockTemplate.targetDiff)) { let time_now = Date.now(); @@ -349,18 +372,27 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { verified_share_num = 0; verified_share_start_period = time_now; } - if (++ verified_share_num <= MAX_VER_SHARES_PER_SEC*VER_SHARES_PERIOD) { - // Validate share with CN hash, then if valid, blast it up to the master. - let shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blockTemplate.blob_type); - let convertedBlob = cnUtil.convert_blob(shareBuffer, blockTemplate.blob_type); - hash = hash_func(convertedBlob, blockTemplate); - if (hash.toString('hex') !== resultHash) { - console.error(global.threadName + "Bad share from miner " + miner.logString); - miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); - return false; - } + let isVerifyFailed = false; + + if (blob_type == 8) { + const shareBuffer = cnUtil.construct_block_blob(template, bignum(nonce, 10).toBuffer({endian: 'little', size: 4}), blob_type, params.pow) + const header = Buffer.concat([cnUtil.convert_blob(shareBuffer, blob_type), bignum(nonce, 10).toBuffer({endian: 'big', size: 4})]); + if (hash_func_c29(blockTemplate.algo, header, params.pow)) isVerifyFailed = true; } else { - console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload: " + miner.logString); + if (++ verified_share_num <= MAX_VER_SHARES_PER_SEC*VER_SHARES_PERIOD) { + // Validate share with CN hash, then if valid, blast it up to the master. + const shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blob_type); + const convertedBlob = cnUtil.convert_blob(shareBuffer, blob_type); + const hash = hash_func(convertedBlob, blockTemplate); + if (hash.toString('hex') !== params.result) isVerifyFailed = true; + } else { + console.error(global.threadName + "Throttling down miner share verification to avoid CPU overload: " + miner.logString); + } + } + if (isVerifyFailed) { + console.error(global.threadName + "Bad share from miner " + miner.logString); + miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); + return false; } miner.blocks += 1; const poolName = miner.pool; @@ -370,7 +402,8 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { data: { btID: blockTemplate.id, nonce: nonce, - resultHash: resultHash, + pow: params.pow, + resultHash: params.result, workerNonce: job.extraNonce } }); diff --git a/package.json b/package.json index ba792ea..24249c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.15.4", + "version": "0.16.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,8 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "uuid": "3.0.1", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v6.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v15.1.1" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v16.0.1" } } diff --git a/proxy.js b/proxy.js index ba41f4b..8edef8a 100644 --- a/proxy.js +++ b/proxy.js @@ -6,13 +6,12 @@ const http = require('http'); const moment = require('moment'); const fs = require('fs'); const async = require('async'); -const uuidV4 = require('uuid/v4'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.15.4"; +const PROXY_VERSION = "0.16.0"; const DEFAULT_ALGO = [ "rx/0" ]; -const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1, "rx/v": 1 }; +const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; /* General file design/where to find things. @@ -102,7 +101,7 @@ function slaveMessageHandler(message) { if (activeMiners.hasOwnProperty(miner)){ let realMiner = activeMiners[miner]; if (realMiner.pool === message.host){ - realMiner.messageSender('job', realMiner.getJob(realMiner, activePools[message.host].activeBlocktemplate)); + realMiner.pushNewJob(); } } } @@ -123,8 +122,7 @@ function slaveMessageHandler(message) { case 'changePool': if (activeMiners.hasOwnProperty(message.worker) && activePools.hasOwnProperty(message.pool)){ activeMiners[message.worker].pool = message.pool; - activeMiners[message.worker].messageSender('job', - activeMiners[message.worker].getJob(activeMiners[message.worker], activePools[message.pool].activeBlocktemplate, true)); + activeMiners[message.worker].pushNewJob(true); } break; case 'disablePool': @@ -326,14 +324,16 @@ function Pool(poolData){ let job = this.poolJobs[worker.id].toarray().filter(function (job) { return job.id === shareData.btID; })[0]; - if (job){ - this.sendData('submit', { - job_id: job.masterJobID, - nonce: shareData.nonce, - result: shareData.resultHash, + if (job) { + let submitParams = { + job_id: job.masterJobID, + nonce: shareData.nonce, workerNonce: shareData.workerNonce, - poolNonce: job.poolNonce - }); + poolNonce: job.poolNonce + }; + if (shareData.resultHash) submitParams.result = shareData.resultHash; + if (shareData.pow) submitParams.pow = shareData.pow; + this.sendData('submit', submitParams); } }; } @@ -656,6 +656,8 @@ function balanceWorkers(){ } } +let hs_algo = ""; // common algo for human_hashrate + function enumerateWorkerStats() { let stats, global_stats = {miners: 0, hashes: 0, hashRate: 0, diff: 0}; let pool_algos = {}; @@ -719,7 +721,7 @@ function enumerateWorkerStats() { let pool_hs = ""; for (let coin in poolStates) { if (!poolStates.hasOwnProperty(coin)) continue; - for (let pool in poolStates[coin] ){ + for (let pool in poolStates[coin]) { if (!poolStates[coin].hasOwnProperty(pool) || !activePools.hasOwnProperty(pool) || poolStates[coin][pool].devPool || poolStates[coin][pool].hashrate === 0) continue; if (pool_hs != "") pool_hs += ", "; pool_hs += `${pool}/${poolStates[coin][pool].percentage.toFixed(2)}%`; @@ -728,13 +730,22 @@ function enumerateWorkerStats() { if (pool_hs != "") pool_hs = " (" + pool_hs + ")"; // do update of algo/algo-perf if it was changed + hs_algo = ""; // common algo for human_hashrate for (let pool in pool_algos) { let pool_algos_perf2 = pool_algos_perf[pool]; if (Object.keys(pool_algos_perf2).length === 0) pool_algos_perf2 = activePools[pool].default_algos_perf; activePools[pool].update_algo_perf(pool_algos[pool], pool_algos_perf2); + if (Object.keys(pool_algos[pool]).length == 1) { + if ("c29s" in pool_algos[pool]) hs_algo = (hs_algo === "c29s" || hs_algo === "") ? "c29s" : "h/s"; + else if ("c29v" in pool_algos[pool]) hs_algo = (hs_algo === "c29v" || hs_algo === "") ? "c29v" : "h/s"; + else hs_algo = "h/s"; + } else { + hs_algo = "h/s"; + } } - console.log(`The proxy currently has ${global_stats.miners} miners connected at ${global_stats.hashRate} h/s${pool_hs} with an average diff of ${Math.floor(global_stats.diff/global_stats.miners)}`); + const hs = support.human_hashrate(global_stats.hashRate, hs_algo); + console.log(`The proxy currently has ${global_stats.miners} miners connected at ${hs}${pool_hs}` + (global_stats.miners ? ` with an average diff of ${Math.floor(global_stats.diff/global_stats.miners)}` : "")); } function poolSocket(hostname){ @@ -886,15 +897,28 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { // If there is no miner identifier, then the miner identifier is set to the password // If the password is x, aka, old-logins, we're not going to allow detailed review of miners. + const login_diff_split = params.login.split("+"); + if (!params.pass) params.pass = "x"; + const pass_algo_split = params.pass.split("~"); + const pass_split = pass_algo_split[0].split(":"); + // Miner Variables this.coin = portData.coin; this.coinFuncs = require(`./lib/${this.coin}.js`)(); this.coinSettings = global.config.coinSettings[this.coin]; - this.login = params.login; // Documentation purposes only. - this.user = params.login; // For accessControl and workerStats. - this.password = params.pass; // For accessControl and workerStats. + this.login = login_diff_split[0]; // Documentation purposes only. + this.user = login_diff_split[0]; // For accessControl and workerStats. + this.password = pass_split[0]; // For accessControl and workerStats. this.agent = params.agent; // Documentation purposes only. this.ip = ip; // Documentation purposes only. + + if (pass_algo_split.length == 2) { + const algo_name = pass_algo_split[1]; + params.algo = [ algo_name ]; + params["algo-perf"] = {}; + params["algo-perf"][algo_name] = 1; + } + if (params.algo && (params.algo instanceof Array)) { // To report union of defined algo set to the pool for all its miners for (let i in params.algo) { this.algos = {}; @@ -903,11 +927,21 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } this.algos_perf = params["algo-perf"]; // To report sum of defined algo_perf to the pool for all its miners this.socket = minerSocket; - this.messageSender = pushMessage; + this.pushMessage = pushMessage; + this.getNewJob = function (bashCache) { + return this.coinFuncs.getJob(this, activePools[this.pool].activeBlocktemplate, bashCache); + }; + this.pushNewJob = function (bashCache) { + const job = this.getNewJob(bashCache); + if (this.protocol === "grin") { + this.pushMessage({method: 'getjobtemplate', result: job}); + } else { + this.pushMessage({method: 'job', params: job}); + } + }; this.error = ""; this.valid_miner = true; this.incremented = false; - let diffSplit = this.login.split("+"); this.fixed_diff = false; this.difficulty = portData.diff; this.connectTime = Date.now(); @@ -926,25 +960,11 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } if (!this.pool) this.pool = defaultPools[portData.coin]; - if (this.algos) { - const pool = activePools[this.pool]; - if (pool) { - const blockTemplate = pool.activeBlocktemplate; - if (blockTemplate && blockTemplate.blob) { - const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blob[0]) + parseInt(blockTemplate.blob[1])); - if (!(pool_algo in this.algos)) { - this.error = "Your miner does not have " + pool_algo + " algo support. Please update it."; - this.valid_miner = false; - } - } - } - } - - if (diffSplit.length === 2) { + if (login_diff_split.length === 2) { this.fixed_diff = true; - this.difficulty = Number(diffSplit[1]); - this.user = diffSplit[0]; - } else if (diffSplit.length > 2) { + this.difficulty = Number(login_diff_split[1]); + this.user = login_diff_split[0]; + } else if (login_diff_split.length > 2) { this.error = "Too many options in the login field"; this.valid_miner = false; } @@ -977,12 +997,23 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { this.cachedJob = null; - if (!params.pass) params.pass = "x"; - let pass_split = params.pass.split(":"); this.identifier = global.config.addressWorkerID ? this.user : pass_split[0]; this.logString = (this.identifier && this.identifier != "x") ? this.identifier + " (" + this.ip + ")" : this.ip; + if (this.algos) { + const pool = activePools[this.pool]; + if (pool) { + const blockTemplate = pool.activeBlocktemplate; + if (blockTemplate && blockTemplate.blob) { + const pool_algo = pool.coinFuncs.detectAlgo(pool.default_algo_set, 16 * parseInt(blockTemplate.blob[0]) + parseInt(blockTemplate.blob[1])); + if (!(pool_algo in this.algos)) { + console.warn("Your miner " + this.logString + " does not have " + pool_algo + " algo support. Please update it."); + } + } + } + } + this.minerStats = function(){ if (this.socket.destroyed && !global.config.keepOfflineMiners){ delete activeMiners[this.id]; @@ -993,7 +1024,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { shares: this.shares, blocks: this.blocks, hashes: this.hashes, - avgSpeed: Math.floor(this.hashes/(Math.floor((Date.now() - this.connectTime)/1000))), + avgSpeed: this.hashes/(Math.floor((Date.now() - this.connectTime)/1000)), diff: this.difficulty, connectTime: this.connectTime, lastContact: Math.floor(this.lastContact/1000), @@ -1015,7 +1046,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { if (this.hashes > 0 && !this.fixed_diff) { const new_diff = Math.floor(this.hashes / (Math.floor((Date.now() - this.connectTime) / 1000))) * this.coinSettings.shareTargetTime; if (this.setNewDiff(new_diff)) { - this.messageSender('job', this.getJob(activeMiners[this.id], activePools[this.pool].activeBlocktemplate)); + this.pushNewJob(); } } }; @@ -1039,8 +1070,6 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { } return true; }; - - this.getJob = this.coinFuncs.getJob; } // Slave Functions @@ -1074,41 +1103,38 @@ function isAllowedLogin(username, password) { // User is not in the list, and not yet ready to re-load from disk else { - // TODO Take notes of IP/Nb of rejections. Ultimately insert IP in bans after X threshold return false; } } } function isInAccessControl(username, password) { - return typeof accessControl[username] !== 'undefined' - && accessControl[username] === password; + return typeof accessControl[username] !== 'undefined' && accessControl[username] === password; } -function handleMinerData(method, params, ip, portData, sendReply, pushMessage, minerSocket) { - /* - Deals with handling the data from miners in a sane-ish fashion. - */ - let miner = activeMiners[params.id]; - // Check for ban here, so preconnected attackers can't continue to screw you - if (ip in bans) { - // Handle IP ban off clip. - sendReply("IP Address currently banned"); - return; - } +function handleMinerData(minerSocket, id, method, params, ip, portData, sendReply, sendReplyFinal, sendReplyMethodResult, pushMessage) { switch (method) { - case 'login': + case 'login': { // grin and default + if (ip in bans) { + sendReplyFinal("IP Address currently banned"); + return; + } + if (!params) { + sendReplyFinal("No params specified"); + return; + } let difficulty = portData.difficulty; - let minerId = uuidV4(); + const minerId = support.get_new_id(); if (!portData.coin) portData.coin = "xmr"; - miner = new Miner(minerId, params, ip, pushMessage, portData, minerSocket); + let miner = new Miner(minerId, params, ip, pushMessage, portData, minerSocket); if (!miner.valid_miner) { console.warn(global.threadName + "Invalid miner: " + miner.logString + ", disconnecting due to: " + miner.error); - sendReply(miner.error); + sendReplyFinal(miner.error); return; } process.send({type: 'newMiner', data: miner.port}); activeMiners[minerId] = miner; + minerSocket.minerId = minerId; // clean old miners with the same name/ip/agent if (global.config.keepOfflineMiners) { for (let miner_id in activeMiners) { @@ -1120,26 +1146,60 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m } } } - sendReply(null, { - id: minerId, - job: miner.getJob(miner, activePools[miner.pool].activeBlocktemplate), - status: 'OK' - }); - return minerId; - case 'getjob': + if (id === "Stratum") { + sendReplyMethodResult("login", "ok"); + miner.protocol = "grin"; + } else { + sendReply(null, { + id: minerId, + job: miner.getNewJob(), + status: 'OK' + }); + miner.protocol = "default"; + } + break; + } + + case 'getjobtemplate': { // grin only + const minerId = minerSocket.minerId ? minerSocket.minerId : ""; + let miner = activeMiners[minerId]; if (!miner) { sendReply('Unauthenticated'); return; } miner.heartbeat(); - sendReply(null, miner.getJob(miner, activePools[miner.pool].activeBlocktemplate)); + sendReplyMethodResult("getjobtemplate", miner.getNewJob()); break; - case 'submit': + } + + case 'getjob': { + if (!params) { + sendReplyFinal("No params specified"); + return; + } + let miner = activeMiners[params.id]; if (!miner) { sendReply('Unauthenticated'); return; } miner.heartbeat(); + sendReply(null, { id: miner.id, job: miner.getNewJob(), status: 'OK' }); + break; + } + + case 'submit': { // grin and default + if (!params) { + sendReplyFinal("No params specified"); + return; + } + const minerId = params.id ? params.id : (minerSocket.minerId ? minerSocket.minerId : ""); + let miner = activeMiners[minerId]; + if (!miner) { + sendReply('Unauthenticated'); + return; + } + miner.heartbeat(); + if (typeof (params.job_id) === 'number') params.job_id = params.job_id.toString(); // for grin miner let job = miner.validJobs.toarray().filter(function (job) { return job.id === params.job_id; @@ -1150,9 +1210,11 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m return; } - const nonceCheck = job.blob_type == 7 ? nonceCheck64 : nonceCheck32; + const is_bad_nonce = job.blob_type == 8 ? + (typeof params.nonce !== 'number') || !(params.pow instanceof Array) || (params.pow.length != 32) : + (typeof params.nonce !== 'string') || !(job.blob_type == 7 ? nonceCheck64.test(params.nonce) : nonceCheck32.test(params.nonce) ); - if ((typeof params.nonce !== 'string') || !nonceCheck.test(params.nonce)) { + if (is_bad_nonce) { console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString); sendReply('Duplicate share'); return; @@ -1164,7 +1226,9 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m return; } - job.submissions.push(params.nonce); + const nonce_test = job.blob_type == 8 ? params.pow.join(':') : params.nonce; + + job.submissions.push(nonce_test); let activeBlockTemplate = activePools[miner.pool].activeBlocktemplate; let pastBlockTemplates = activePools[miner.pool].pastBlockTemplates; @@ -1181,12 +1245,12 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m miner.newDiff = miner.difficulty - 1; miner.incremented = false; } - miner.messageSender('job', miner.getJob(miner, activePools[miner.pool].activeBlocktemplate, true)); + miner.pushNewJob(true); sendReply('Block expired'); return; } - let shareAccepted = miner.coinFuncs.processShare(miner, job, blockTemplate, params.nonce, params.result); + let shareAccepted = miner.coinFuncs.processShare(miner, job, blockTemplate, params); if (!shareAccepted) { sendReply('Low difficulty share'); @@ -1195,18 +1259,28 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage, m miner.lastShareTime = Date.now() / 1000 || 0; - sendReply(null, {status: 'OK'}); + if (miner.protocol === "grin") { + sendReplyMethodResult("submit", "ok"); + } else { + sendReply(null, {status: 'OK'}); + } break; - case 'keepalived': + } + + case 'keepalived': { + if (!params) { + sendReplyFinal("No params specified"); + return; + } + let miner = activeMiners[params.id]; if (!miner) { sendReply('Unauthenticated'); return; } miner.heartbeat(); - sendReply(null, { - status: 'KEEPALIVED' - }); + sendReply(null, { status: 'KEEPALIVED' }); break; + } } } @@ -1273,7 +1347,7 @@ function activateHTTP() { for (let miner_id in miners) { const miner = miners[miner_id]; const name = miner.logString; - let avgSpeed = miner.active ? miner.avgSpeed + " H/s" : "offline"; + let avgSpeed = miner.active ? support.human_hashrate(miner.avgSpeed, activePools[miner.pool].activeBlocktemplate.algo) : "offline"; let agent_parts = miner.agent.split(" "); tableBody += ` @@ -1291,9 +1365,10 @@ function activateHTTP() { `; } for (let poolName in poolHashrate) { - let poolPercentage = (100*poolHashrate[poolName]/totalHashrate).toFixed(2); + let poolPercentage = totalHashrate ? (100*poolHashrate[poolName]/totalHashrate).toFixed(2) : "100.0"; let targetDiff = activePools[poolName].activeBlocktemplate ? activePools[poolName].activeBlocktemplate.targetDiff : "?"; let walletId = activePools[poolName].username + const hs = support.human_hashrate(poolHashrate[poolName], activePools[poolName].activeBlocktemplate.algo); if (poolName.includes("moneroocean")) { let algo_variant = ""; if (activePools[poolName].activeBlocktemplate.algo) algo_variant += "algo: " + activePools[poolName].activeBlocktemplate.algo; @@ -1302,9 +1377,10 @@ function activateHTTP() { algo_variant += "variant: " + activePools[poolName].activeBlocktemplate.variant; } if (algo_variant != "") algo_variant = " (" + algo_variant + ")"; - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff) ${algo_variant}

`; + const hs = support.human_hashrate(poolHashrate[poolName], activePools[poolName].activeBlocktemplate.algo); + tablePool += `

${poolName}: ${hs} or ${poolPercentage}% (${targetDiff} diff) ${algo_variant}

`; } else { - tablePool += `

${poolName}: ${poolHashrate[poolName]} H/s or ${poolPercentage}% (${targetDiff} diff)

`; + tablePool += `

${poolName}: ${hs} or ${poolPercentage}% (${targetDiff} diff)

`; } } @@ -1312,6 +1388,8 @@ function activateHTTP() { if (!global.config.theme) global.config.theme = "light"; if (!global.config.refreshTime) global.config.refreshTime = "60"; + totalHashrate = support.human_hashrate(totalHashrate, hs_algo); + // cleaner way for icon, stylesheet, scripts let icon = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAABjCAYAAADaWl3LAAAACXBIWXMAAA9hAAAPYQGoP6dpAAANyklEQVR4Ae1daXRU1R2///smKzGQgJpAUgVRbHHBQkAWxSg0aIwgJOmhAc+xFtnUqqcfu+ScfusHETcktGq1aDJD8GgAQVlGsCUgGEsTtKeFGjCkshgge+a9e/u7EzJ5nUzITN5kFph7zpt337v7793lv907xOByVpbVMikruJTlB9av+Jd6F3O+EchZVTaJSbZIMraIVBSAB3+PkzVErNxFWkXNq7+o73l79d4lTV5dNlUTCjBaCBxu6sHCB3g9QcCXsQMMQOpcc9S88sQpT8iV7ikt5VO/GzNTSrmIkQRglO2ryZcDzxxf4GEfIpe7bLbKmpd/fsYceCX47ysttbWeyZgtBS8kRgsYkxkDtctf8Mz56OiSu9EvK/TEuM1fvvj4eXNgNPknFtnjk9IvzOGaXCQlzQdgIwOp/2DAM+ffhYePAWR5G3d9UPfa6hZzYCT6pz/3QpLRMSxPTfgYjgWo4/DB1tMqeOZy2/GwTRKVxyU0b92/5nn1HBFu4qpXU5JZfL5aJdG7HkKlhgWjYsEEz1MfZNqClelDyWRF+9kR2+scxaqHhtRNevbNEbYOVwFHD5PE8lB4YrArMCTgeVUSc6J8nyRVJGec2uUsLdW9woP2OPnJ9aM0G58vJStEmQ8g47igZe4jo1CAZy72LGjISiGo/FBGw15WWqpWcUsOgGVyGz3aPSTZbGSmWcowgMShBs9ctUZG5CDDKD+4fnk1Jm9FV/rlANgPSOMLOcMqydgMJMLoDL0LJ3ie1qIS9RhmdmK84sC6ZYc9ASYPALtJ06iwe5VkOaagsHkjAjyv1iveukJKXqFJHSOcQOXjYuxOr3hhf4xE8MIOir8VCMtc4W/lIj1eDDwLXygGXgw8CwhYSBrreVbBE5q8AyzNH0BrnbSQ19WS9CjEV6VciIluUqW31ZJyVm64F9T+EgAJ/pCN6A27qn0KMLsmDQd0PEd7kPACr+c1Y+OffikhzUiCGEeUAMx8hCT0hl4VPp+AmVveL3jmSEq8E9/ZBdaIAKSb+fYrnTmPKPEPCJi5HQGDkLPqjWxirsVSYGgTu92cWZT6AwLM3MaAwTMnnvzU+ttJpyVEcjGGtk8Nkzl+BPkHDZi5DZbA680oKhaaoADW22Z0F/NDMPwRttAEHTAzRkEHz5x5mBaaIQXM3L4hBc9c0BAvNCEDzNymkIFnLvT/bWPMIYPzf77uybC0I8bbDu57uVPFwIuBZwEBC0ljPc8CeDYLacOWFKtDPfhsJ1S9Tk0YznBVJCrA8war+vWV34QLMHO5EQneYMAqqdyTxYS4HeYcN0H2lo1emU1E2bDuTAcjdQ3kk7g81lEG/OpqwtWIMFi9UiPsaXCX3xokD0+o/ay2dABzkLDQR950XqBgLancm8mkfo9kYiYaPckt3ZEsDUAE07VAun4QH2M/SbFzfN1f93qDGRbwpq4s+8Y8Zw00DIvs29PjuQ12dXwOesY9QGhcMFHyLy/ZyCRtQq/+87vF97tNQsICnj+VXWLfPUGQLMCXfwTxlTFPyKyfBq4f7ZQkf08lm3buh4HNmk5xttJRXKzmgbA5NRyFcJVwYkth0HNH2CriZ8EAb1ePaVc9TGI3CmlsKi+cW+NnesvR1EQvmZEHA7MizF8YlpHUwy7fPDN4npgYy8dgdbgFu4KqGaf97y56oN4TaNHzmH3XGJ1oCqm5i9iDyO5HFrMMW3Kf4PWtjWzEBH8AveMYRO6nYOPbIAzZQBqdSrQlnmnu5HpLynmR0tIibfq1qZRgpDJDSyUyskAu3CgYjYUh4s2wUZ6C3pXZN//ofOMnnUeZ6I0LlNwZIKofxjExqXunq5PFg8lLb4NmkuOKR58Fuowri1n0r0u/3XMD3l9BLsbbWviYMfBi4FlAwELSWM+LgWcBAQtJYz3PAnh+kioWSghd0uOgi/6O4o5jS0s99szWC4M1cEYXyNZ1sUO/pjmtKV4/mX2aZxuG1uFKSpJMyxSGGA3xVSYjPhriq9FIdytoLbXPY8DdkNEKXgsoxr1Csj2QcnyuM+NLR/HcCwF+pzbEP4ertk86ZLq40jmBM2MaQJ0OTkuZ2GV5x/OTw/BOFvpngHVEENsM2vuTb0fxg87c3CHbANindQDzZ47dOVxjC5UXPTNbxYl08OpQUbtgmv29wtyv+zQqDC/u27PHlnVOLoQg9jlabN89G/zqbyE3uz8MdfFVJLaY0kaDGX8KhnSnyG7XOk4kpRmJPB12xCPAn8djjtN0Yhp+2nUS34sEo+kc/0HT4eVTXL4q1N87D7O5xLFrBljSFYiojr8Iyk7o/gr18b4L/PBuTPTvxF2kzW89ntvhI06/r4pK7fEt6QkwsKY7uSQIUdlYgDQWCdQ1Cpennf1m0h3QittZxP6aBDsCPv6IxowjF8+nHnWW9p0m+mS69O0dw4wkbQF6opKvKZE3FCjBdyj4DIQF29ELPkywJe54Y/6sZn9LyV+zZRxxORvpZyHNZFxKrDWUG5MvAFCcpUBbuUturfpVwVlV1z7gqZceh9mxxLHzNkaakr3dCxnJD9E7s0ESBKps+S/yPIbivmRMVJPQqv9SnPtvTzkDeB58adu1xPR89Kq5AAzW+n1XvgGyCGYwtvxjeyvRy5cHr58iVe/Uk+OzNW5kS8FGY4gkAlSbZFiPSLRyyc9D83SeSeM07xDH33ksTw2HgNy8Fz+YYCO15Z0eQe+cjsQRR9DTw2ur9gsm1wzL7Ai7DiNvzfZMG+8qwVyzFF818nUY+WuruuWUarc1yY0ActNHz8wPmQ4DQzKLCz0P4v4iTAfRpcMwgWceVseA6BasXtVSo/3bnsqvNwda8T/8QtUYbNeagjnjHkzA0GHI6NVh9AOeNz6NmNMOYCgdw/x2Cj2kAatxA/awn9K6jDMJcZ16iy1FpHzfIjtSklKFRqkYeqkMOgzwljcq0gEZ3oz00GGwq02HwTIB2gKFqHuMAwX3nUNpmMhZG0tiXBqsLS1JRYFTmg4Vo+fX/fKK+4m4FSyaEI6BZ+FrxcCLgWcBAQtJYz3PAnjRKkn21WTFvB/FGn8CCz3E76wBrN1pyN3aifMOkrIDhkygsGQStrsmIm4a/GNBF4zDhuxxODVoHDINSAgSreCpgw3/BtrTCUK+BkcU/6PqlwUnfCEayLs56z8ZntjWcRdAzgW3lYu003DF95cH+Ukk95c+hO/pKHrPZoiidurMVv3RMw91DnXhBeurklknmwVdyU9RViGuVHOZEQ4eYRhKuyTD8dEzCzwHI5gbECp/0Qv2pFZb4gIYfa9CmUqOiJMXegUDoarHQOW4wMA4hOQvbXs2/8BAkcMRnr92Sy4+6u/ooRe33gsdxq/BUs0NR0VMZSqB6QZdxK3b8dw8mPdbcZLuevrNUQmGMcpgMg3DPQ2yRrVA4M7SsJDEExMtkngzLOWamZDNUhMXibTjB0c11Pt7oiQ+crcDiNMA4jKAqM6qC9V5KmchWanEyleR03ToU29T/Z66Xe7uPomWtB8zyacir9sA0K0ACIrrgZXW/eSr9LlfAZijMCivYUL75NDrT0CLB+7ey3nA63mvlCltI5Ln4flRcPuzsOyP7wkLwh0ibByZzpgTldnT2jRsny/FyuXKwQmOwzWNYdjwn0AZPQvAT0T8oaZXMRLoY/RWR/L1jTuclw6N7QOed8Xd+gOpw5SfZqCit0CQkgHaCEd/y+sRt0eM4p2sBS++w3UCaeowP9TC9L42xdX5heP5YkVmBOQA2K2aDUf2uuV/7G4kDue2gtPogxslZ2/j+KMyJypVeuj1Zc6AWoTIAFYt3dfG6S7qIqGTlqDbEozvq5YXqK5vyeWsLpsoDSrEVAItnrt3WcpvKBIr8LrHsqS9ROKV5Pb4KudbjwekNw1WxaavWDfG4LwkWg686QWvF4EmzHPvMU1UtJ1Orx7q07VzVr4B9siVh2lL/X3C/ajGgFNJb1XD6/MFnrlGavjtwxy3C5PM7qR2W52VXnkf/jahvTHjFslpEqaKmYAJoPX+OYe54GjwDwSedxsw97MGNBr7MbDRRdIxdBO1KLTBtg0MuOiSupZAGs5hF2DAubwO5AP2YkBJ3W3+cBsy7G+R8S4r4p8DFQyAD3dr67Og1J4Nmqq7gbi5x5qAugfLsfs1XoCV8YRHPBKDqOBQ00eDqFL0JImBZ+FbxcCLgWcBAQtJYz3PAniBrrYWihrypGqbZT3W+m8gZvoPlvyTIJMuCilbiXirIqdISNypDdRAHEzhRkJCnA7yYCTijgQ5dT0EDbCbISVo6Ff0bm5F1IIHkL4Cg/4ZGl7DidfohjhyuGy5ZZ4aQog4G8mbDeJ3ECfYBUpIb9wiLjNubn+gRHKfDEL4ogEN2QrOZA9xl/Pz11Yr4WlI3F2r/3iDTcg8gFhsZiEjHDz5Twyr9yEoeP9QxreH/JXwDiWi057ekGXobDGk00sjETwdw9FhaHLt4VeXK8FpxDobtrPPZoL/BjWcE9ZaEoSnEjoMTVsXLX/KeYn5hHZ35Ya7Ie1dBp5V6TAG3LQWHKAJe79EJeH/fm44N/xThyO857oE2iYPeD0J1VG9I0TSPGzieBSM/0ysauN7woJwVztsqkEuOJG/0xBiH1bIgHbdBKEOQcuiD3jeOc9Yse46nTh0GGwGjvhQprHQX3iuRO/4l57V1gG1Gp4E/VQrBHQYnNUxnX0RDHKinzJD/vp/XCBFlIoN7jUAAAAASUVORK5CYII=`; let stylesheet = `body,html{font-family:'Saira Semi Condensed',sans-serif;font-size:14px;text-align:center}.light{color:#000;background-color:#fff}.dark{color:#ccc;background-color:#2a2a2a}.header{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;o-user-select:none;cursor:hand}.sorted-table{margin:auto;width:95%;text-align:center}.sorted-table td,.sorted-table th{border-bottom:1px solid #d9d9d9}.hover{background-color:#eee;cursor:pointer}.tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.tooltip .tooltiptext{visibility:hidden;width:140px;background-color:#000;color:#fff;text-align:center;padding:5px 0;border-radius:6px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-70px;opacity:0;transition:opacity .3s}.tooltip .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent}.tooltip:hover .tooltiptext{visibility:visible;opacity:1}a:link,a:visited,a:hover,a:active{color:inherit;text-decoration:none;text-shadow: 0px 0px 5px #40c4ff;}`; @@ -1388,7 +1466,7 @@ function activatePorts() { if (activePorts.indexOf(portData.port) !== -1) { return; } - let handleMessage = function (socket, jsonData, pushMessage, minerSocket) { + let handleMessage = function (socket, jsonData, pushMessage) { if (!jsonData.id) { console.warn(global.threadName + 'Miner RPC request missing RPC id'); return; @@ -1397,25 +1475,37 @@ function activatePorts() { console.warn(global.threadName + 'Miner RPC request missing RPC method'); return; } - else if (!jsonData.params) { - console.warn(global.threadName + 'Miner RPC request missing RPC params'); - return; - } let sendReply = function (error, result) { - if (!socket.writable) { - return; - } - let sendData = JSON.stringify({ - id: jsonData.id, - jsonrpc: "2.0", - error: error ? {code: -1, message: error} : null, - result: result - }) + "\n"; - debug.miners(`Data sent to miner (sendReply): ${sendData}`); - socket.write(sendData); + if (!socket.writable) return; + socket.write(JSON.stringify({ + id: jsonData.id, + jsonrpc: "2.0", + error: error ? {code: -1, message: error} : null, + result: result + }) + "\n"); }; - handleMinerData(jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, pushMessage, minerSocket); + let sendReplyFinal = function (error) { + setTimeout(function() { + if (!socket.writable) return; + socket.end(JSON.stringify({ + id: jsonData.id, + jsonrpc: "2.0", + error: {code: -1, message: error}, + result: null + }) + "\n"); + }, 9 * 1000); + }; + let sendReplyMethodResult = function (method, result) { + if (!socket.writable) return; + socket.write(JSON.stringify({ + id: jsonData.id, + jsonrpc: "2.0", + method: method, + result: result + }) + "\n"); + }; + handleMinerData(socket, jsonData.id, jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, sendReplyFinal, sendReplyMethodResult, pushMessage); }; function socketConn(socket) { @@ -1424,17 +1514,11 @@ function activatePorts() { let dataBuffer = ''; - let pushMessage = function (method, params) { - if (!socket.writable) { - return; - } - let sendData = JSON.stringify({ - jsonrpc: "2.0", - method: method, - params: params - }) + "\n"; - debug.miners(`Data sent to miner (pushMessage): ${sendData}`); - socket.write(sendData); + let pushMessage = function (body) { + if (!socket.writable) return; + body.jsonrpc = "2.0"; + debug.miners(`Data sent to miner (pushMessage): ` + JSON.stringify(body)); + socket.write(JSON.stringify(body) + "\n"); }; socket.on('data', function (d) { @@ -1473,7 +1557,7 @@ function activatePorts() { socket.destroy(); break; } - handleMessage(socket, jsonData, pushMessage, socket); + handleMessage(socket, jsonData, pushMessage); } dataBuffer = incomplete; } @@ -1484,8 +1568,7 @@ function activatePorts() { socket.end(); socket.destroy(); }).on('close', function () { - pushMessage = function () { - }; + pushMessage = function () {}; debug.miners('Miner disconnected via standard close'); socket.end(); socket.destroy(); @@ -1535,7 +1618,7 @@ function checkActivePools() { let realMiner = activeMiners[miner]; if (realMiner.pool === badPool) { realMiner.pool = pool; - realMiner.messageSender('job', realMiner.getJob(realMiner, activePools[pool].activeBlocktemplate)); + realMiner.pushNewJob(); } } } From d8482ece1464f9c7137901d82d1772f78b6aa8c7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 26 Dec 2019 13:19:49 -0800 Subject: [PATCH 279/367] Fixed getjob --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 8edef8a..309a7dd 100644 --- a/proxy.js +++ b/proxy.js @@ -1183,7 +1183,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } miner.heartbeat(); - sendReply(null, { id: miner.id, job: miner.getNewJob(), status: 'OK' }); + sendReplyMethodResult("job", miner.getNewJob()); break; } From 8eee1b0ba304efbdfb066864556378bf23eeb662 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 26 Dec 2019 13:38:58 -0800 Subject: [PATCH 280/367] Simplified json replies --- proxy.js | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/proxy.js b/proxy.js index 309a7dd..3e07590 100644 --- a/proxy.js +++ b/proxy.js @@ -1112,7 +1112,7 @@ function isInAccessControl(username, password) { return typeof accessControl[username] !== 'undefined' && accessControl[username] === password; } -function handleMinerData(minerSocket, id, method, params, ip, portData, sendReply, sendReplyFinal, sendReplyMethodResult, pushMessage) { +function handleMinerData(minerSocket, id, method, params, ip, portData, sendReply, sendReplyFinal, pushMessage) { switch (method) { case 'login': { // grin and default if (ip in bans) { @@ -1147,14 +1147,10 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl } } if (id === "Stratum") { - sendReplyMethodResult("login", "ok"); + sendReply(null, "ok"); miner.protocol = "grin"; } else { - sendReply(null, { - id: minerId, - job: miner.getNewJob(), - status: 'OK' - }); + sendReply(null, { id: minerId, job: miner.getNewJob(), status: 'OK' }); miner.protocol = "default"; } break; @@ -1168,7 +1164,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } miner.heartbeat(); - sendReplyMethodResult("getjobtemplate", miner.getNewJob()); + sendReply(null, miner.getNewJob()); break; } @@ -1183,7 +1179,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } miner.heartbeat(); - sendReplyMethodResult("job", miner.getNewJob()); + sendReply(null, miner.getNewJob()); break; } @@ -1260,7 +1256,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl miner.lastShareTime = Date.now() / 1000 || 0; if (miner.protocol === "grin") { - sendReplyMethodResult("submit", "ok"); + sendReply(null, "ok"); } else { sendReply(null, {status: 'OK'}); } @@ -1479,33 +1475,26 @@ function activatePorts() { let sendReply = function (error, result) { if (!socket.writable) return; socket.write(JSON.stringify({ - id: jsonData.id, jsonrpc: "2.0", - error: error ? {code: -1, message: error} : null, - result: result + id: jsonData.id, + method: jsonData.method, + error: error ? {code: -1, message: error} : null, + result: result }) + "\n"); }; let sendReplyFinal = function (error) { setTimeout(function() { if (!socket.writable) return; socket.end(JSON.stringify({ - id: jsonData.id, jsonrpc: "2.0", - error: {code: -1, message: error}, - result: null + id: jsonData.id, + method: jsonData.method, + error: {code: -1, message: error}, + result: null }) + "\n"); }, 9 * 1000); }; - let sendReplyMethodResult = function (method, result) { - if (!socket.writable) return; - socket.write(JSON.stringify({ - id: jsonData.id, - jsonrpc: "2.0", - method: method, - result: result - }) + "\n"); - }; - handleMinerData(socket, jsonData.id, jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, sendReplyFinal, sendReplyMethodResult, pushMessage); + handleMinerData(socket, jsonData.id, jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, sendReplyFinal, pushMessage); }; function socketConn(socket) { From 318819405ebaa527ae5584a297aefd0e9852c148 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 26 Dec 2019 15:34:09 -0800 Subject: [PATCH 281/367] Fixed xtk-stak compat --- proxy.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/proxy.js b/proxy.js index 3e07590..f6bdf0e 100644 --- a/proxy.js +++ b/proxy.js @@ -1474,26 +1474,29 @@ function activatePorts() { let sendReply = function (error, result) { if (!socket.writable) return; - socket.write(JSON.stringify({ + let reply = { jsonrpc: "2.0", id: jsonData.id, - method: jsonData.method, error: error ? {code: -1, message: error} : null, result: result - }) + "\n"); + }; + if (jsonData.id === "Stratum") reply.method = jsonData.method; + socket.write(JSON.stringify(reply) + "\n"); }; let sendReplyFinal = function (error) { setTimeout(function() { if (!socket.writable) return; - socket.end(JSON.stringify({ + let reply = { jsonrpc: "2.0", id: jsonData.id, - method: jsonData.method, error: {code: -1, message: error}, result: null - }) + "\n"); + }; + if (jsonData.id === "Stratum") reply.method = jsonData.method; + socket.end(JSON.stringify(reply) + "\n"); }, 9 * 1000); }; + handleMinerData(socket, jsonData.id, jsonData.method, jsonData.params, socket.remoteAddress, portData, sendReply, sendReplyFinal, pushMessage); }; From 54d195e0bcafc2845b3c87b0dbd365290c072952 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 26 Dec 2019 17:30:23 -0800 Subject: [PATCH 282/367] Fixed empty bt problem --- proxy.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy.js b/proxy.js index f6bdf0e..7268802 100644 --- a/proxy.js +++ b/proxy.js @@ -819,11 +819,6 @@ function handlePoolMessage(jsonData, hostname){ let sendLog = pool.sendLog[jsonData.id]; switch(sendLog.method){ case 'login': - if (typeof jsonData.result.job == 'undefined') { - console.error(`${global.threadName}Empty response from pool ${pool.hostname}`); - activePools[hostname].disable(); - return; - } pool.id = jsonData.result.id; handleNewBlockTemplate(jsonData.result.job, hostname); break; @@ -838,6 +833,11 @@ function handlePoolMessage(jsonData, hostname){ } function handleNewBlockTemplate(blockTemplate, hostname){ + if (!blockTemplate) { + console.error(`${global.threadName}Empty response from pool ${hostname}`); + activePools[hostname].disable(); + return; + } let pool = activePools[hostname]; let algo_variant = ""; if (blockTemplate.algo) algo_variant += "algo: " + blockTemplate.algo; From 06944c997e966b9dc1f031f8493ac622f81d398b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 30 Dec 2019 22:17:32 -0800 Subject: [PATCH 283/367] Temporary fix --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 7268802..6802f8f 100644 --- a/proxy.js +++ b/proxy.js @@ -835,7 +835,7 @@ function handlePoolMessage(jsonData, hostname){ function handleNewBlockTemplate(blockTemplate, hostname){ if (!blockTemplate) { console.error(`${global.threadName}Empty response from pool ${hostname}`); - activePools[hostname].disable(); + //activePools[hostname].disable(); return; } let pool = activePools[hostname]; From 2c0038b3f691f038c2e70fa98179a3c399473684 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 30 Dec 2019 22:58:02 -0800 Subject: [PATCH 284/367] Fixed null getjob --- proxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy.js b/proxy.js index 6802f8f..e2bdc6a 100644 --- a/proxy.js +++ b/proxy.js @@ -823,7 +823,8 @@ function handlePoolMessage(jsonData, hostname){ handleNewBlockTemplate(jsonData.result.job, hostname); break; case 'getjob': - handleNewBlockTemplate(jsonData.result, hostname); + // null for same job + if (jsonData.result !== null) handleNewBlockTemplate(jsonData.result, hostname); break; case 'submit': sendLog.accepted = true; @@ -835,7 +836,7 @@ function handlePoolMessage(jsonData, hostname){ function handleNewBlockTemplate(blockTemplate, hostname){ if (!blockTemplate) { console.error(`${global.threadName}Empty response from pool ${hostname}`); - //activePools[hostname].disable(); + activePools[hostname].disable(); return; } let pool = activePools[hostname]; From 72879af3809b1d851a13c4e556ccae7e11e57a5c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 30 Dec 2019 23:14:40 -0800 Subject: [PATCH 285/367] Fixed grin proto for mm.js --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 949e21e..87161e0 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -259,7 +259,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { miner.validJobs.enq(newJob); - if (activeBlockTemplate.blob_type == 8) miner.cachedJob = { + if (miner.protocol === "grin") miner.cachedJob = { pre_pow: blob, algo: "cuckaroo", edgebits: 29, From c2f58bf1a682a007c92536ed469a5a6a3763d545 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 30 Dec 2019 23:24:53 -0800 Subject: [PATCH 286/367] Fixed grin proto for mm.js --- lib/xmr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 87161e0..0e5e0f6 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -259,7 +259,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { miner.validJobs.enq(newJob); - if (miner.protocol === "grin") miner.cachedJob = { + if (activeBlockTemplate.blob_type == 8) miner.cachedJob = { pre_pow: blob, algo: "cuckaroo", edgebits: 29, @@ -280,7 +280,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { if (typeof (activeBlockTemplate.variant) !== 'undefined') { miner.cachedJob.variant = activeBlockTemplate.variant; } - if (typeof (activeBlockTemplate.algo) !== 'undefined') { + if (typeof (activeBlockTemplate.algo) !== 'undefined' && miner.protocol !== "grin") { miner.cachedJob.algo = activeBlockTemplate.algo; } return miner.cachedJob; From adbec09cfe4bf1032433bff853aa843c0ca6bfd4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 3 Jan 2020 23:14:38 -0800 Subject: [PATCH 287/367] Fixed XTNC support --- lib/xmr.js | 3 ++- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 0e5e0f6..a177790 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -46,7 +46,8 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_loki': return 5; // Loki case 'cryptonote3': return 6; // Masari case 'aeon': return 7; // Aeon - case 'cuckaroo': return 8; // Swap/XTNC/MoneroV + case 'cuckaroo': return 8; // Swap/MoneroV + case 'cuckaroo4': return 9; // XTNC } return 0; } diff --git a/package.json b/package.json index 24249c7..6a30096 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.16.0", + "version": "0.16.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v16.0.1" } } diff --git a/proxy.js b/proxy.js index e2bdc6a..cbf2f0f 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.16.0"; +const PROXY_VERSION = "0.16.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 9c474bdba085a1a4f23efd496ba1d4153da9f858 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 3 Jan 2020 23:38:39 -0800 Subject: [PATCH 288/367] Fixed XTNC support --- lib/xmr.js | 11 ++++++++--- proxy.js | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index a177790..99aa6f9 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -23,6 +23,10 @@ function blockHeightCheck(nodeList, callback) { let randomNode = nodeList[Math.floor(Math.random() * nodeList.length)].split(':'); } +function blobTypeGrin(port_blob_num) { + return port_blob_num == 8 || port_blob_num == 9; +} + function getRemoteNodes() { let knownNodes = [ '162.213.38.245:18081', @@ -260,7 +264,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { miner.validJobs.enq(newJob); - if (activeBlockTemplate.blob_type == 8) miner.cachedJob = { + if (blobTypeGrin(activeBlockTemplate.blob_type)) miner.cachedJob = { pre_pow: blob, algo: "cuckaroo", edgebits: 29, @@ -365,7 +369,7 @@ function processShare(miner, job, blockTemplate, params) { template.writeUInt32BE(job.extraNonce, blockTemplate.workerOffset); } - const hashDiff = hash_buff_diff(blob_type == 8 ? multiHashing.c29_cycle_hash(params.pow) : new Buffer(params.result, 'hex')); + const hashDiff = hash_buff_diff(blobTypeGrin(blob_type) ? multiHashing.c29_cycle_hash(params.pow) : new Buffer(params.result, 'hex')); if (hashDiff.ge(blockTemplate.targetDiff)) { let time_now = Date.now(); @@ -375,7 +379,7 @@ function processShare(miner, job, blockTemplate, params) { } let isVerifyFailed = false; - if (blob_type == 8) { + if (blobTypeGrin(blob_type)) { const shareBuffer = cnUtil.construct_block_blob(template, bignum(nonce, 10).toBuffer({endian: 'little', size: 4}), blob_type, params.pow) const header = Buffer.concat([cnUtil.convert_blob(shareBuffer, blob_type), bignum(nonce, 10).toBuffer({endian: 'big', size: 4})]); if (hash_func_c29(blockTemplate.algo, header, params.pow)) isVerifyFailed = true; @@ -450,6 +454,7 @@ let devPool = { module.exports = function () { return { devPool: devPool, + blobTypeGrin: blobTypeGrin, hashSync: multiHashing.cryptonight, hashAsync: multiHashing.cryptonight_async, blockHeightCheck: blockHeightCheck, diff --git a/proxy.js b/proxy.js index cbf2f0f..b3801e0 100644 --- a/proxy.js +++ b/proxy.js @@ -1207,7 +1207,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } - const is_bad_nonce = job.blob_type == 8 ? + const is_bad_nonce = miner.coinFuncs.blobTypeGrin(job.blob_type) ? (typeof params.nonce !== 'number') || !(params.pow instanceof Array) || (params.pow.length != 32) : (typeof params.nonce !== 'string') || !(job.blob_type == 7 ? nonceCheck64.test(params.nonce) : nonceCheck32.test(params.nonce) ); @@ -1223,7 +1223,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } - const nonce_test = job.blob_type == 8 ? params.pow.join(':') : params.nonce; + const nonce_test = miner.coinFuncs.blobTypeGrin(job.blob_type) ? params.pow.join(':') : params.nonce; job.submissions.push(nonce_test); let activeBlockTemplate = activePools[miner.pool].activeBlocktemplate; From af1260e5aca5e950efa23914c8aba2acacd9cb63 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 4 Jan 2020 01:22:08 -0800 Subject: [PATCH 289/367] Fixed XTNC support --- lib/xmr.js | 2 +- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 99aa6f9..84a1758 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -51,7 +51,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote3': return 6; // Masari case 'aeon': return 7; // Aeon case 'cuckaroo': return 8; // Swap/MoneroV - case 'cuckaroo4': return 9; // XTNC + case 'cryptonote_xtnc': return 9; // XTNC } return 0; } diff --git a/package.json b/package.json index 6a30096..982c147 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.16.1", + "version": "0.16.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v16.0.1" } } diff --git a/proxy.js b/proxy.js index b3801e0..bd05d27 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.16.1"; +const PROXY_VERSION = "0.16.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From bc3b034261240837dffe98ea1b450b0f898ce64b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 9 Jan 2020 12:23:32 -0800 Subject: [PATCH 290/367] Fixed bug --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 84a1758..5d4f7c6 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -396,7 +396,7 @@ function processShare(miner, job, blockTemplate, params) { } if (isVerifyFailed) { console.error(global.threadName + "Bad share from miner " + miner.logString); - miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); + miner.messageSender('job', miner.getNewJob(true)); return false; } miner.blocks += 1; From 4cc405d844c47cc2b8840632dc3342afd7cf98b2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 9 Jan 2020 12:43:19 -0800 Subject: [PATCH 291/367] Fixed bug --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 5d4f7c6..f2ff9f0 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -396,7 +396,7 @@ function processShare(miner, job, blockTemplate, params) { } if (isVerifyFailed) { console.error(global.threadName + "Bad share from miner " + miner.logString); - miner.messageSender('job', miner.getNewJob(true)); + miner.pushMessage({method: 'job', params: miner.getNewJob(true)}); return false; } miner.blocks += 1; From cd53591f9dbfdf813232f8af0658aff3ccfe7f88 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 31 Jan 2020 03:14:32 -0800 Subject: [PATCH 292/367] Fixed for null login --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index bd05d27..41ca1c3 100644 --- a/proxy.js +++ b/proxy.js @@ -898,7 +898,7 @@ function Miner(id, params, ip, pushMessage, portData, minerSocket) { // If there is no miner identifier, then the miner identifier is set to the password // If the password is x, aka, old-logins, we're not going to allow detailed review of miners. - const login_diff_split = params.login.split("+"); + const login_diff_split = params.login ? params.login.split("+") : ""; if (!params.pass) params.pass = "x"; const pass_algo_split = params.pass.split("~"); const pass_split = pass_algo_split[0].split(":"); From 6dc8f6a204a50c7f4fbf0d3bee40a85353c2eac3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 5 Mar 2020 15:02:53 -0800 Subject: [PATCH 293/367] Dero support --- README.md | 3 +++ lib/xmr.js | 2 ++ package.json | 4 ++-- proxy.js | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 35b2d83..9d9b8af 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,9 @@ If you'd like to make a one time donation, the addresses are as follows: * IRD - ```ir3DHyB8Ub1aAHEewMeUxQ7b7tQdWa7VL8M5oXDPohS3Me4nhwvALXM4mym2kWg9VsceT75dm6XWiWF1K4zu8RVQ1HJD8Z3R9``` * ARQ - ```ar4Ha6ZQCkKRhkKQLfexv7VZQM2MhUmMmU9hmzswCPK4T3o2rbPKZM1GxEoYg4AFQsh57PsEets7sbpU958FAvxo2RkkTQ1gE``` * XWP - ```fh4MCJrakhWGoS6Meqp6UxGE1GNfAjKaRdPjW36rTffDiqvEq2HWEKZhrbYRw7XJb3CXxkjL3tcYGTT39m5qgjvk1ap4bVu1R``` +* XEQ - ```Tvzp9tTmdGP9X8hCEw1Qzn18divQajJYTjR5HuUzHPKyLK5fzRt2X73FKBDzcnHMDJKdgsPhUDVrKHVcDJQVmLBg33NbkdjQb``` +* XTA - ```ipN5cNhm7RXAGACP4ZXki4afT3iJ1A6Ka5U4cswE6fBPDcv8JpivurBj3vu1bXwPyb8KZEGsFUYMmToFG4N9V9G72X4WpAQ8L``` +* DERO - ```dERokvcrnuWH1ai1QmZQc9cgxrLwE3rX3TbhdrnLmi3BVZmf197qd5FaFqmPMp5dZ3igXfVQwUUMgTSjpVKDtUeb6DT2xp64XJ``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` diff --git a/lib/xmr.js b/lib/xmr.js index f2ff9f0..9cb0b37 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -148,6 +148,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); case 'k12': return multiHashing.k12(convertedBlob); + + case 'astrobwt': return multiHashing.astrobwt(convertedBlob, 0); } return ""; } diff --git a/package.json b/package.json index 982c147..8379a02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.16.2", + "version": "0.17.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v16.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.0" } } diff --git a/proxy.js b/proxy.js index 41ca1c3..fcdf82e 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.16.2"; +const PROXY_VERSION = "0.17.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 7ce061abb5cc8605cceab77b1355ff66626009bd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 6 Mar 2020 23:38:30 -0800 Subject: [PATCH 294/367] Fixed for DERO --- lib/xmr.js | 31 ++++++++++++++++++++++++------- package.json | 2 +- proxy.js | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 9cb0b37..f1f6e39 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -23,8 +23,24 @@ function blockHeightCheck(nodeList, callback) { let randomNode = nodeList[Math.floor(Math.random() * nodeList.length)].split(':'); } -function blobTypeGrin(port_blob_num) { - return port_blob_num == 8 || port_blob_num == 9; +function blobTypeGrin(blob_type_num) { + return blob_type_num == 8 || blob_type_num == 9; +} + +function blobTypeDero(blob_type_num) { + return blob_type_num == 10; +} + +function convertBlob(blobBuffer, blob_type_num){ + if (blobTypeDero(blob_type_num)) return blobBuffer; + return cnUtil.convert_blob(blobBuffer, blob_type_num); +} + +function constructNewBlob(blockTemplate, NonceBuffer, constructNewBlob, ring){ + if (blobTypeDero(blob_type_num)) { + NonceBuffer.copy(blockTemplate, 39, 0, 4); + return blockTemplate; + } else return constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring); } function getRemoteNodes() { @@ -52,6 +68,7 @@ function parse_blob_type(blob_type_str) { case 'aeon': return 7; // Aeon case 'cuckaroo': return 8; // Swap/MoneroV case 'cryptonote_xtnc': return 9; // XTNC + case 'cryptonote_dero': return 10; // Dero } return 0; } @@ -204,7 +221,7 @@ function BlockTemplate(template) { } else { this.buffer.writeUInt32BE(++this.workerNonce, this.workerOffset); } - return cnUtil.convert_blob(this.buffer, this.blob_type).toString('hex'); + return convertBlob(this.buffer, this.blob_type).toString('hex'); }; } @@ -382,14 +399,14 @@ function processShare(miner, job, blockTemplate, params) { let isVerifyFailed = false; if (blobTypeGrin(blob_type)) { - const shareBuffer = cnUtil.construct_block_blob(template, bignum(nonce, 10).toBuffer({endian: 'little', size: 4}), blob_type, params.pow) - const header = Buffer.concat([cnUtil.convert_blob(shareBuffer, blob_type), bignum(nonce, 10).toBuffer({endian: 'big', size: 4})]); + const shareBuffer = constructNewBlob(template, bignum(nonce, 10).toBuffer({endian: 'little', size: 4}), blob_type, params.pow) + const header = Buffer.concat([convertBlob(shareBuffer, blob_type), bignum(nonce, 10).toBuffer({endian: 'big', size: 4})]); if (hash_func_c29(blockTemplate.algo, header, params.pow)) isVerifyFailed = true; } else { if (++ verified_share_num <= MAX_VER_SHARES_PER_SEC*VER_SHARES_PERIOD) { // Validate share with CN hash, then if valid, blast it up to the master. - const shareBuffer = cnUtil.construct_block_blob(template, new Buffer(nonce, 'hex'), blob_type); - const convertedBlob = cnUtil.convert_blob(shareBuffer, blob_type); + const shareBuffer = constructNewBlob(template, new Buffer(nonce, 'hex'), blob_type); + const convertedBlob = convertBlob(shareBuffer, blob_type); const hash = hash_func(convertedBlob, blockTemplate); if (hash.toString('hex') !== params.result) isVerifyFailed = true; } else { diff --git a/package.json b/package.json index 8379a02..b741411 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.17.0", + "version": "0.17.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index fcdf82e..cd51542 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.17.0"; +const PROXY_VERSION = "0.17.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 90fef7b0c8686c8509960d0cf52f4dcc2fb0ab0c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 7 Mar 2020 02:17:14 -0800 Subject: [PATCH 295/367] Fixed AstroBWT --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b741411..288a0d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.17.1", + "version": "0.17.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.1" } } diff --git a/proxy.js b/proxy.js index cd51542..060c578 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.17.1"; +const PROXY_VERSION = "0.17.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 15f731f471d9eddab21a667b9abbe66e62a9d6e9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 7 Mar 2020 02:30:24 -0800 Subject: [PATCH 296/367] Fixed AstroBWT --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 288a0d4..d763443 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.2" } } From f4f634a71191b3d91d4765177ef83f769c0beaa1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 7 Mar 2020 09:58:25 -0800 Subject: [PATCH 297/367] Fixed AstroBWT --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d763443..073e10e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.3" } } From 251546e83c3e5f5557e63a20f935927b8b95287f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 7 Mar 2020 09:58:45 -0800 Subject: [PATCH 298/367] Fixed AstroBWT --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 073e10e..064a50a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.17.2", + "version": "0.17.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { From 07cf7b738e7f527a1c73540c22c68fdc6f97bec8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 7 Mar 2020 09:58:50 -0800 Subject: [PATCH 299/367] Fixed AstroBWT --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 060c578..5eb22be 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.17.2"; +const PROXY_VERSION = "0.17.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ca18f3366b06ab380dd1e5037958d991c0218029 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 8 Mar 2020 11:19:29 -0700 Subject: [PATCH 300/367] Fixed blob_type_num --- lib/xmr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index f1f6e39..d94566e 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -36,11 +36,11 @@ function convertBlob(blobBuffer, blob_type_num){ return cnUtil.convert_blob(blobBuffer, blob_type_num); } -function constructNewBlob(blockTemplate, NonceBuffer, constructNewBlob, ring){ +function constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring){ if (blobTypeDero(blob_type_num)) { NonceBuffer.copy(blockTemplate, 39, 0, 4); return blockTemplate; - } else return constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring); + } else return cnUtil.construct_block_blob(blockTemplate, NonceBuffer, blob_type_num, ring); } function getRemoteNodes() { From 41601238d214767e24f6ea1271b35fc875c6f30c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 6 May 2020 13:51:59 -0700 Subject: [PATCH 301/367] Fixed undef miner crash --- proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy.js b/proxy.js index 5eb22be..ff78720 100644 --- a/proxy.js +++ b/proxy.js @@ -644,7 +644,7 @@ function balanceWorkers(){ if(minerChanges.hasOwnProperty(pool) && minerChanges[pool].length > 0){ minerChanges[pool].forEach(function(miner){ let minerBits = miner.split('_'); - cluster.workers[minerBits[0]].send({ + if (cluster.workers[minerBits[0]]) cluster.workers[minerBits[0]].send({ type: 'changePool', worker: minerBits[1], pool: pool From a541117da14a2b21c7e463951c46ab0c5609b38f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 3 Jun 2020 17:28:06 -0700 Subject: [PATCH 302/367] Update XMR address --- README.md | 2 +- config_example.json | 6 +++--- lib/xmr.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d9b8af..6ae7968 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ Please check the [wiki](https://github.com/MoneroOcean/xmr-node-proxy/wiki/confi Developer Donations =================== If you'd like to make a one time donation, the addresses are as follows: -* XMR - ```44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1``` +* XMR - ```89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL``` * AEON - ```WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT``` * ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1``` * SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy``` diff --git a/config_example.json b/config_example.json index 46f7911..516b20f 100644 --- a/config_example.json +++ b/config_example.json @@ -6,7 +6,7 @@ "ssl": false, "allowSelfSignedSSL": false, "share": 100, - "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "username": "89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL", "password": "proxy", "keepAlive": true, "algo": "rx/0", @@ -20,7 +20,7 @@ "ssl": false, "allowSelfSignedSSL": false, "share": 0, - "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "username": "89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL", "password": "proxy", "keepAlive": true, "algo": "rx/0", @@ -34,7 +34,7 @@ "ssl": false, "allowSelfSignedSSL": false, "share": 0, - "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "username": "89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL", "password": "proxy", "keepAlive": true, "algo": "rx/0", diff --git a/lib/xmr.js b/lib/xmr.js index d94566e..38f04f8 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -462,7 +462,7 @@ let devPool = { "port": 10032, "ssl": false, "share": 0, - "username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1", + "username": "89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL", "password": "proxy_donations", "keepAlive": true, "coin": "xmr", From 5e0ff81260da1d12e820cd71b2e0829f2d71dc70 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 3 Jul 2020 22:10:19 -0700 Subject: [PATCH 303/367] Added CCX support --- README.md | 1 + lib/xmr.js | 3 +++ package.json | 4 ++-- proxy.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6ae7968..4b48dca 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ If you'd like to make a one time donation, the addresses are as follows: * XEQ - ```Tvzp9tTmdGP9X8hCEw1Qzn18divQajJYTjR5HuUzHPKyLK5fzRt2X73FKBDzcnHMDJKdgsPhUDVrKHVcDJQVmLBg33NbkdjQb``` * XTA - ```ipN5cNhm7RXAGACP4ZXki4afT3iJ1A6Ka5U4cswE6fBPDcv8JpivurBj3vu1bXwPyb8KZEGsFUYMmToFG4N9V9G72X4WpAQ8L``` * DERO - ```dERokvcrnuWH1ai1QmZQc9cgxrLwE3rX3TbhdrnLmi3BVZmf197qd5FaFqmPMp5dZ3igXfVQwUUMgTSjpVKDtUeb6DT2xp64XJ``` +* CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` diff --git a/lib/xmr.js b/lib/xmr.js index 38f04f8..3d13d5e 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -122,6 +122,9 @@ function hash_func(convertedBlob, blockTemplate) { case 'cn/zls': case 'cryptonight/zls': return multiHashing.cryptonight(convertedBlob, 15); + case 'cn/ccx': + case 'cryptonight/ccx': return multiHashing.cryptonight(convertedBlob, 17); + case 'cn/double': case 'cryptonight/double': return multiHashing.cryptonight(convertedBlob, 16); diff --git a/package.json b/package.json index 064a50a..9f88f86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.17.3", + "version": "0.17.4", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v17.0.3" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" } } diff --git a/proxy.js b/proxy.js index ff78720..32d0881 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.17.3"; +const PROXY_VERSION = "0.17.4"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 4b152f5e7994f33227f5ae67b088986dc6f8ae94 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 14 Jul 2020 20:33:59 -0700 Subject: [PATCH 304/367] Experimental TUBE/Haven support --- lib/xmr.js | 31 +++++++++++++++++++++++++------ package.json | 4 ++-- proxy.js | 11 ++++++----- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 3d13d5e..9fd4792 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -24,11 +24,23 @@ function blockHeightCheck(nodeList, callback) { } function blobTypeGrin(blob_type_num) { - return blob_type_num == 8 || blob_type_num == 9; + return blob_type_num == 8 || blob_type_num == 9 || blob_type_num == 10; } +function nonceSize(blob_type_num) { + return blob_type_num == 7 ? 8 : 4; +} + function blobTypeDero(blob_type_num) { - return blob_type_num == 10; + return blob_type_num == 100; +} + +function blobTypeHaven(blob_type_num) { + return blob_type_num == 101; +} + +function c29ProofSize(blob_type_num) { + return blob_type_num == 10 ? 40 : 32; } function convertBlob(blobBuffer, blob_type_num){ @@ -40,7 +52,9 @@ function constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring){ if (blobTypeDero(blob_type_num)) { NonceBuffer.copy(blockTemplate, 39, 0, 4); return blockTemplate; - } else return cnUtil.construct_block_blob(blockTemplate, NonceBuffer, blob_type_num, ring); + } else { + return cnUtil.construct_block_blob(blockTemplate, NonceBuffer, blob_type_num, ring); + } } function getRemoteNodes() { @@ -68,7 +82,9 @@ function parse_blob_type(blob_type_str) { case 'aeon': return 7; // Aeon case 'cuckaroo': return 8; // Swap/MoneroV case 'cryptonote_xtnc': return 9; // XTNC - case 'cryptonote_dero': return 10; // Dero + case 'cryptonote_tube': return 10; // Tube + case 'cryptonote_xhv': return 11; // Haven + case 'cryptonote_dero': return 100; // Dero } return 0; } @@ -178,6 +194,7 @@ function hash_func_c29(algo, header, ring) { switch (algo) { case 'c29s': return multiHashing.c29s(header, ring); case 'c29v': return multiHashing.c29v(header, ring); + case 'c29b': return multiHashing.c29b(header, ring); default: return 1; } } @@ -290,7 +307,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { pre_pow: blob, algo: "cuckaroo", edgebits: 29, - proofsize: 32, + proofsize: c29ProofSize(activeBlockTemplate.blob_type), noncebytes: 4, height: activeBlockTemplate.height, job_id: newJob.id, @@ -301,7 +318,7 @@ function getJob(miner, activeBlockTemplate, bashCache) { job_id: newJob.id, height: activeBlockTemplate.height, seed_hash: activeBlockTemplate.seed_hash, - target: getTargetHex(miner.difficulty, activeBlockTemplate.blob_type == 7 ? 8 : 4), + target: getTargetHex(miner.difficulty, nonceSize(activeBlockTemplate.blob_type)), id: miner.id }; if (typeof (activeBlockTemplate.variant) !== 'undefined') { @@ -483,6 +500,8 @@ module.exports = function () { getRemoteNodes: getRemoteNodes, BlockTemplate: BlockTemplate, getJob: getJob, + c29ProofSize: c29ProofSize, + nonceSize: nonceSize, processShare: processShare, MasterBlockTemplate: MasterBlockTemplate, getMasterJob: getMasterJob, diff --git a/package.json b/package.json index 9f88f86..68f3368 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.17.4", + "version": "0.18.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v7.0.2", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" } } diff --git a/proxy.js b/proxy.js index 32d0881..f294737 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.17.4"; +const PROXY_VERSION = "0.18.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; @@ -1207,9 +1207,10 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } - const is_bad_nonce = miner.coinFuncs.blobTypeGrin(job.blob_type) ? - (typeof params.nonce !== 'number') || !(params.pow instanceof Array) || (params.pow.length != 32) : - (typeof params.nonce !== 'string') || !(job.blob_type == 7 ? nonceCheck64.test(params.nonce) : nonceCheck32.test(params.nonce) ); + const blob_type_num = job.blob_type; + const is_bad_nonce = miner.coinFuncs.blobTypeGrin(blob_type_num) ? + (typeof params.nonce !== 'number') || !(params.pow instanceof Array) || (params.pow.length != miner.coinFuncs.c29ProofSize(blob_type_num)) : + (typeof params.nonce !== 'string') || !(miner.coinFuncs.nonceSize(blob_type_num) == 8 ? nonceCheck64.test(params.nonce) : nonceCheck32.test(params.nonce) ); if (is_bad_nonce) { console.warn(global.threadName + 'Malformed nonce: ' + JSON.stringify(params) + ' from ' + miner.logString); @@ -1223,7 +1224,7 @@ function handleMinerData(minerSocket, id, method, params, ip, portData, sendRepl return; } - const nonce_test = miner.coinFuncs.blobTypeGrin(job.blob_type) ? params.pow.join(':') : params.nonce; + const nonce_test = miner.coinFuncs.blobTypeGrin(blob_type_num) ? params.pow.join(':') : params.nonce; job.submissions.push(nonce_test); let activeBlockTemplate = activePools[miner.pool].activeBlocktemplate; From c0dfeb4b4b7777c4ee4c1b0d43f85936ea3607c0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 15 Jul 2020 08:01:04 -0700 Subject: [PATCH 305/367] Rolled back experimental utils --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 68f3368..ec8f438 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" } } From 463c0d84ccd3a6fcf27ba36fc17d3da4c7381ff5 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 15 Jul 2020 13:16:31 -0700 Subject: [PATCH 306/367] Added extra warning about not compativle pools --- lib/xmr.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/xmr.js b/lib/xmr.js index 9fd4792..6dc1a81 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -261,6 +261,7 @@ function MasterBlockTemplate(template) { this.reservedOffset = template.reserved_offset; // reserveOffset this.workerOffset = template.client_nonce_offset; // clientNonceLocation this.poolOffset = template.client_pool_offset; // clientPoolLocation + if (!("client_pool_offset" in template)) console.error("Your pool is not compatible with xmr-node-proxy!"); this.targetDiff = template.target_diff; this.targetHex = template.target_diff_hex; this.buffer = new Buffer(this.blob, 'hex'); From e90e226ad8b5dbd1c48d0b3459b1ebc7f198b679 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 15 Jul 2020 14:03:31 -0700 Subject: [PATCH 307/367] Utils with new Haven fork support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec8f438..68f3368 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" } } From 7db13994ba8204251f082734bad7c7e40d7b0a62 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 16 Jul 2020 10:59:38 -0700 Subject: [PATCH 308/367] Fixed Haven ringct --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 68f3368..23be224 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.18.0", + "version": "0.18.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" } } diff --git a/proxy.js b/proxy.js index f294737..056ae4d 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.18.0"; +const PROXY_VERSION = "0.18.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 35a60aa0cd0a6b553da61e5b02f082348d6f3867 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 16 Jul 2020 20:49:40 -0700 Subject: [PATCH 309/367] Added Panther algo support --- lib/xmr.js | 2 ++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 6dc1a81..878ae15 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -176,6 +176,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); + case 'panther': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 3); + case 'rx/arq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 2); case 'argon2/chukwa': diff --git a/package.json b/package.json index 23be224..41b7bfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.18.1", + "version": "0.19.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.1", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v19.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v20.0.0" } } diff --git a/proxy.js b/proxy.js index 056ae4d..d795434 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.18.1"; +const PROXY_VERSION = "0.19.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 4bc6378a8900d0615ac136ee6446c73cc0dcf44c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 17 Jul 2020 08:52:37 -0700 Subject: [PATCH 310/367] Added libsodium-dev --- Dockerfile | 2 +- install.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e08dcf..ee3abaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt-get update \ && curl -fsSL https://deb.nodesource.com/setup_8.x -o /tmp/node_setup.sh \ && bash /tmp/node_setup.sh \ && rm /tmp/node_setup.sh \ - && apt-get install -y nodejs git make g++ libboost-dev libboost-system-dev libboost-date-time-dev \ + && apt-get install -y nodejs git make g++ libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev \ && git clone https://github.com/MoneroOcean/xmr-node-proxy /xmr-node-proxy \ && cd /xmr-node-proxy \ && npm install \ diff --git a/install.sh b/install.sh index 173b018..c92b80f 100644 --- a/install.sh +++ b/install.sh @@ -11,11 +11,11 @@ CURUSER=$(whoami) if which yum >/dev/null; then sudo yum -y update sudo yum -y upgrade - sudo yum -y install git curl make gcc-c++ python-virtualenv boost-devel boost-system-devel boost-date-time-devel + sudo yum -y install git curl make gcc-c++ python-virtualenv boost-devel boost-system-devel boost-date-time-devel libsodium-devel else sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python-virtualenv libboost-dev libboost-system-dev libboost-date-time-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python-virtualenv libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev fi cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy From 06decc82fd0cfae1da0b03becc3f52b03834ae53 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 29 Jul 2020 17:30:08 -0700 Subject: [PATCH 311/367] Updated TUBE address --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b48dca..58cf9bf 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ If you'd like to make a one time donation, the addresses are as follows: * RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` * XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` * XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` -* TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` +* TUBE - ```TubedBNkgkTbd2CBmLQSwW58baJNghD9xdmctiRXjrW3dE8xpUcoXimY4J5UMrnUBrUDmfQrbxRYRX9s5tQe7pWYNF2QiAdH1Fh``` * LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` * TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG``` * XTNC - ```XtazhSxz1bbJLpT2JuiD2UWFUJYSFty5SVWuF6sy2w9v8pn69smkUxkTVCQc8NKCd6CBMNDGzgdPRYBKaHdbgZ5SNptVH1yPCTQ``` From db28c907eff325ec6b0a11e8cc0ba2713e277b6c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 31 Jul 2020 18:11:27 -0700 Subject: [PATCH 312/367] Removed python-virtualenv dep --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c92b80f..4886016 100644 --- a/install.sh +++ b/install.sh @@ -11,11 +11,11 @@ CURUSER=$(whoami) if which yum >/dev/null; then sudo yum -y update sudo yum -y upgrade - sudo yum -y install git curl make gcc-c++ python-virtualenv boost-devel boost-system-devel boost-date-time-devel libsodium-devel + sudo yum -y install git curl make gcc-c++ python boost-devel boost-system-devel boost-date-time-devel libsodium-devel else sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python-virtualenv libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev fi cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy From f0b4010aaf667faaf901f6012de3c54d3bb6cafa Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 31 Jul 2020 23:34:17 -0700 Subject: [PATCH 313/367] Updated XLA --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58cf9bf..559dbac 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ If you'd like to make a one time donation, the addresses are as follows: * WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` * XMV - ```XvyVfpAYp3zSuvdtoHgnDzMUf7GAeiumeUgVC7RTq6SfgtzGEzy4dUgfEEfD5adk1kN4dfVZdT3zZdgSD2xmVBs627Vwt2C3Ey``` * RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` -* XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` +* XLA - ```SvkpUizij25ZGRHGb1c8ZTAHp3VyNFU3NQuQR1PtMyCqdpoZpaYAGMfG99z5guuoktY13nrhEerqYNKXvoxD7cUM1xA6Z5rRY``` * XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` * TUBE - ```TubedBNkgkTbd2CBmLQSwW58baJNghD9xdmctiRXjrW3dE8xpUcoXimY4J5UMrnUBrUDmfQrbxRYRX9s5tQe7pWYNF2QiAdH1Fh``` * LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` From 08f9d41dfe73f25dd5cd224d7bed8745c65f1ee2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 1 Aug 2020 09:14:18 -0700 Subject: [PATCH 314/367] Algo name fix --- lib/xmr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmr.js b/lib/xmr.js index 878ae15..94a5aa7 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -176,7 +176,7 @@ function hash_func(convertedBlob, blockTemplate) { case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); - case 'panther': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 3); + case 'panthera': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 3); case 'rx/arq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 2); From 61d68d10cebba0e942c46096f435c5bc2047ea78 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 1 Aug 2020 09:14:45 -0700 Subject: [PATCH 315/367] Algo name fix --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 41b7bfd..f833c95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.19.0", + "version": "0.19.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index d795434..c73ee62 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.19.0"; +const PROXY_VERSION = "0.19.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 6c6c97080d100e5b1d65dfdcff94016dff0343c3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 4 Sep 2020 04:12:27 +0000 Subject: [PATCH 316/367] XTA coin update --- lib/xmr.js | 16 ++++++++++++++-- package.json | 6 +++--- proxy.js | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 94a5aa7..cb24ef2 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -24,7 +24,13 @@ function blockHeightCheck(nodeList, callback) { } function blobTypeGrin(blob_type_num) { - return blob_type_num == 8 || blob_type_num == 9 || blob_type_num == 10; + switch (blob_type_num) { + case 8: + case 9: + case 10: + case 12: return true; + default: return false; + } } function nonceSize(blob_type_num) { @@ -40,7 +46,11 @@ function blobTypeHaven(blob_type_num) { } function c29ProofSize(blob_type_num) { - return blob_type_num == 10 ? 40 : 32; + switch (blob_type_num) { + case 10: return 40; + case 12: return 48; + default: return 32; + } } function convertBlob(blobBuffer, blob_type_num){ @@ -84,6 +94,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xtnc': return 9; // XTNC case 'cryptonote_tube': return 10; // Tube case 'cryptonote_xhv': return 11; // Haven + case 'cryptonote_xta': return 12; // Italo case 'cryptonote_dero': return 100; // Dero } return 0; @@ -197,6 +208,7 @@ function hash_func_c29(algo, header, ring) { case 'c29s': return multiHashing.c29s(header, ring); case 'c29v': return multiHashing.c29v(header, ring); case 'c29b': return multiHashing.c29b(header, ring); + case 'c29i': return multiHashing.c29i(header, ring); default: return 1; } } diff --git a/package.json b/package.json index f833c95..a55937f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.19.1", + "version": "0.19.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.1.1", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v20.0.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.2.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v21.0.0" } } diff --git a/proxy.js b/proxy.js index c73ee62..cad6d06 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.19.1"; +const PROXY_VERSION = "0.19.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 75ce1182cfe3f076912d54deb4e7ed4827300086 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 23 Oct 2020 03:30:02 +0000 Subject: [PATCH 317/367] argon2/chukwav2 support --- lib/xmr.js | 4 ++-- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index cb24ef2..45acac5 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -191,8 +191,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'rx/arq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 2); - case 'argon2/chukwa': - case 'chukwa': return multiHashing.argon2(convertedBlob, 0); + case 'argon2/chukwav2': + case 'chukwav2': return multiHashing.argon2(convertedBlob, 2); case 'argon2/wrkz': return multiHashing.argon2(convertedBlob, 1); diff --git a/package.json b/package.json index a55937f..ab63fc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.19.2", + "version": "0.19.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.2.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v21.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v22.0.0" } } diff --git a/proxy.js b/proxy.js index cad6d06..d2f48c0 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.19.2"; +const PROXY_VERSION = "0.19.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ab46861822283dc2fab9b7dd4ed5831a34b4dd65 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 20 Apr 2021 19:44:53 +0000 Subject: [PATCH 318/367] Updated utils version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab63fc1..83187d4 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v8.2.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v9.2.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v22.0.0" } } From bf2fe6765b979ef6ebe52327f56a86021b952fe4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 20 Jul 2021 04:31:53 +0000 Subject: [PATCH 319/367] Updated to new nodejs version --- README.md | 3 +++ install.sh | 4 ++-- lib/xmr.js | 20 ++++++++++---------- package.json | 4 ++-- proxy.js | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 559dbac..9d4604f 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,9 @@ If you'd like to make a one time donation, the addresses are as follows: * XTA - ```ipN5cNhm7RXAGACP4ZXki4afT3iJ1A6Ka5U4cswE6fBPDcv8JpivurBj3vu1bXwPyb8KZEGsFUYMmToFG4N9V9G72X4WpAQ8L``` * DERO - ```dERokvcrnuWH1ai1QmZQc9cgxrLwE3rX3TbhdrnLmi3BVZmf197qd5FaFqmPMp5dZ3igXfVQwUUMgTSjpVKDtUeb6DT2xp64XJ``` * CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` +* BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` +* RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` +* ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` * ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` diff --git a/install.sh b/install.sh index 4886016..3da0566 100644 --- a/install.sh +++ b/install.sh @@ -21,8 +21,8 @@ cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash source ~/.nvm/nvm.sh -nvm install v8.11.3 -nvm alias default v8.11.3 +nvm install v14.17.3 +nvm alias default v14.17.3 cd ~/xmr-node-proxy npm install || exit 1 npm install -g pm2 diff --git a/lib/xmr.js b/lib/xmr.js index 45acac5..8e5a2b7 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -239,8 +239,8 @@ function BlockTemplate(template) { this.workerOffset = template.worker_offset; // clientNonceLocation this.targetDiff = template.target_diff; this.targetHex = template.target_diff_hex; - this.buffer = new Buffer(this.blob, 'hex'); - this.previousHash = new Buffer(32); + this.buffer = Buffer.from(this.blob, 'hex'); + this.previousHash = Buffer.alloc(32); this.workerNonce = 0; this.solo = false; if (typeof(this.workerOffset) === 'undefined') { @@ -278,8 +278,8 @@ function MasterBlockTemplate(template) { if (!("client_pool_offset" in template)) console.error("Your pool is not compatible with xmr-node-proxy!"); this.targetDiff = template.target_diff; this.targetHex = template.target_diff_hex; - this.buffer = new Buffer(this.blob, 'hex'); - this.previousHash = new Buffer(32); + this.buffer = Buffer.from(this.blob, 'hex'); + this.previousHash = Buffer.alloc(32); this.job_id = template.job_id; this.workerNonce = 0; this.poolNonce = 0; @@ -385,13 +385,13 @@ function adjustMinerDiff(miner, max_diff) { } function getTargetHex(difficulty, size) { - let padded = new Buffer(32); + let padded = Buffer.alloc(32); padded.fill(0); const diffBuff = baseDiff.div(difficulty).toBuffer(); diffBuff.copy(padded, 32 - diffBuff.length); const buff = padded.slice(0, size); const buffArray = buff.toByteArray().reverse(); - const buffReversed = new Buffer(buffArray); + const buffReversed = Buffer.from(buffArray); return buffReversed.toString('hex'); }; @@ -408,14 +408,14 @@ let poolShareCount = {}; let poolShareTime = {}; function hash_buff_diff(hash) { - return baseDiff.div(bignum.fromBuffer(new Buffer(hash.toByteArray().reverse()))); + return baseDiff.div(bignum.fromBuffer(Buffer.from(hash.toByteArray().reverse()))); } function processShare(miner, job, blockTemplate, params) { const blob_type = job.blob_type; const nonce = params.nonce; - let template = new Buffer(blockTemplate.buffer.length); + let template = Buffer.alloc(blockTemplate.buffer.length); blockTemplate.buffer.copy(template); if (blockTemplate.solo) { template.writeUInt32BE(job.extraNonce, blockTemplate.reservedOffset); @@ -423,7 +423,7 @@ function processShare(miner, job, blockTemplate, params) { template.writeUInt32BE(job.extraNonce, blockTemplate.workerOffset); } - const hashDiff = hash_buff_diff(blobTypeGrin(blob_type) ? multiHashing.c29_cycle_hash(params.pow) : new Buffer(params.result, 'hex')); + const hashDiff = hash_buff_diff(blobTypeGrin(blob_type) ? multiHashing.c29_cycle_hash(params.pow) : Buffer.from(params.result, 'hex')); if (hashDiff.ge(blockTemplate.targetDiff)) { let time_now = Date.now(); @@ -440,7 +440,7 @@ function processShare(miner, job, blockTemplate, params) { } else { if (++ verified_share_num <= MAX_VER_SHARES_PER_SEC*VER_SHARES_PERIOD) { // Validate share with CN hash, then if valid, blast it up to the master. - const shareBuffer = constructNewBlob(template, new Buffer(nonce, 'hex'), blob_type); + const shareBuffer = constructNewBlob(template, Buffer.from(nonce, 'hex'), blob_type); const convertedBlob = convertBlob(shareBuffer, blob_type); const hash = hash_func(convertedBlob, blockTemplate); if (hash.toString('hex') !== params.result) isVerifyFailed = true; diff --git a/package.json b/package.json index 83187d4..b7034d4 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v9.2.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v22.0.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.0.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v24.0.0" } } diff --git a/proxy.js b/proxy.js index d2f48c0..b8385f9 100644 --- a/proxy.js +++ b/proxy.js @@ -1294,7 +1294,7 @@ function activateHTTP() { } debug.misc("Authorization Header is: ", auth); var tmp = auth.split(' '); - var buf = new Buffer(tmp[1], 'base64'); + var buf = Buffer.from(tmp[1], 'base64'); var plain_auth = buf.toString(); debug.misc("Decoded Authorization ", plain_auth); var creds = plain_auth.split(':'); From 4676adf197c2ac5fbde9efab2346f22e25f56ad6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 21 Jul 2021 02:14:41 +0000 Subject: [PATCH 320/367] Updated utils --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b7034d4..c71149e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v24.0.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.0.3", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v24.0.1" } } From 3c038afbea87ca4deb215ac465c161277e9362b9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 21 Jul 2021 12:32:17 +0000 Subject: [PATCH 321/367] https://github.com/MoneroOcean/xmr-node-proxy/issues/139 fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c71149e..d863ce5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "homepage": "https://github.com/MoneroOcean/xmr-node-proxy#readme", "dependencies": { "async": "2.1.4", - "bignum": "^0.12.5", + "bignum": "^0.13.1", "circular-buffer": "1.0.2", "debug": "2.6.9", "express": "4.14.0", From 445b8f3ccebdaf34749cfafc64a0b2d9974d28dd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 13 Aug 2021 17:12:55 +0000 Subject: [PATCH 322/367] Added rx/graft support' --- lib/xmr.js | 2 ++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 8e5a2b7..dd903df 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -185,6 +185,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'rx/v': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 19); + case 'rx/graft': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 20); + case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); case 'panthera': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 3); diff --git a/package.json b/package.json index d863ce5..eda8eed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.19.3", + "version": "0.20.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.0.3", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v24.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v25.0.0" } } diff --git a/proxy.js b/proxy.js index b8385f9..ec3059e 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.19.3"; +const PROXY_VERSION = "0.20.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From d31dcfeb3a3bc811b5cbfb0f2206e9017bcd4218 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 18 Nov 2021 16:13:39 +0000 Subject: [PATCH 323/367] Haven 2.0 support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index eda8eed..7a79694 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.20.0", + "version": "0.20.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.0.3", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v25.0.0" } } diff --git a/proxy.js b/proxy.js index ec3059e..c092b3b 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.20.0"; +const PROXY_VERSION = "0.20.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From a2dd28aa15d5e094f63569b2ca4e4fbd149be4e6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Dec 2021 03:32:10 +0000 Subject: [PATCH 324/367] GR support --- README.md | 1 + lib/xmr.js | 12 +++++++++--- package.json | 6 +++--- proxy.js | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9d4604f..b5c0918 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ If you'd like to make a one time donation, the addresses are as follows: * CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` * BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` +* RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` * BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` * BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` diff --git a/lib/xmr.js b/lib/xmr.js index dd903df..0fa1208 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -41,8 +41,8 @@ function blobTypeDero(blob_type_num) { return blob_type_num == 100; } -function blobTypeHaven(blob_type_num) { - return blob_type_num == 101; +function blobTypeRTM(blob_type_num) { + return blob_type_num == 104; } function c29ProofSize(blob_type_num) { @@ -55,13 +55,16 @@ function c29ProofSize(blob_type_num) { function convertBlob(blobBuffer, blob_type_num){ if (blobTypeDero(blob_type_num)) return blobBuffer; - return cnUtil.convert_blob(blobBuffer, blob_type_num); + else if (blobTypeRTM(blob_type_num)) return cnUtil.convertRtmBlob(blobBuffer); + else return cnUtil.convert_blob(blobBuffer, blob_type_num); } function constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring){ if (blobTypeDero(blob_type_num)) { NonceBuffer.copy(blockTemplate, 39, 0, 4); return blockTemplate; + } else if (blobTypeRTM(blob_type_num)) { + return cnUtil.constructNewRtmBlob(blockTemplate, NonceBuffer); } else { return cnUtil.construct_block_blob(blockTemplate, NonceBuffer, blob_type_num, ring); } @@ -96,6 +99,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xhv': return 11; // Haven case 'cryptonote_xta': return 12; // Italo case 'cryptonote_dero': return 100; // Dero + case 'raptoreum': return 104; // RTM } return 0; } @@ -155,6 +159,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'cn/double': case 'cryptonight/double': return multiHashing.cryptonight(convertedBlob, 16); + case 'ghostrider': return multiHashing.cryptonight(convertedBlob, 18); + case 'cn-lite': case 'cryptonight-lite': case 'cn-lite/0': diff --git a/package.json b/package.json index 7a79694..677a038 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.20.1", + "version": "0.21.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v10.1.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v25.0.0" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.0.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v26.0.0" } } diff --git a/proxy.js b/proxy.js index c092b3b..04f48df 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.20.1"; +const PROXY_VERSION = "0.21.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ace0d3b7ac5a4a4fd1214a71c38c19030b6d1718 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Dec 2021 20:42:04 +0000 Subject: [PATCH 325/367] Blob fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 677a038..1cdd7a0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v26.0.0" } } From 525c0d1233635aeeeb2efcae68f493134f85f9af Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 1 Dec 2021 20:46:58 +0000 Subject: [PATCH 326/367] Blob fix --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1cdd7a0..f0cb9b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.21.0", + "version": "0.21.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 04f48df..26392eb 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.21.0"; +const PROXY_VERSION = "0.21.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 60f839b4817e7e82ba134b4a6177fbb14bfe750c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 9 Feb 2022 16:46:29 +0000 Subject: [PATCH 327/367] Use updated XHV utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f0cb9b7..b167a57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.21.1", + "version": "0.21.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v26.0.0" } } diff --git a/proxy.js b/proxy.js index 26392eb..f8e0e5d 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.21.1"; +const PROXY_VERSION = "0.21.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 7cf4b2a8bd92d538b10dc385cce4d496233b8b02 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 5 Aug 2022 15:32:52 +0000 Subject: [PATCH 328/367] Monero v15 (view tags) hard-fork support --- README.md | 11 ++++++----- package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b5c0918..31bb99d 100644 --- a/README.md +++ b/README.md @@ -194,16 +194,17 @@ If you'd like to make a one time donation, the addresses are as follows: * XWP - ```fh4MCJrakhWGoS6Meqp6UxGE1GNfAjKaRdPjW36rTffDiqvEq2HWEKZhrbYRw7XJb3CXxkjL3tcYGTT39m5qgjvk1ap4bVu1R``` * XEQ - ```Tvzp9tTmdGP9X8hCEw1Qzn18divQajJYTjR5HuUzHPKyLK5fzRt2X73FKBDzcnHMDJKdgsPhUDVrKHVcDJQVmLBg33NbkdjQb``` * XTA - ```ipN5cNhm7RXAGACP4ZXki4afT3iJ1A6Ka5U4cswE6fBPDcv8JpivurBj3vu1bXwPyb8KZEGsFUYMmToFG4N9V9G72X4WpAQ8L``` -* DERO - ```dERokvcrnuWH1ai1QmZQc9cgxrLwE3rX3TbhdrnLmi3BVZmf197qd5FaFqmPMp5dZ3igXfVQwUUMgTSjpVKDtUeb6DT2xp64XJ``` +* DERO - ```dero1qygrgnz9gea2rqgwhdtpfpa3mvagt5uyq0g92nurwrpk6wnn7hdnzqgudsv6t``` * CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` * BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` * RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` -* BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` -* BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` -* ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` -* LTC - ```MCkjQo99VzoeZQ1piDzLDb4uqNSDRZpx55``` +* BTC - ```3HRbMgcvbqHVW7P34MNGvF2Gh3DE26iHdw``` +* BCH - ```18sKoDSjLCFW9kZrXuza1qzEERnKi7bx8S``` +* ETH - ```0xfE23a61548FCCE159a541FAe9e16cEB92Da650ed``` +* ETC - ```0x4480Ad73a113BEFf05B2079E38D90c9757Ecb063``` +* LTC - ```MGj8PU1PpTNDDqRHmuEqfDpH3gxp6cJrUU``` ## Known Working Pools diff --git a/package.json b/package.json index b167a57..39dfc4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.21.2", + "version": "0.22.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v11.1.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v12.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v26.0.0" } } diff --git a/proxy.js b/proxy.js index f8e0e5d..3b64aac 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.21.2"; +const PROXY_VERSION = "0.22.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 779e259562db7932aab9a81d137d3c9b8968f9ba Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 2 Oct 2022 20:49:07 +0000 Subject: [PATCH 329/367] Fixed for ARM --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39dfc4d..6460b32 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v12.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v26.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.5" } } From ccc113757426f9a4663be7b30e0afcc4e60da5b7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 2 Oct 2022 21:40:39 +0000 Subject: [PATCH 330/367] Fixed for ARM --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6460b32..7831ced 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v12.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.5" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.6" } } From 3f17ff701686bee842a7db067aa68b308f0416d6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 3 Oct 2022 00:29:47 +0000 Subject: [PATCH 331/367] Bug fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7831ced..b700d14 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v12.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.6" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.7" } } From 47bd64cc25bf9fda2ffdcfd8eaa6842748a801fe Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 27 Dec 2022 05:52:02 +0000 Subject: [PATCH 332/367] Haven 3.0 support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b700d14..290a38f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.22.0", + "version": "0.22.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v12.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v13.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.7" } } diff --git a/proxy.js b/proxy.js index 3b64aac..6f1698e 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.22.0"; +const PROXY_VERSION = "0.22.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 3e3d8e6a444b8a90266b8fcebc2fba0a09d7cd32 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 9 Jan 2023 15:57:16 +0000 Subject: [PATCH 333/367] XHV fix --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 290a38f..96bd134 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.22.1", + "version": "0.22.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v13.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v13.0.3", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.7" } } diff --git a/proxy.js b/proxy.js index 6f1698e..0f7e4e5 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.22.1"; +const PROXY_VERSION = "0.22.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 5a24a4f039dcadc8962b2153968b96429947ced2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Jun 2023 00:30:07 +0000 Subject: [PATCH 334/367] ZEPH support --- lib/xmr.js | 1 + package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 0fa1208..0944121 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -98,6 +98,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_tube': return 10; // Tube case 'cryptonote_xhv': return 11; // Haven case 'cryptonote_xta': return 12; // Italo + case 'cryptonote_zeph': return 13; // Zephyr case 'cryptonote_dero': return 100; // Dero case 'raptoreum': return 104; // RTM } diff --git a/package.json b/package.json index 96bd134..16311e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.22.2", + "version": "0.23.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v13.0.3", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.7" } } diff --git a/proxy.js b/proxy.js index 0f7e4e5..5295dd3 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.22.2"; +const PROXY_VERSION = "0.23.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 3f18a1d1725eb7917e0a3fd0e1d7b657d8aed946 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Jun 2023 02:05:59 +0000 Subject: [PATCH 335/367] Improved rx seed switch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16311e3..8051d5d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.7" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.9" } } From 57bd234233ccedcb46dd0c5e4969957f23fe0711 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Jun 2023 02:06:42 +0000 Subject: [PATCH 336/367] Improved rx seed switch --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8051d5d..dce69a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.23.0", + "version": "0.23.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 5295dd3..83b40a2 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.23.0"; +const PROXY_VERSION = "0.23.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From c7fff263c7eae7bb15d2bb6d84687162637f68a3 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Jun 2023 04:00:36 +0000 Subject: [PATCH 337/367] Better ZEPH support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dce69a4..0d380a1 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.9" } } From 580b0867e2f70f21088e10a9bf21e17cd562edc2 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 5 Jul 2023 22:54:20 +0000 Subject: [PATCH 338/367] Reduced memory usage --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d380a1..d3bd9aa 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.1", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.9" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" } } From 8b245ae69eb46bccab2374be30ad7daa00e4f010 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 20 Jul 2023 17:31:08 +0000 Subject: [PATCH 339/367] Updated for Ubuntu 22.04 --- Dockerfile | 4 ++-- README.md | 2 ++ install.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee3abaa..4cbf6d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 RUN apt-get update \ && apt-get install -y curl gnupg \ - && curl -fsSL https://deb.nodesource.com/setup_8.x -o /tmp/node_setup.sh \ + && curl -fsSL https://deb.nodesource.com/setup_14.x -o /tmp/node_setup.sh \ && bash /tmp/node_setup.sh \ && rm /tmp/node_setup.sh \ && apt-get install -y nodejs git make g++ libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev \ diff --git a/README.md b/README.md index 31bb99d..283853b 100644 --- a/README.md +++ b/README.md @@ -197,8 +197,10 @@ If you'd like to make a one time donation, the addresses are as follows: * DERO - ```dero1qygrgnz9gea2rqgwhdtpfpa3mvagt5uyq0g92nurwrpk6wnn7hdnzqgudsv6t``` * CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` * BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` +* ZEPH - ```ZEPHYR2nic7ULkkmgZNX8a9i2tMbkxuCqjgWZYuee3awX7RhtmhoT98CwGEGrruWZVSKtA7Z7JC8m7oeYHtBD9cBEZzdEh9BSdq4q``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` * RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` +* BTRM - ```Bfhtr2g56tg73TNZBRCu6fJUD39Kur6SGG``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` * BTC - ```3HRbMgcvbqHVW7P34MNGvF2Gh3DE26iHdw``` * BCH - ```18sKoDSjLCFW9kZrXuza1qzEERnKi7bx8S``` diff --git a/install.sh b/install.sh index 3da0566..8b1e9d2 100644 --- a/install.sh +++ b/install.sh @@ -15,7 +15,7 @@ if which yum >/dev/null; then else sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git curl make g++ python2 libboost-dev libboost-system-dev libboost-date-time-dev libsodium-dev fi cd ~ git clone https://github.com/MoneroOcean/xmr-node-proxy From 1409bf44d65071b119016e1384e95729031f87c1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 20 Jul 2023 19:09:12 +0000 Subject: [PATCH 340/367] Get rid of dash --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4cbf6d8..41559e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:22.04 +RUN rm /bin/sh && ln -s /bin/bash /bin/sh + RUN apt-get update \ && apt-get install -y curl gnupg \ && curl -fsSL https://deb.nodesource.com/setup_14.x -o /tmp/node_setup.sh \ From 401ae28c77cd92e0354c93afc5b69b4ed331aa6c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 28 Aug 2023 03:41:43 +0000 Subject: [PATCH 341/367] Updated coin utils --- README.md | 1 + package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 283853b..4eecb0c 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ If you'd like to make a one time donation, the addresses are as follows: * BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` * ZEPH - ```ZEPHYR2nic7ULkkmgZNX8a9i2tMbkxuCqjgWZYuee3awX7RhtmhoT98CwGEGrruWZVSKtA7Z7JC8m7oeYHtBD9cBEZzdEh9BSdq4q``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` +* XNA - ```Nb931jkFtFN7QWpu4FqSThaoKajYjS5iFZ``` * RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` * BTRM - ```Bfhtr2g56tg73TNZBRCu6fJUD39Kur6SGG``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` diff --git a/package.json b/package.json index d3bd9aa..d25f1a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.23.1", + "version": "0.23.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v14.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.0.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" } } diff --git a/proxy.js b/proxy.js index 83b40a2..854f872 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.23.1"; +const PROXY_VERSION = "0.23.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 4188ab5af29ce997872510110e2da7a7d269b2c6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 6 Sep 2023 00:55:45 +0000 Subject: [PATCH 342/367] Added CLORE support --- README.md | 1 + package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4eecb0c..4990b9b 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ If you'd like to make a one time donation, the addresses are as follows: * ZEPH - ```ZEPHYR2nic7ULkkmgZNX8a9i2tMbkxuCqjgWZYuee3awX7RhtmhoT98CwGEGrruWZVSKtA7Z7JC8m7oeYHtBD9cBEZzdEh9BSdq4q``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` * XNA - ```Nb931jkFtFN7QWpu4FqSThaoKajYjS5iFZ``` +* CLORE - ```AdXPHtV8yb86a8QKsbs8gmUpRpcxufRn8n``` * RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` * BTRM - ```Bfhtr2g56tg73TNZBRCu6fJUD39Kur6SGG``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` diff --git a/package.json b/package.json index d25f1a0..53affc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.23.2", + "version": "0.23.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.0.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.0.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" } } diff --git a/proxy.js b/proxy.js index 854f872..a061489 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.23.2"; +const PROXY_VERSION = "0.23.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ac1b510845e1aa2b09966a3b5e4d6d2295f64117 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 26 Sep 2023 16:44:56 +0000 Subject: [PATCH 343/367] XLA fork support --- lib/xmr.js | 1 + package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 0944121..9a9128d 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -99,6 +99,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xhv': return 11; // Haven case 'cryptonote_xta': return 12; // Italo case 'cryptonote_zeph': return 13; // Zephyr + case 'cryptonote_xla': return 14; // XLA case 'cryptonote_dero': return 100; // Dero case 'raptoreum': return 104; // RTM } diff --git a/package.json b/package.json index 53affc9..b7b4664 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.23.3", + "version": "0.24.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.0.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.1.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" } } diff --git a/proxy.js b/proxy.js index a061489..484b292 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.23.3"; +const PROXY_VERSION = "0.24.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From a450b4821630f50f1fa8a8c33495996601ad2622 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 1 Oct 2023 14:25:54 +0000 Subject: [PATCH 344/367] Added ZEPH fork support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b7b4664..f0226b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.24.0", + "version": "0.24.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.1.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.2.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" } } diff --git a/proxy.js b/proxy.js index 484b292..3fffac2 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.24.0"; +const PROXY_VERSION = "0.24.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 572c9f85da453d4b39e0fcf9bc22dc1a77b22b3f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 3 Mar 2024 18:13:28 -0800 Subject: [PATCH 345/367] Updated hashing utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f0226b0..6c60e30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.24.1", + "version": "0.24.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.2.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.10" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.11" } } diff --git a/proxy.js b/proxy.js index 3fffac2..e87535a 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.24.1"; +const PROXY_VERSION = "0.24.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 3e538806bbea5685b3f1076cabb1aea346301073 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 28 May 2024 03:02:07 +0300 Subject: [PATCH 346/367] Added KCN coin support --- README.md | 1 + lib/xmr.js | 2 ++ package.json | 6 +++--- proxy.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4990b9b..6809d5c 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ If you'd like to make a one time donation, the addresses are as follows: * XNA - ```Nb931jkFtFN7QWpu4FqSThaoKajYjS5iFZ``` * CLORE - ```AdXPHtV8yb86a8QKsbs8gmUpRpcxufRn8n``` * RTM - ```RUCyaEZxQu3Eure73XPQ57si813RYAMQKC``` +* KCN - ```kc1qchtxq2gw9dc4r58hcegd6n4jspew6j9mu3yz8q``` * BTRM - ```Bfhtr2g56tg73TNZBRCu6fJUD39Kur6SGG``` * ERG - ```9fe533kUzAE57YfPP6o3nzsYMKN2W2uCxvg8KG8Vn5DDeJGetRw``` * BTC - ```3HRbMgcvbqHVW7P34MNGvF2Gh3DE26iHdw``` diff --git a/lib/xmr.js b/lib/xmr.js index 9a9128d..4a76325 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -163,6 +163,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'ghostrider': return multiHashing.cryptonight(convertedBlob, 18); + case 'flex': return multiHashing.cryptonight(convertedBlob, 19); + case 'cn-lite': case 'cryptonight-lite': case 'cn-lite/0': diff --git a/package.json b/package.json index 6c60e30..7007754 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.24.2", + "version": "0.25.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.2.0", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v28.0.11" + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.2", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.0" } } diff --git a/proxy.js b/proxy.js index e87535a..9c78335 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.24.2"; +const PROXY_VERSION = "0.25.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From aa9427c120a3557dd8a211663afda6053ffffff6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 28 May 2024 03:05:02 +0300 Subject: [PATCH 347/367] Added rx/xeq algo support --- lib/xmr.js | 3 +++ package.json | 2 +- proxy.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 4a76325..6b00e05 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -100,6 +100,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xta': return 12; // Italo case 'cryptonote_zeph': return 13; // Zephyr case 'cryptonote_xla': return 14; // XLA + case 'cryptonote_xeq': return 22; // XEQ case 'cryptonote_dero': return 100; // Dero case 'raptoreum': return 104; // RTM } @@ -197,6 +198,8 @@ function hash_func(convertedBlob, blockTemplate) { case 'rx/graft': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 20); + case 'rx/xeq': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 22); + case 'defyx': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 1); case 'panthera': return multiHashing.randomx(convertedBlob, Buffer.from(blockTemplate.seed_hash, 'hex'), 3); diff --git a/package.json b/package.json index 7007754..fb32d17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.0", + "version": "0.25.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 9c78335..0452b30 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.0"; +const PROXY_VERSION = "0.25.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From b125eef83713a02a293023998ce526a1e2e242f8 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 29 May 2024 03:26:34 +0300 Subject: [PATCH 348/367] Improved Flex algo speed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb32d17..425eaa1 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.0" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.1" } } From e5594629d9aefab9555a0676c24259a54fd2f33e Mon Sep 17 00:00:00 2001 From: BK <36295058+BKdilse@users.noreply.github.com> Date: Thu, 30 May 2024 17:57:11 +0100 Subject: [PATCH 349/367] Update package.json cryptonight-hashing v29.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 425eaa1..c5fac5d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.2", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.1" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } From df2e404a05c53853272c48645efeacc8fb370f0d Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 31 May 2024 18:18:48 +0300 Subject: [PATCH 350/367] Adds kcn dev reward to bt --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c5fac5d..17ddd40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.1", + "version": "0.25.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.2", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.3", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index 0452b30..4421893 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.1"; +const PROXY_VERSION = "0.25.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 6c4eebf95fb0a5979777f2855b10c619bff1aa8b Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 31 May 2024 20:39:47 +0300 Subject: [PATCH 351/367] KCN fix --- lib/xmr.js | 8 ++++++++ package.json | 4 ++-- proxy.js | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 6b00e05..40489da 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -45,6 +45,10 @@ function blobTypeRTM(blob_type_num) { return blob_type_num == 104; } +function blobTypeKCN(blob_type_num) { + return blob_type_num == 105; +} + function c29ProofSize(blob_type_num) { switch (blob_type_num) { case 10: return 40; @@ -56,6 +60,7 @@ function c29ProofSize(blob_type_num) { function convertBlob(blobBuffer, blob_type_num){ if (blobTypeDero(blob_type_num)) return blobBuffer; else if (blobTypeRTM(blob_type_num)) return cnUtil.convertRtmBlob(blobBuffer); + else if (blobTypeKCN(blob_type_num)) return cnUtil.convertKcnBlob(blobBuffer); else return cnUtil.convert_blob(blobBuffer, blob_type_num); } @@ -65,6 +70,8 @@ function constructNewBlob(blockTemplate, NonceBuffer, blob_type_num, ring){ return blockTemplate; } else if (blobTypeRTM(blob_type_num)) { return cnUtil.constructNewRtmBlob(blockTemplate, NonceBuffer); + } else if (blobTypeKCN(blob_type_num)) { + return cnUtil.constructNewKcnBlob(blockTemplate, NonceBuffer); } else { return cnUtil.construct_block_blob(blockTemplate, NonceBuffer, blob_type_num, ring); } @@ -103,6 +110,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xeq': return 22; // XEQ case 'cryptonote_dero': return 100; // Dero case 'raptoreum': return 104; // RTM + case 'raptoreum_kcn': return 105; // KCN } return 0; } diff --git a/package.json b/package.json index 17ddd40..704dc69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.3", + "version": "0.25.4", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.3", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.7", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index 4421893..ec38bcd 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.3"; +const PROXY_VERSION = "0.25.4"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 18a5f46e2ff57be26cd6627be9692472b00beab0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 1 Jun 2024 11:55:15 +0300 Subject: [PATCH 352/367] Fixed KCN algo --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 704dc69..18ce5a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.4", + "version": "0.25.5", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.7", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.11", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index ec38bcd..143ddc8 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.4"; +const PROXY_VERSION = "0.25.5"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From b78a6c3e62f0e4eb5e48df93e032d6c4b7690810 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 1 Jun 2024 19:24:30 +0300 Subject: [PATCH 353/367] Fixed KCN reward --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 18ce5a5..379cd13 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.11", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.13", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } From a1b29b211b610f8c3e6833d34da8735c838e74f7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 1 Jun 2024 20:32:28 +0300 Subject: [PATCH 354/367] Fixed KCN blob contruction in all cases --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 379cd13..d227a08 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.13", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.14", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index 143ddc8..867ddc0 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.5"; +const PROXY_VERSION = "0.25.6"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From a32d440352e104acf7812c060839741d9500d83e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 2 Jun 2024 03:04:32 +0300 Subject: [PATCH 355/367] Fixed KCN blob contruction in all cases --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d227a08..4d7e256 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.5", + "version": "0.25.7", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.14", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.15", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index 867ddc0..c47e94d 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.6"; +const PROXY_VERSION = "0.25.7"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From b4af8cc40050a3cb24a3bc354138d87cbc5a2b2f Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 3 Jun 2024 02:05:33 +0300 Subject: [PATCH 356/367] Updated KCN/RTM utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4d7e256..ac7142a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.7", + "version": "0.25.8", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.15", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.19", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index c47e94d..f9cf831 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.7"; +const PROXY_VERSION = "0.25.8"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 505d735be017f280a038815a6fd5ea0f2377dc99 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 5 Jun 2024 17:56:24 +0300 Subject: [PATCH 357/367] Updated RTM utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ac7142a..e5e283d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.8", + "version": "0.25.9", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.19", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.20", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index f9cf831..e659a0f 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.8"; +const PROXY_VERSION = "0.25.9"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 32154d4de2d971afe3f3e93ee651c7fde7a0fadb Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 14 Jul 2024 02:14:56 +0300 Subject: [PATCH 358/367] Added ZEPH update support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e5e283d..38ffd43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.9", + "version": "0.25.10", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.3.20", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.4.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index e659a0f..0bdb802 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.9"; +const PROXY_VERSION = "0.25.10"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ab186c31d8b8a87a08cfea389c51f5a2babfaeed Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Fri, 19 Jul 2024 10:15:21 +0300 Subject: [PATCH 359/367] Added SAL support --- README.md | 1 + lib/xmr.js | 1 + package.json | 4 ++-- proxy.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6809d5c..fdadbbd 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ If you'd like to make a one time donation, the addresses are as follows: * CCX - ```ccx7dmnBBoRPuVcpKJSAVZKdSDo9rc7HVijFbhG34jsXL3qiqfRwu7A5ecem44s2rngDd8y8N4QnYK6WR3mXAcAZ5iXun9BQBx``` * BLOC - ```abLoc5iUG4a6oAb2dqygxkS5M2uHWx16zHb9fUWMzpSEDwm6T7PSq2MLdHonWZ16CGfnJKRomq75aZyviTo6ZjHeYQMzNAEkjMg``` * ZEPH - ```ZEPHYR2nic7ULkkmgZNX8a9i2tMbkxuCqjgWZYuee3awX7RhtmhoT98CwGEGrruWZVSKtA7Z7JC8m7oeYHtBD9cBEZzdEh9BSdq4q``` +* SAL - ```SaLvdWKnkz6MvVgxXr2TWSDSvESz6EBcz3wmMFch2sQuMYz2sUQGVNDYhkYaSuvkDr9GSYp5h6BeQHnGK8HzKhqGeZCZzG3AHS3``` * RVN - ```RLVJv9rQNHzXS3Zn4JH8hfAHmm1LfECMxy``` * XNA - ```Nb931jkFtFN7QWpu4FqSThaoKajYjS5iFZ``` * CLORE - ```AdXPHtV8yb86a8QKsbs8gmUpRpcxufRn8n``` diff --git a/lib/xmr.js b/lib/xmr.js index 40489da..d6bdcca 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -107,6 +107,7 @@ function parse_blob_type(blob_type_str) { case 'cryptonote_xta': return 12; // Italo case 'cryptonote_zeph': return 13; // Zephyr case 'cryptonote_xla': return 14; // XLA + case 'cryptonote_sal': return 15; // SAL case 'cryptonote_xeq': return 22; // XEQ case 'cryptonote_dero': return 100; // Dero case 'raptoreum': return 104; // RTM diff --git a/package.json b/package.json index 38ffd43..1bb39f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.25.10", + "version": "0.26.0", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.4.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index 0bdb802..c299778 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.25.10"; +const PROXY_VERSION = "0.26.0"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 2935e7528431e8e2838f7fde396d1f2ba66b6fc7 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 20 Jul 2024 19:18:38 +0300 Subject: [PATCH 360/367] Added SAL support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1bb39f2..a8f2ccb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.0", + "version": "0.26.1", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.16", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" } } diff --git a/proxy.js b/proxy.js index c299778..5ca4e40 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.0"; +const PROXY_VERSION = "0.26.1"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 8f758f666f5acf3d27acc60d32422a168a5156f4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 11 Aug 2024 19:39:41 +0300 Subject: [PATCH 361/367] Updated utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a8f2ccb..7e03cb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.1", + "version": "0.26.2", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.16", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.2" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.3" } } diff --git a/proxy.js b/proxy.js index 5ca4e40..f17c986 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.1"; +const PROXY_VERSION = "0.26.2"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From c626ade5c92c8e7339d1d74cb1646856363a3ddd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 11 Aug 2024 19:43:02 +0300 Subject: [PATCH 362/367] Updated utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7e03cb5..8f7ae88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.2", + "version": "0.26.3", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.16", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.3" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.4" } } diff --git a/proxy.js b/proxy.js index f17c986..a9cdda0 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.2"; +const PROXY_VERSION = "0.26.3"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 32cdf63aa66ede0bcf847b4cb40860ca37c1dd60 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 11 Aug 2024 19:55:11 +0300 Subject: [PATCH 363/367] Updated utils --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8f7ae88..4bcb332 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.3", + "version": "0.26.4", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -26,6 +26,6 @@ "moment": "2.21.0", "request": "^2.79.0", "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.16", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.4" + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.5" } } diff --git a/proxy.js b/proxy.js index a9cdda0..c69b74b 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.3"; +const PROXY_VERSION = "0.26.4"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From 36388b6d2aa4a6d66c19f79b5e333f2138c9dadd Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 7 Oct 2024 07:54:23 +0300 Subject: [PATCH 364/367] ZEPH 2.0 support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4bcb332..1134ccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.4", + "version": "0.26.5", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.5.16", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.6.0", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.5" } } diff --git a/proxy.js b/proxy.js index c69b74b..95a8182 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.4"; +const PROXY_VERSION = "0.26.5"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From ac8de8518907eb5c7de8d69712058b97c0b1a0a1 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 5 Nov 2024 16:50:17 +0300 Subject: [PATCH 365/367] Fixed SAL parse after fork --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1134ccd..e887642 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.6.0", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.6.1", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.5" } } From b82a30ae8551db3d9f4fbe678ff78df4313fd2ae Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 5 Nov 2024 16:50:41 +0300 Subject: [PATCH 366/367] Fixed SAL parse after fork --- package.json | 2 +- proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e887642..a3e2b1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.5", + "version": "0.26.6", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { diff --git a/proxy.js b/proxy.js index 95a8182..de3da2b 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.5"; +const PROXY_VERSION = "0.26.6"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 }; From fadcb67654efffcef6894c2eb5a878f1cfe7376c Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 19 Dec 2024 06:48:47 +0300 Subject: [PATCH 367/367] SAL v0.7 support and removed RingCT XHV support --- package.json | 4 ++-- proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a3e2b1a..f6f6a82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmr-node-proxy", - "version": "0.26.6", + "version": "0.26.7", "description": "Node proxy for XMR pools based on nodejs-pool, should support any coins that nodejs-pool does with little work", "main": "proxy.js", "scripts": { @@ -25,7 +25,7 @@ "minimist": "1.2.0", "moment": "2.21.0", "request": "^2.79.0", - "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.6.1", + "cryptoforknote-util": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#v15.6.2", "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git#v29.0.5" } } diff --git a/proxy.js b/proxy.js index de3da2b..0696fbe 100644 --- a/proxy.js +++ b/proxy.js @@ -9,7 +9,7 @@ const async = require('async'); const support = require('./lib/support.js')(); global.config = require('./config.json'); -const PROXY_VERSION = "0.26.6"; +const PROXY_VERSION = "0.26.7"; const DEFAULT_ALGO = [ "rx/0" ]; const DEFAULT_ALGO_PERF = { "rx/0": 1, "rx/loki": 1 };