Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UPX Support #81

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
node_modules/
npm-debug.log
cert*
config.json
config.json
62 changes: 1 addition & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# 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:

* 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)
* ...
* uPlexa (UPX)

## Setup Instructions

Expand Down Expand Up @@ -161,55 +153,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 [email protected]!
16 changes: 8 additions & 8 deletions config_example.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"pools": [
{
"hostname": "gulf.moneroocean.stream",
"port": 10032,
"hostname": "upxpool.com",
"port": 7777,
"ssl": false,
"allowSelfSignedSSL": false,
"share": 100,
"username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1",
"share": 50,
"username": "YOUR_UPX_ADDRESS",
"password": "proxy",
"keepAlive": true,
"algo": "cn/2",
"blob_type": "cryptonote",
"default": true
},
{
"hostname": "pool.supportxmr.com",
"port": 7777,
"hostname": "loudmining.com",
"port": 2003,
"ssl": false,
"allowSelfSignedSSL": false,
"share": 0,
"username": "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1",
"share": 50,
"username": "YOUR_UPX_ADDRESS",
"password": "proxy",
"keepAlive": true,
"algo": "cn/2",
Expand Down
20 changes: 15 additions & 5 deletions lib/xmr.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ function parse_algo_variant(algo_str, variant) {
case 'cn-lite/0':
case 'cryptonight-lite/0': return 0;

case 'cn-upx':
case 'cryptonight-upx':
case 'cn/1':
case 'cryptonight/1':
case 'cn-lite/1':
Expand All @@ -89,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(", "));
Expand All @@ -106,6 +111,7 @@ function detectAlgo(default_pool_algo_set, block_version) {
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('upx')) return multiHashing.cryptonight_upx;
if (algo_str.includes('heavy')) return multiHashing.cryptonight_heavy;
return multiHashing.cryptonight;
}
Expand Down Expand Up @@ -300,10 +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));
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;
}
Expand Down
Loading