fix(pool): replace CryptoNight with ProgPoWZ via zano-node-util
Pool now uses native Lethean/Zano block validation through zano-node-util instead of generic CryptoNight hashing. Ports updated to 5555/7777/8888, Redis auth enabled, difficulty tuned for testnet. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
b8843b49a4
commit
80878cd5f2
4 changed files with 26 additions and 28 deletions
24
config.json
24
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
|
||||
},
|
||||
|
|
|
|||
14
lib/pool.js
14
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();
|
||||
|
|
|
|||
13
lib/utils.js
13
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) {
|
||||
|
|
|
|||
|
|
@ -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": "*",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue