diff --git a/config.json b/config.json index 275fab9..658fb27 100644 --- a/config.json +++ b/config.json @@ -46,28 +46,28 @@ "sslCA": "chain.pem", "ports": [ { - "port": 3336, - "difficulty": 50000000, + "port": 5555, + "difficulty": 50000, "desc": "Low end hardware" }, { - "port": 3337, - "difficulty": 600000000, - "desc": "middle end hardware" + "port": 7777, + "difficulty": 500000, + "desc": "Mid/high end hardware" }, { - "port": 3338, - "difficulty": 5000000000, + "port": 8888, + "difficulty": 5000000, "desc": "Nicehash, MRR" } ], "varDiff": { - "minDiff": 50000000, - "maxDiff": 5000000000, + "minDiff": 10000, + "maxDiff": 5000000, "targetTime": 45, "retargetTime": 60, - "variancePercent": 5, - "maxJump": 20 + "variancePercent": 30, + "maxJump": 100 }, "paymentId": { "addressSeparator": "+" @@ -158,7 +158,7 @@ "redis": { "host": "127.0.0.1", "port": 6379, - "auth": null, + "auth": "changeme", "db": 11, "cleanupInterval": 15 }, diff --git a/lib/pool.js b/lib/pool.js index 91ee9da..5da50ab 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -16,10 +16,8 @@ let apiInterfaces = require('./apiInterfaces.js')(config.daemon, config.wallet, let notifications = require('./notifications.js'); let utils = require('./utils.js'); -config.hashingUtil = config.hashingUtil || false; -let cnHashing = require('cryptonight-hashing'); -if (config.hashingUtil) - cnHashing = require('turtlecoin-multi-hashing'); +// Lethean uses ProgPoWZ via zano-node-util — no separate CryptoNight hashing needed +let cnHashing = null; // Set nonce pattern - must exactly be 8 hex chars let noncePattern = new RegExp("^[0-9A-Fa-f]{16}$"); @@ -42,12 +40,8 @@ let cnAlgorithm = config.cnAlgorithm || "cryptonight"; let cnVariant = config.cnVariant || 0; let cnBlobType = config.cnBlobType || 0; -let cryptoNight; -if (!cnHashing || !cnHashing[cnAlgorithm]) { - log('error', logSystem, 'Invalid cryptonight algorithm: %s', [cnAlgorithm]); -} else { - cryptoNight = cnHashing[cnAlgorithm]; -} +// ProgPoWZ: hashing done through zano-node-util get_pow_hash — no CryptoNight needed +let cryptoNight = null; // Set instance id let instanceId = utils.instanceId(); diff --git a/lib/utils.js b/lib/utils.js index 073b9a6..de839e2 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -22,11 +22,16 @@ exports.instanceId = function(size=4) { } /** - * Validate miner address + * Validate miner address — Lethean uses native is_address_valid **/ -let addressBase58Prefix = parseInt(cnUtil.address_decode(Buffer.from(config.poolServer.poolAddress)).toString()); -let integratedAddressBase58Prefix = config.poolServer.intAddressPrefix ? parseInt(config.poolServer.intAddressPrefix) : addressBase58Prefix + 1; -let subAddressBase58Prefix = config.poolServer.subAddressPrefix ? parseInt(config.poolServer.subAddressPrefix) : "N/A"; +let addressBase58Prefix = null; +try { + let decoded = cnUtil.address_decode(Buffer.from(config.poolServer.poolAddress)); + if (typeof decoded === 'number') addressBase58Prefix = decoded; + else if (Buffer.isBuffer(decoded) && decoded.length >= 8) addressBase58Prefix = decoded.readUInt32BE(4); +} catch(e) {} +let integratedAddressBase58Prefix = config.poolServer.intAddressPrefix ? parseInt(config.poolServer.intAddressPrefix) : (addressBase58Prefix ? addressBase58Prefix + 1 : null); +let subAddressBase58Prefix = config.poolServer.subAddressPrefix ? parseInt(config.poolServer.subAddressPrefix) : null; // Get address prefix function getAddressPrefix(address) { diff --git a/package.json b/package.json index a33e484..e8ea233 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "base58-native": "*", "bignum": "*", "cli-color": "*", - "cryptoforknote-util": "git+https://forge.lthn.ai/lthn/lethean-node-util.git", - "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git", + "cryptoforknote-util": "file:../zano-node-util", "dateformat": "^4.5.1", "mailgun.js": "*", "node-telegram-bot-api": "*",