diff --git a/README.md b/README.md index 38617e1..bf9ff0a 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@ # 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: +:warning: **[uPlexa will change PoW algorithm on April 29, 2019] Please update this proxy to the latest version and please put "algo": "cryptonight-upx" into your pool section of config.json** :warning: -Supports all known cryptonight/heavy/light coins: +Supports: -* 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) * uPlexa (UPX) -* Sumokoin (SUMO), Haven (XHV), Loki (LOKI) -* ... +* uPlexa v2 (UPXTWO) ## Setup Instructions @@ -162,55 +157,3 @@ Many smaller VMs come with ulimits set very low. We suggest looking into setting 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. - -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. - -## Configuration Guidelines - -Please check the [wiki](https://github.com/MoneroOcean/xmr-node-proxy/wiki/config_review) for information on configuration - -Developer Donations -=================== -If you'd like to make a one time donation, the addresses are as follows: -* XMR - ```44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1``` -* AEON - ```WmsEg3RuUKCcEvFBtXcqRnGYfiqGJLP1FGBYiNMgrcdUjZ8iMcUn2tdcz59T89inWr9Vae4APBNf7Bg2DReFP5jr23SQqaDMT``` -* ETN - ```etnkQMp3Hmsay2p7uxokuHRKANrMDNASwQjDUgFb5L2sDM3jqUkYQPKBkooQFHVWBzEaZVzfzrXoETX6RbMEvg4R4csxfRHLo1``` -* SUMO - ```Sumoo1DGS7c9LEKZNipsiDEqRzaUB3ws7YHfUiiZpx9SQDhdYGEEbZjRET26ewuYEWAZ8uKrz6vpUZkEVY7mDCZyGnQhkLpxKmy``` -* GRFT - ```GACadqdXj5eNLnyNxvQ56wcmsmVCFLkHQKgtaQXNEE5zjMDJkWcMVju2aYtxbTnZgBboWYmHovuiH1Ahm4g2N5a7LuMQrpT``` -* MSR - ```5hnMXUKArLDRue5tWsNpbmGLsLQibt23MEsV3VGwY6MGStYwfTqHkff4BgvziprTitbcDYYpFXw2rEgXeipsABTtEmcmnCK``` -* ITNS - ```iz53aMEaKJ25zB8xku3FQK5VVvmu2v6DENnbGHRmn659jfrGWBH1beqAzEVYaKhTyMZcxLJAdaCW3Kof1DwTiTbp1DSqLae3e``` -* WOW - ```Wo3yjV8UkwvbJDCB1Jy7vvXv3aaQu3K8YMG6tbY3Jo2KApfyf5RByZiBXy95bzmoR3AvPgNq6rHzm98LoHTkzjiA2dY7sqQMJ``` -* XMV - ```4BDgQohRBqg2wFZ5ezYqCrNGjgECAttARdbh1fNkuAbd3HnNkSgas11QD9VFQMzbnvDD3Mfcky1LAFihkbEYph5oGAMLurw``` -* RYO - ```RYoLsi22qnoKYhnv1DwHBXcGe9QK6P9zmekwQnHdUAak7adFBK4i32wFTszivQ9wEPeugbXr2UD7tMd6ogf1dbHh76G5UszE7k1``` -* XTL - ```Se3Qr5s83AxjCtYrkkqg6QXJagCVi8dELbHb5Cnemw4rMk3xZzEX3kQfWrbTZPpdAJSP3enA6ri3DcvdkERkGKE518vyPQTyi``` -* XHV - ```hvxyEmtbqs5TEk9U2tCxyfGx2dyGD1g8EBspdr3GivhPchkvnMHtpCR2fGLc5oEY42UGHVBMBANPge5QJ7BDXSMu1Ga2KFspQR``` -* TUBE - ```bxcpZTr4C41NshmJM9Db7FBE5crarjaDXVUApRbsCxHHBf8Jkqjwjzz1zmWHhm9trWNhrY1m4RpcS7tmdG4ykdHG2kTgDcbKJ``` -* LOKI - ```L6XqN6JDedz5Ub8KxpMYRCUoQCuyEA8EegEmeQsdP5FCNuXJavcrxPvLhpqY6emphGTYVrmAUVECsE9drafvY2hXUTJz6rW``` -* TRTL - ```TRTLv2x2bac17cngo1r2wt3CaxN8ckoWHe2TX7dc8zW8Fc9dpmxAvhVX4u4zPjpv9WeALm2koBLF36REVvsLmeufZZ1Yx6uWkYG``` -* BTC - ```3BzvMuLStA388kYZ9nudfm8L22937dSPS3``` -* BCH - ```qrhww48p5s6zw9twhc7cujgwp7vym2k4vutem6f92p``` -* ETH - ```0xCF8BABC074C487Ae17F9Ce0394eab492E6A35658``` -* LTC - ```MCkjQo99VzoeZQ1piDzLDb4uqNSDRZpx55``` - -## Known Working Pools - -* [XMRPool.net](https://xmrpool.net) -* [supportXMR.com](https://supportxmr.com) -* [pool.xmr.pt](https://pool.xmr.pt) -* [minemonero.pro](https://minemonero.pro) -* [XMRPool.xyz](https://xmrpool.xyz) -* [ViaXMR.com](https://viaxmr.com) -* [mine.MoneroPRO.com](https://mine.moneropro.com) -* [MinerCircle.com](https://www.minercircle.com) -* [xmr.p00ls.net](https://www.p00ls.net) -* [MoriaXMR.com](https://moriaxmr.com) -* [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 MoneroOcean at support@moneroocean.stream! diff --git a/lib/xmr.js b/lib/xmr.js index 35811db..e817e95 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -91,14 +91,17 @@ function parse_algo_variant(algo_str, variant) { case 'cn/rto': case 'cryptonight/rto': return 7; - case 'cn/2': - case 'cryptonight/2': return 8; + case 'cn-upx/2': + case 'cryptonight-upx/2': return 8; + + case 'cn/upxtwo': + case 'cryptonight-upxtwo': return 8; } 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-upx/2" in default_pool_algo_set && "cn/1" in default_pool_algo_set) return block_version >= 11 ? "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(", ")); @@ -303,11 +306,14 @@ 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); - //hash = foo(convertedBlob, parse_algo_variant(blockTemplate.algo, blockTemplate.variant)); - hash = multiHashing.cryptonight_upx(convertedBlob, 1); + var hard_fork_version = convertedBlob[0]; + hash = multiHashing.cryptonight_upx(convertedBlob, 1); + if(hard_fork_version>=11){ + hash = multiHashing.cryptonight_plex(convertedBlob); + } if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); + console.log("\r\n" + hash.toString('hex') + "\r\n" + resultHash); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); return false; } diff --git a/package-lock.json b/package-lock.json index 9c2d382..9535bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -110,9 +110,12 @@ } }, "bindings": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.1.tgz", - "integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } }, "block-stream": { "version": "0.0.9", @@ -213,14 +216,14 @@ "cryptoforknote-util": { "version": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#473f81f81bc55a1fc4c6f5ce55d1feb9b9cf6f61", "requires": { - "bindings": "1.3.1", + "bindings": "1.5.0", "nan": "2.12.0" } }, "cryptonight-hashing": { - "version": "git+https://github.com/uPlexa/node-cryptonight-hashing.git#7e3f15a33934ace8a471b4f4f8045b86e57b03ae", + "version": "git+https://github.com/uPlexa/node-cryptonight-hashing.git#70bcb3e7844711108ccec37c78cf052edec4b1fe", "requires": { - "bindings": "1.3.1", + "bindings": "1.5.0", "nan": "2.12.0" } }, @@ -379,6 +382,11 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "finalhandler": { "version": "0.5.0", "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-0.5.0.tgz",