From 827cf6161f4d6917061b9bcfffbb4a9d95ddf057 Mon Sep 17 00:00:00 2001 From: Oink Date: Thu, 8 Jun 2023 13:54:23 +0200 Subject: [PATCH 01/41] Dates in local time Moved processing of time from server side to client side, to enable displaying the date and time in the users local language, format and timezone. --- website/pages/stats.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/pages/stats.html b/website/pages/stats.html index a0f92eea6..3683b6b69 100644 --- a/website/pages/stats.html +++ b/website/pages/stats.html @@ -149,7 +149,9 @@ {{=block[2]}} {{ } }} {{if (block[4] != null) { }} - {{=readableDate(block[4])}} + + + {{ } }} {{if (it.stats.pools[pool].pending.confirms) { }} {{if (it.stats.pools[pool].pending.confirms[block[0]]) { }} @@ -175,7 +177,9 @@ {{=block[2]}} {{ } }} {{if (block[4] != null) { }} - {{=readableDate(block[4])}} + + + {{ } }} *CREDITED*
Mined By: {{=block[3]}}
From 6fb2540f8f54dc8bef662765c04664e01b03af79 Mon Sep 17 00:00:00 2001 From: Oink Date: Thu, 8 Jun 2023 13:56:20 +0200 Subject: [PATCH 02/41] Update payments.html Same date+time processing changes as `stats.html` --- website/pages/payments.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/pages/payments.html b/website/pages/payments.html index 579d2f17a..af1f318f0 100644 --- a/website/pages/payments.html +++ b/website/pages/payments.html @@ -74,7 +74,8 @@ {{=it.stats.pools[pool].payments[p].blocks}} {{ } }} - {{=readableDate(it.stats.pools[pool].payments[p].time)}} + + {{=it.stats.pools[pool].payments[p].miners}} {{=Math.round(it.stats.pools[pool].payments[p].shares)}} {{=it.stats.pools[pool].payments[p].paid}} {{=it.stats.pools[pool].symbol}} From 141d246b52ba9deb4a919a9f409ceb38d5d7065b Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 13 Jun 2023 19:30:39 +0000 Subject: [PATCH 03/41] dely kicking unknown blocks by 15 blocks --- libs/paymentProcessor.js | 56 ++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index b804411b1..9cfdfa68d 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -8,6 +8,8 @@ var Stratum = require('stratum-pool'); var util = require('stratum-pool/lib/util.js'); var CreateRedisClient = require('./createRedisClient.js'); +let badBlocks = {} + module.exports = function(logger){ var poolConfigs = JSON.parse(process.env.pools); @@ -742,39 +744,59 @@ function SetupForPool(logger, poolOptions, setupFinished){ // update confirmations for round if (tx && tx.result) round.confirmations = parseInt((tx.result.confirmations || 0)); - + // look for transaction errors + // NOTE: We should combine these two if blocks into one since the only difference is in the logged message. if (tx.error && tx.error.code === -5){ - logger.warning(logSystem, logComponent, 'Daemon reports invalid transaction: ' + round.txHash); - round.category = 'kicked'; + if (undefined == badBlocks[round.txHash]) { + badBlocks[round.txHash] = 0 + } + + if (badBlocks[round.txHash] >= 15) { + logger.warning(logSystem, logComponent, 'ERROR: Daemon reports invalid transaction: ' + round.txHash) + delete badBlocks[round.txHash] + round.category = 'kicked' + } else { + badBlocks[round.txHash]++ + logger.warning(logSystem, logComponent, `Abandoned block ${round.txHash} check ${badBlocks[round.txHash]}/15`) + } return; } else if (!tx.result.details || (tx.result.details && tx.result.details.length === 0)){ - logger.warning(logSystem, logComponent, 'Daemon reports no details for transaction: ' + round.txHash); - round.category = 'kicked'; - return; - } - else if (tx.error || !tx.result){ - logger.error(logSystem, logComponent, 'Odd error with gettransaction ' + round.txHash + ' ' + JSON.stringify(tx)); + if (undefined == badBlocks[round.txHash]) { + badBlocks[round.txHash] = 0 + } + if (badBlocks[round.txHash] >= 15) { + logger.warning(logSystem, logComponent, 'ERROR: Daemon reports no details for transaction: ' + round.txHash) + delete badBlocks[round.txHash] + round.category = 'kicked' + } else { + badBlocks[round.txHash]++ + logger.warning(logSystem, logComponent, `Abandoned block ${round.txHash} check ${badBlocks[round.txHash]}/15`) + } return; } + // get the coin base generation tx - var generationTx = tx.result.details.filter(function(tx){ - return tx.address === poolOptions.address; - })[0]; - if (!generationTx && tx.result.details.length === 1){ - generationTx = tx.result.details[0]; + const generationTx = tx.result.details.filter(tx => tx.address === poolOptions.address)[0] + if (!generationTx && tx.result.details.length === 1) { + generationTx = tx.result.details[0] } if (!generationTx){ - logger.error(logSystem, logComponent, 'Missing output details to pool address for transaction ' + round.txHash); - return; + return logger.error(logSystem, logComponent, `ERROR: Missing output details to pool address for transaction ${round.txHash}`) } // get transaction category for round - round.category = generationTx.category; + round.category = generationTx.category // get reward for newly generated blocks if (round.category === 'generate' || round.category === 'immature') { round.reward = coinsRound(parseFloat(generationTx.amount || generationTx.value)); } + + // Clear blocks that previously triggered an attempted kick. + if (!round.txHash in badBlocks) { + logger.error(logSystem, logComponent, `${round.txHash} is no longer bad!`) + delete badBlocks[round.txHash] + } }); var canDeleteShares = function(r){ From 4e31bc04a10d466d61bc9d66fade96533ea7fc90 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 16 Jun 2023 13:55:32 +0000 Subject: [PATCH 04/41] Update dependencies (BitGo/blake2b, BitGo/blake2bs-wasm and s-nomp/equihashverify.git to oink/* repos) --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72f3f6490..8d869ddf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -440,7 +440,7 @@ "bigi": "^1.4.0", "bip66": "^1.1.0", "bitcoin-ops": "^1.3.0", - "blake2b": "git+https://github.com/BitGo/blake2b.git#6268e6dd678661e0acc4359e9171b97eb1ebf8ac", + "blake2b": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "bs58check": "^2.0.0", "create-hash": "^1.1.0", "create-hmac": "^1.1.3", @@ -475,16 +475,16 @@ } }, "blake2b": { - "version": "git+https://github.com/BitGo/blake2b.git#6268e6dd678661e0acc4359e9171b97eb1ebf8ac", - "from": "git+https://github.com/BitGo/blake2b.git#6268e6dd678661e0acc4359e9171b97eb1ebf8ac", + "version": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", + "from": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "requires": { - "blake2b-wasm": "git+https://github.com/BitGo/blake2b-wasm.git#193cdb71656c1a6c7f89b05d0327bb9b758d071b", + "blake2b-wasm": "git+https://github.com/Oink70/blake2b-wasm.git#c183fabcb22cf84d463c7b10f25877a8e4afdc6d", "nanoassert": "^1.0.0" } }, "blake2b-wasm": { - "version": "git+https://github.com/BitGo/blake2b-wasm.git#193cdb71656c1a6c7f89b05d0327bb9b758d071b", - "from": "git+https://github.com/BitGo/blake2b-wasm.git#193cdb71656c1a6c7f89b05d0327bb9b758d071b", + "version": "git+https://github.com/Oink70/blake2b-wasm.git#c183fabcb22cf84d463c7b10f25877a8e4afdc6d", + "from": "git+https://github.com/Oink70/blake2b-wasm.git#c183fabcb22cf84d463c7b10f25877a8e4afdc6d", "requires": { "nanoassert": "^1.0.0" } @@ -1071,7 +1071,7 @@ } }, "equihashverify": { - "version": "git+https://github.com/s-nomp/equihashverify.git#2e9ca0742220c405be71efa2468bcfda0a5075f9", + "version": "git+https://github.com/Oink70/equihashverify.git#2b2c5c9725f1e85a4eaa8b1c8f974aad65362c8e", "from": "git+https://github.com/s-nomp/equihashverify.git", "requires": { "bindings": "*", @@ -3531,7 +3531,7 @@ "base58-native": "^0.1.4", "bignum": "^0.13.0", "bitgo-utxo-lib": "git+https://github.com/miketout/bitgo-utxo-lib.git#4649a79ffc55891e4ad40ac68793befa7348ee6a", - "equihashverify": "git+https://github.com/s-nomp/equihashverify.git#2e9ca0742220c405be71efa2468bcfda0a5075f9", + "equihashverify": "git+https://github.com/Oink70/equihashverify.git#2b2c5c9725f1e85a4eaa8b1c8f974aad65362c8e", "merkle-bitcoin": "^1.0.2", "promise": "^8.0.1", "verushash": "git+https://github.com/VerusCoin/verushash-node.git#e6572f345b8c24e4a1212f6c9eb66c1c400d83e1" From ab7460765f49527a78a368eb6f4e1a3b63a6384d Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 16 Jun 2023 14:08:24 +0000 Subject: [PATCH 05/41] website fix, where S-NOMP fails to start with non-local/non-default database --- libs/website.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/website.js b/libs/website.js index c64882194..e38e99fc1 100644 --- a/libs/website.js +++ b/libs/website.js @@ -134,7 +134,7 @@ module.exports = function(logger){ var buildKeyScriptPage = function(){ async.waterfall([ function(callback){ - var client = CreateRedisClient(portalConfig); + var client = CreateRedisClient(portalConfig.redis); if (portalConfig.redis.password) { client.auth(portalConfig.redis.password); } From a2afec1e66274f1caae8059cd05ad45fef79ba28 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Sat, 17 Jun 2023 12:36:41 +0000 Subject: [PATCH 06/41] rectify variable decleration on : delay kicking --- libs/paymentProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index 9cfdfa68d..4c61dbd91 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -778,7 +778,7 @@ function SetupForPool(logger, poolOptions, setupFinished){ } // get the coin base generation tx - const generationTx = tx.result.details.filter(tx => tx.address === poolOptions.address)[0] + var generationTx = tx.result.details.filter(tx => tx.address === poolOptions.address)[0] if (!generationTx && tx.result.details.length === 1) { generationTx = tx.result.details[0] } From 80814c2cbe9c9e09fa24f10c983ac71b7624ded1 Mon Sep 17 00:00:00 2001 From: Oink Date: Tue, 4 Jul 2023 11:27:07 +0200 Subject: [PATCH 07/41] Create dependency-review.yml --- .github/workflows/dependency-review.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/dependency-review.yml diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 000000000..fe461b424 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v3 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v2 From 3e5cb4a2fdf6904091a033645a531d95fb63cdf9 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 1 Sep 2023 14:22:10 +0000 Subject: [PATCH 08/41] Store LastSeen timestamp for workers in Redis --- libs/shareProcessor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/shareProcessor.js b/libs/shareProcessor.js index c8727a2e9..aadebaf69 100644 --- a/libs/shareProcessor.js +++ b/libs/shareProcessor.js @@ -26,7 +26,7 @@ module.exports = function(logger, poolConfig){ var logSystem = 'Pool'; var logComponent = coin; var logSubCat = 'Thread ' + (parseInt(forkId) + 1); - + var connection = CreateRedisClient(redisConfig); if (redisConfig.password) { connection.auth(redisConfig.password); @@ -74,6 +74,7 @@ module.exports = function(logger, poolConfig){ redisCommands.push(['hincrbyfloat', coin + ':shares:pbaasCurrent', shareData.worker, shareData.difficulty]); redisCommands.push(['hincrbyfloat', coin + ':shares:roundCurrent', shareData.worker, shareData.difficulty]); redisCommands.push(['hincrby', coin + ':stats', 'validShares', 1]); + redisCommands.push(['hset', coin + ':lastSeen', shareData.worker, dateNow]); } else { redisCommands.push(['hincrby', coin + ':stats', 'invalidShares', 1]); } From 65830272f3df2fdf5f72b3d7efdfdf15f7dea883 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 1 Sep 2023 14:23:07 +0000 Subject: [PATCH 09/41] Use Redis lastSeen in delta time calculation --- init.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.js b/init.js index 07dfabbd6..a034d3ae7 100644 --- a/init.js +++ b/init.js @@ -290,8 +290,9 @@ var spawnPoolWorkers = function(){ var redisCommands = []; - // if its been less than 15 minutes since last share was submitted - var timeChangeSec = roundTo(Math.max(now - lastShareTime, 0) / 1000, 4); + // if its been less than 15 minutes since last share was submitted by any stratum + var lastShareTimeUnified = Math.max(redisCommands.push(['hget', msg.coin + ':lastSeen', workerAddress]), lastShareTime); + var timeChangeSec = roundTo(Math.max(now - lastShareTimeUnified, 0) / 1000, 4); //var timeChangeTotal = roundTo(Math.max(now - lastStartTime, 0) / 1000, 4); if (timeChangeSec < 900) { // loyal miner keeps mining :) From 7a3351db74006f4a0586394fec5a6a2394f0adae Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 1 Sep 2023 14:26:42 +0000 Subject: [PATCH 10/41] Updated Redis dependencies --- package-lock.json | 52 ++++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8d869ddf5..519c788af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -478,7 +478,7 @@ "version": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "from": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "requires": { - "blake2b-wasm": "git+https://github.com/Oink70/blake2b-wasm.git#c183fabcb22cf84d463c7b10f25877a8e4afdc6d", + "blake2b-wasm": "git+https://github.com/BitGo/blake2b-wasm.git#193cdb71656c1a6c7f89b05d0327bb9b758d071b", "nanoassert": "^1.0.0" } }, @@ -1020,11 +1020,6 @@ "resolved": "https://registry.npmjs.org/dot/-/dot-1.1.2.tgz", "integrity": "sha1-xzdwGfxOVQeYkosrmv62ar+h8vk=" }, - "double-ended-queue": { - "version": "2.1.0-0", - "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", - "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -1072,7 +1067,7 @@ }, "equihashverify": { "version": "git+https://github.com/Oink70/equihashverify.git#2b2c5c9725f1e85a4eaa8b1c8f974aad65362c8e", - "from": "git+https://github.com/s-nomp/equihashverify.git", + "from": "git+https://github.com/Oink70/equihashverify.git", "requires": { "bindings": "*", "libsodium": "^0.7.3", @@ -3084,24 +3079,35 @@ } }, "redis": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", - "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", + "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", "requires": { - "double-ended-queue": "^2.1.0-0", - "redis-commands": "^1.2.0", - "redis-parser": "^2.6.0" + "denque": "^1.5.0", + "redis-commands": "^1.7.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0" } }, + "denque": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", + "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" + }, + "redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==" + }, "redis-commands": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.5.tgz", - "integrity": "sha512-foGF8u6MXGFF++1TZVC6icGXuMYPftKXt1FBT2vrfU9ZATNtZJ8duRC5d1lEfE8hyVe3jhelHGB91oB7I6qLsA==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", + "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" }, "redis-parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz", - "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==" }, "regex-not": { "version": "1.0.2", @@ -3524,8 +3530,8 @@ "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, "stratum-pool": { - "version": "git+https://github.com/miketout/node-stratum-pool.git#c6e35910eb67a98f2315cb0d6a2d1b5eda639b85", - "from": "git+https://github.com/miketout/node-stratum-pool.git", + "version": "git+https://github.com/VerusCoin/node-stratum-pool.git#5a45e655b8d170253e1fbd56efbf85dd26d8347b", + "from": "git+https://github.com/VerusCoin/node-stratum-pool.git", "requires": { "async": "^2.6.1", "base58-native": "^0.1.4", @@ -3534,7 +3540,7 @@ "equihashverify": "git+https://github.com/Oink70/equihashverify.git#2b2c5c9725f1e85a4eaa8b1c8f974aad65362c8e", "merkle-bitcoin": "^1.0.2", "promise": "^8.0.1", - "verushash": "git+https://github.com/VerusCoin/verushash-node.git#e6572f345b8c24e4a1212f6c9eb66c1c400d83e1" + "verushash": "git+https://github.com/VerusCoin/verushash-node.git#fd4d5fb9e7eefa34d70277bd5cc672bc472f821c" } }, "string-width": { @@ -3849,7 +3855,7 @@ } }, "verushash": { - "version": "git+https://github.com/VerusCoin/verushash-node.git#e6572f345b8c24e4a1212f6c9eb66c1c400d83e1", + "version": "git+https://github.com/VerusCoin/verushash-node.git#fd4d5fb9e7eefa34d70277bd5cc672bc472f821c", "from": "git+https://github.com/VerusCoin/verushash-node.git", "requires": { "bindings": "*", diff --git a/package.json b/package.json index 947142974..b16a4c728 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "node-watch": "^0.5.8", "nonce": "^1.0.4", "pm2": "^3.2.2", - "redis": "^2.8.0", + "redis": "^3.0.0", "request": "^2.88.0", "stratum-pool": "git+https://github.com/VerusCoin/node-stratum-pool.git" }, From e9866850ac6f519349df89cd76655ca3ac0c2d74 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 1 Sep 2023 14:48:04 +0000 Subject: [PATCH 11/41] declare time BEFORE --- libs/shareProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/shareProcessor.js b/libs/shareProcessor.js index aadebaf69..7b54b2c9a 100644 --- a/libs/shareProcessor.js +++ b/libs/shareProcessor.js @@ -69,6 +69,7 @@ module.exports = function(logger, poolConfig){ this.handleShare = function(isValidShare, isValidBlock, shareData) { var redisCommands = []; + var dateNow = Date.now(); if (isValidShare) { redisCommands.push(['hincrbyfloat', coin + ':shares:pbaasCurrent', shareData.worker, shareData.difficulty]); @@ -82,7 +83,6 @@ module.exports = function(logger, poolConfig){ /* Stores share diff, worker, and unique value with a score that is the timestamp. Unique value ensures it doesn't overwrite an existing entry, and timestamp as score lets us query shares from last X minutes to generate hashrate for each worker and pool. */ - var dateNow = Date.now(); var hashrateData = [ isValidShare ? shareData.difficulty : -shareData.difficulty, shareData.worker, dateNow]; redisCommands.push(['zadd', coin + ':hashrate', dateNow / 1000 | 0, hashrateData.join(':')]); From d345e5c234d2e45cfc0070df16edf4b8d2bdf700 Mon Sep 17 00:00:00 2001 From: Oink Date: Sat, 2 Sep 2023 15:55:18 +0200 Subject: [PATCH 12/41] Update package-lock.json Unexpected presence of Libgo reference. --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 519c788af..7ac94d396 100644 --- a/package-lock.json +++ b/package-lock.json @@ -478,7 +478,7 @@ "version": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "from": "git+https://github.com/Oink70/blake2b.git#3eaf87bc21da3eebc10a6e183bc237f1f44de9b0", "requires": { - "blake2b-wasm": "git+https://github.com/BitGo/blake2b-wasm.git#193cdb71656c1a6c7f89b05d0327bb9b758d071b", + "blake2b-wasm": "git+https://github.com/Oink70/blake2b-wasm.git#c183fabcb22cf84d463c7b10f25877a8e4afdc6d", "nanoassert": "^1.0.0" } }, From ba6415007268c903ec8256a22507834519dbb7f5 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 29 Feb 2024 13:22:50 +0000 Subject: [PATCH 13/41] Address validation done by JS instead of daemon --- libs/paymentProcessor.js | 12 ++++++++---- libs/poolWorker.js | 23 ++++++++++------------- package-lock.json | 29 +++++++++++++++++++++++++++++ package.json | 4 +++- 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index 4c61dbd91..cf0c8d02f 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -1439,11 +1439,15 @@ function SetupForPool(logger, poolOptions, setupFinished){ var getProperAddress = function(address){ - if (address.length >= 40){ - logger.warning(logSystem, logComponent, 'Invalid address '+address+', convert to address '+(poolOptions.invalidAddress || poolOptions.address)); - return (poolOptions.invalidAddress || poolOptions.address); + // Validation of Public and Identity addresses + var isvalid = WAValidator.validate(String(address).split(".")[0], 'VRSC'); + if(isvalid !== true){ +/* + // Validation of sapling addreses (disabled until paymentProcessor.js can handle sapling payments) + var isvalid = WAValidator.validate(String(address).split(".")[0], 'VRSC', 'sapling'); } - if (address.length <= 30) { + if (isvalid !== true){ +*/ logger.warning(logSystem, logComponent, 'Invalid address '+address+', convert to address '+(poolOptions.invalidAddress || poolOptions.address)); return (poolOptions.invalidAddress || poolOptions.address); } diff --git a/libs/poolWorker.js b/libs/poolWorker.js index f6f19eca9..b4bfe8ca0 100644 --- a/libs/poolWorker.js +++ b/libs/poolWorker.js @@ -5,6 +5,7 @@ var net = require('net'); var MposCompatibility = require('./mposCompatibility.js'); var ShareProcessor = require('./shareProcessor.js'); var CreateRedisClient = require('./createRedisClient.js'); +var WAValidator = require('wallet-address-validator'); module.exports = function(logger){ @@ -137,19 +138,15 @@ module.exports = function(logger){ if (poolOptions.validateWorkerUsername !== true) authCallback(true); else { - pool.daemon.cmd('validateaddress', [String(workerName).split(".")[0]], function (results) { - var isValid = results.filter(function (r) { - if (r.response) - { - return r.response.isvalid; - } - else - { - return false; - } - }).length > 0; - authCallback(isValid); - }); + //Validation of Public and Identity addresses + var isvalid = WAValidator.validate(String(workerName).split(".")[0], 'VRSC'); +/* + //Validation of sapling addreses (disabled until paymentProcessor.js can handle sapling payments) + if(isvalid !== true){ + var isvalid = WAValidator.validate(String(address).split(".")[0], 'VRSC', 'sapling'); + } +*/ + authCallback(isvalid); } }; diff --git a/package-lock.json b/package-lock.json index 7ac94d396..748e8bb1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3951,6 +3951,35 @@ "argparse": "^1.0.7", "glob": "^7.0.5" } + }, + "wallet-address-validator": { + "version": "git+https://github.com/Oink70/wallet-address-validator.git#cf7835d1a569eed6fa98dd3d4aa4cd287bb59623", + "from": "git+https://github.com/Oink70/wallet-address-validator.git#cf7835d1a569eed6fa98dd3d4aa4cd287bb59623", + "dependencies": { + "base-x": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", + "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "jssha": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jssha/-/jssha-2.3.1.tgz", + "integrity": "sha1-FHshJTaQNcpLL30hDcU58Amz3po=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "jssha": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jssha/-/jssha-2.3.1.tgz", + "integrity": "sha1-FHshJTaQNcpLL30hDcU58Amz3po=" } } } diff --git a/package.json b/package.json index b16a4c728..dd24a7a09 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "pm2": "^3.2.2", "redis": "^3.0.0", "request": "^2.88.0", - "stratum-pool": "git+https://github.com/VerusCoin/node-stratum-pool.git" + "stratum-pool": "git+https://github.com/VerusCoin/node-stratum-pool.git", + "wallet-address-validator": "git+https://github.com/Oink70/wallet-address-validator.git#cf7835d1a569eed6fa98dd3d4aa4cd287bb59623", + "jssha": "^2.3.1" }, "engines": { "node": ">=8.11" From 74bc90053b331f845bd05804967d37a349fd86cd Mon Sep 17 00:00:00 2001 From: Oink70 Date: Mon, 18 Mar 2024 19:46:58 +0000 Subject: [PATCH 14/41] Add script for PBaaS chains --- scripts/pbaascheck.sh | 153 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100755 scripts/pbaascheck.sh diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh new file mode 100755 index 000000000..3ef0f2b54 --- /dev/null +++ b/scripts/pbaascheck.sh @@ -0,0 +1,153 @@ +#!/bin/bash +## +## © verus.io 2018-2023, released under MIT license +## Script written in 2023 by Oink.vrsc@ +## Script maintained by Oink.vrsc@ + + +## default settings +VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client +MAIN_CHAIN=VRSC # main hashing chain +REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` + +## Set script folder +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +## check if the Verus binary is found. +## If Verus exists in the PATH environment, use it. +## If not, fall back to predefined location in this script. +if ! command -v verus &>/dev/null +then + echo "verus not found in your PATH environment. Using location from line 9 in this script." + if ! command -v $VERUS &>/dev/null + then + echo "Verus could not be found. Make sure it's in your path and/or in line 9 of this script." + echo "exiting..." + exit 1 + fi +else + VERUS=$(which verus) +fi + + +## Dependencies: jq, tr, cut, redis-cli/keydb-cli +## jq +if ! command -v jq &>/dev/null ; then + echo "jq not found. please install using your package manager." + exit 1 +else + JQ=$(which jq) +fi +## tr +if ! command -v tr &>/dev/null ; then + echo "tr not found. please install using your package manager." + exit 1 +else + TR=$(which tr) +fi +## cut +if ! command -v cut &>/dev/null ; then + echo "cut not found. please install using your package manager." + exit 1 +else + CUT=$(which cut) +fi +## redis-cli and/or keydb-cli +if ! command -v redis-cli &>/dev/null ; then + if ! command -v keydb-cli &>/dev/null ; then + echo "Both redis-cli or keydb-cli not found. Please install one using your package manager." + exit 1 + fi + REDIS_CLI=$(which keydb-cli) +else + REDIS_CLI=$(which redis-cli) +fi + +## Is main chain active? +count=$(${VERUS} -chain=$MAIN_CHAIN getconnectioncount 2>/dev/null) +case $count in + ''|*[!0-9]*) DAEMON_ACTIVE=0 ;; + *) DAEMON_ACTIVE=1 ;; +esac +if [[ "$DAEMON_ACTIVE" != "1" ]] +then + echo "$MAIN_CHAIN daemon is not running and connected. Start your $MAIN_CHAIN daemon and wait for it to be connected." + exit 1 +fi + +## Return a list of found PBaaS hashes: +HASHLIST=$($REDIS_CLI smembers $REDIS_NAME:pbaasPending | $CUT -d' ' -f2-) +## return a list on found shares per miner +SHARELIST=$($REDIS_CLI hgetall $REDIS_NAME:shares:roundCurrent| $CUT -d' ' -f2-) +## get list of active chains in ecosystem +PBAAS_CHAINS=$($VERUS -chain=$MAIN_CHAIN listcurrencies '{"systemtype":"pbaas"}' | jq --arg MAIN_CHAIN "${MAIN_CHAIN}" -r '.[].currencydefinition | select (.name != "$MAIN_CHAIN") | .name') +## determine chains active on this system +for i in $PBAAS_CHAINS +do + count=$(${VERUS} -chain=$i getconnectioncount 2>/dev/null) + case $count in + ''|*[!0-9]*) DAEMON_ACTIVE=0 ;; + *) DAEMON_ACTIVE=1 ;; + esac + if [[ "$DAEMON_ACTIVE" = "1" ]] + then + ACTIVE_CHAINS="$ACTIVE_CHAINS $i" + fi +done + +## copy shares +for j in $ACTIVE_CHAINS +do + $REDIS_CLI hset $(echo $j | $TR '[:upper:]' '[:lower:]'):shares:roundCurrent $SHARELIST 1>/dev/null +done + +## Check each hash on all chains +for i in $HASHLIST +do + for j in $ACTIVE_CHAINS + ## put in break for non-running chains + do + CHECK=$($VERUS -chain=$j getblock $(echo $i | $CUT -d':' -f1) 2 2>/dev/null) + if [[ "$CHECK" =~ "$(echo $i | cut -d':' -f1)" ]] + then + TRANSACTION=$(echo "$CHECK" | $JQ -r '.tx[0].txid') + BLOCK=$(echo "$CHECK" | $JQ '.height') + echo "$j contains blockhash $(echo $i | cut -d':' -f1), TXID: $TRANSACTION" + REDIS_NEW_PENDING="${i:0:65}"$TRANSACTION:$BLOCK:"${i:65}" + $REDIS_CLI sadd $(echo $j | $TR '[:upper:]' '[:lower:]'):blocksPending $REDIS_NEW_PENDING 1>/dev/null + ## if no shares are known for this round yet, add them + SHARES_AVAILABLE="$($REDIS_CLI hgetall $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK)" + if [[ "$SHARES_AVAILABLE" == "" ]] + then + $REDIS_CLI hset $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK $SHARELIST 1>/dev/null + fi + fi + done +done + +UNKNOWN_HASHLIST=$($REDIS_CLI smembers $REDIS_NAME:pbaasPending | $CUT -d' ' -f2-) +if [ -f $SCRIPT_DIR/unknown_hashlist.4 ] +then + while read -r LINE + do + if [[ "$UNKNOWN_HASHLIST" == *"$LINE"* ]] + then + echo "removing $LINE from REDIS" + $REDIS_CLI srem $REDIS_NAME:pbaasPending $LINE 1>/dev/null + fi + done < $SCRIPT_DIR/unknown_hashlist.4 + rm $SCRIPT_DIR/unknown_hashlist.4 +fi + +for i in {3..1} +do + if [ -f $SCRIPT_DIR/unknown_hashlist.$i ] + then + mv $SCRIPT_DIR/unknown_hashlist.$i $SCRIPT_DIR/unknown_hashlist.$((i+1)) + fi +done + +for i in $UNKNOWN_HASHLIST +do + echo $i >> $SCRIPT_DIR/unknown_hashlist.1 +done From 55d7f1e3186094771d020142549f9100f88a6983 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 19 Mar 2024 08:07:10 +0000 Subject: [PATCH 15/41] Do not duplicate into main chain stats --- scripts/pbaascheck.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 3ef0f2b54..822a92a48 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -98,7 +98,10 @@ done ## copy shares for j in $ACTIVE_CHAINS do - $REDIS_CLI hset $(echo $j | $TR '[:upper:]' '[:lower:]'):shares:roundCurrent $SHARELIST 1>/dev/null + if [[ "$(echo $j | $TR '[:upper:]' '[:lower:]')" != "$(echo $MAIN_CHAIN | $TR '[:upper:]' '[:lower:]')" ]] + then + $REDIS_CLI hset $(echo $j | $TR '[:upper:]' '[:lower:]'):shares:roundCurrent $SHARELIST 1>/dev/null + fi done ## Check each hash on all chains @@ -114,12 +117,15 @@ do BLOCK=$(echo "$CHECK" | $JQ '.height') echo "$j contains blockhash $(echo $i | cut -d':' -f1), TXID: $TRANSACTION" REDIS_NEW_PENDING="${i:0:65}"$TRANSACTION:$BLOCK:"${i:65}" - $REDIS_CLI sadd $(echo $j | $TR '[:upper:]' '[:lower:]'):blocksPending $REDIS_NEW_PENDING 1>/dev/null - ## if no shares are known for this round yet, add them - SHARES_AVAILABLE="$($REDIS_CLI hgetall $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK)" - if [[ "$SHARES_AVAILABLE" == "" ]] + if [[ "$(echo $j | $TR '[:upper:]' '[:lower:]')" != "$(echo $MAIN_CHAIN | $TR '[:upper:]' '[:lower:]')" ]] then - $REDIS_CLI hset $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK $SHARELIST 1>/dev/null + $REDIS_CLI sadd $(echo $j | $TR '[:upper:]' '[:lower:]'):blocksPending $REDIS_NEW_PENDING 1>/dev/null + ## if no shares are known for this round yet, add them + SHARES_AVAILABLE="$($REDIS_CLI hgetall $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK)" + if [[ "$SHARES_AVAILABLE" == "" ]] + then + $REDIS_CLI hset $(echo $j | tr '[:upper:]' '[:lower:]'):shares:round$BLOCK $SHARELIST 1>/dev/null + fi fi fi done From 788a7e7bc24b38c77fdfb0b96d79aaf708795698 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 19 Mar 2024 08:19:14 +0000 Subject: [PATCH 16/41] add in port and host variables --- scripts/pbaascheck.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 822a92a48..1b661f51d 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -9,6 +9,8 @@ VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client MAIN_CHAIN=VRSC # main hashing chain REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` +REDIS_HOST=127.0.0.1 # If you run this script on another system, alter the IP address of your Redis server +REDIS_PORT=6379 # If you use a different REDIS port, alter the port accordingly ## Set script folder SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" @@ -58,9 +60,9 @@ if ! command -v redis-cli &>/dev/null ; then echo "Both redis-cli or keydb-cli not found. Please install one using your package manager." exit 1 fi - REDIS_CLI=$(which keydb-cli) + REDIS_CLI="$(which keydb-cli) -h $REDIS_HOST -p $REDIS_PORT" else - REDIS_CLI=$(which redis-cli) + REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT" fi ## Is main chain active? From 0bddbb140c0640293be7e12d8af6b13c0453e3fa Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 19 Mar 2024 09:05:45 +0000 Subject: [PATCH 17/41] Added database connection check --- scripts/pbaascheck.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 1b661f51d..979ec5357 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -65,6 +65,13 @@ else REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT" fi +## Can we connect to Redis? +if [[ "$($REDIS_CLI ping)" != "PONG" ]] +then + echo "cannot connect to redis server" + exit 1 +fi + ## Is main chain active? count=$(${VERUS} -chain=$MAIN_CHAIN getconnectioncount 2>/dev/null) case $count in From 9178734e5843d02fc85006d8e36fa47a98f5e621 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 19 Mar 2024 09:09:01 +0000 Subject: [PATCH 18/41] Copyright notice change --- scripts/pbaascheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 979ec5357..0553d8698 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -1,6 +1,6 @@ #!/bin/bash ## -## © verus.io 2018-2023, released under MIT license +## © verus.io 2018-2024, released under MIT license ## Script written in 2023 by Oink.vrsc@ ## Script maintained by Oink.vrsc@ From 385a395f64f23d5f34e7e33b760d9534440b7e7b Mon Sep 17 00:00:00 2001 From: Oink Date: Sun, 24 Mar 2024 09:44:07 +0100 Subject: [PATCH 19/41] Update paymentProcessor.js Adding WAValidator dependency --- libs/paymentProcessor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index cf0c8d02f..cd2e9003b 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -7,6 +7,7 @@ var async = require('async'); var Stratum = require('stratum-pool'); var util = require('stratum-pool/lib/util.js'); var CreateRedisClient = require('./createRedisClient.js'); +var WAValidator = require('wallet-address-validator'); let badBlocks = {} From b0fb473d5bbe61bea65ee2198a31a388aa45498d Mon Sep 17 00:00:00 2001 From: Oink70 Date: Mon, 1 Apr 2024 06:52:35 +0000 Subject: [PATCH 20/41] use pid file to prevent script running if alreeady active --- scripts/pbaascheck.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 0553d8698..92e52f81c 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -4,6 +4,14 @@ ## Script written in 2023 by Oink.vrsc@ ## Script maintained by Oink.vrsc@ +# check if script is already running +if [ -f /tmp/pbaascheck.pid ] +then + echo "script is already running" + exit 1 +else + touch /tmp/pbaascheck.pid +fi ## default settings VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client @@ -166,3 +174,4 @@ for i in $UNKNOWN_HASHLIST do echo $i >> $SCRIPT_DIR/unknown_hashlist.1 done + From 9f0cda8dfc6795ddb8e99f47316501d000bbe298 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 4 Apr 2024 21:40:07 +0000 Subject: [PATCH 21/41] convert non-payable i-addresses to primary adresses of their VRSC IDs --- scripts/pbaascheck.sh | 75 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 92e52f81c..510fd3878 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x ## ## © verus.io 2018-2024, released under MIT license ## Script written in 2023 by Oink.vrsc@ @@ -17,7 +17,7 @@ fi VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client MAIN_CHAIN=VRSC # main hashing chain REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` -REDIS_HOST=127.0.0.1 # If you run this script on another system, alter the IP address of your Redis server +REDIS_HOST=162.55.8.164 # If you run this script on another system, alter the IP address of your Redis server REDIS_PORT=6379 # If you use a different REDIS port, alter the port accordingly ## Set script folder @@ -111,10 +111,12 @@ do ACTIVE_CHAINS="$ACTIVE_CHAINS $i" fi done +ACTIVE_CHAINS=$(echo $ACTIVE_CHAINS | sed 's/VRSC//g'); ## copy shares for j in $ACTIVE_CHAINS do + # Do not insert data for the main mining chain if [[ "$(echo $j | $TR '[:upper:]' '[:lower:]')" != "$(echo $MAIN_CHAIN | $TR '[:upper:]' '[:lower:]')" ]] then $REDIS_CLI hset $(echo $j | $TR '[:upper:]' '[:lower:]'):shares:roundCurrent $SHARELIST 1>/dev/null @@ -134,6 +136,7 @@ do BLOCK=$(echo "$CHECK" | $JQ '.height') echo "$j contains blockhash $(echo $i | cut -d':' -f1), TXID: $TRANSACTION" REDIS_NEW_PENDING="${i:0:65}"$TRANSACTION:$BLOCK:"${i:65}" + # do not insert data for the main mining chain if [[ "$(echo $j | $TR '[:upper:]' '[:lower:]')" != "$(echo $MAIN_CHAIN | $TR '[:upper:]' '[:lower:]')" ]] then $REDIS_CLI sadd $(echo $j | $TR '[:upper:]' '[:lower:]'):blocksPending $REDIS_NEW_PENDING 1>/dev/null @@ -148,6 +151,8 @@ do done done +# Temporarily store unknown blockhashes in the script folder +# ToDo: Needs storing to Redis UNKNOWN_HASHLIST=$($REDIS_CLI smembers $REDIS_NAME:pbaasPending | $CUT -d' ' -f2-) if [ -f $SCRIPT_DIR/unknown_hashlist.4 ] then @@ -175,3 +180,69 @@ do echo $i >> $SCRIPT_DIR/unknown_hashlist.1 done +for CHAIN in $ACTIVE_CHAINS +do + echo "Processing i-addresses on $CHAIN" + ALL_ADDRESSES=$($REDIS_CLI HSCAN $CHAIN:balances 0 COUNT 50000 | awk '{print $1}' | sed -n 'n;p' | sed 's/\..*//' | grep -e "^i.*" | sort | uniq) + while read -r ADDRESS; do + if [[ $ADDRESS == i* ]] + then + I_ADDRESS=$ADDRESS + BALANCES= + DONATIONS= + if [[ $($VERUS -chain=$CHAIN getidentity "$I_ADDRESS") ]] + then + echo "$I_ADDRESS exists on vARRR, no action needed." + else + ## Retrieve ID info from mainchain + ID_MAINCHAIN=$($VERUS getidentity "$I_ADDRESS") + # check if the ID exists on the main chain + if [[ $(echo $IDMAINCHAIN) == error* ]] + then + break # testing WTF is happening. + # Collect all address.worker entries for the i-address for move to donation address + echo "$I_ADDRESS balance is a donation on $CHAIN..." + DONATION_TMP=$($REDIS_CLI hscan $CHAIN:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') + if ! [ "$DONATION_TMP" == "" ] + then + DONATIONS=$DONATIONS$DONATION_TMP" " + while read OLD_ADDRESS + do + BALANCE=0 + NEW_ADDRESS=0 + tmp=(${OLD_ADDRESS//./ }) + addr=${tmp[0]} + NEW_ADDRESS=$(echo $OLD_ADDRESS | sed "s/${addr}/REpxm9bCLMiHRNVPA9unPBWixie7uHFA5C/g") + BALANCE=$($REDIS_CLI HGET $CHAIN:balances $OLD_ADDRESS) + $REDIS_CLI HDEL $CHAIN:balances $OLD_ADDRESS + $REDIS_CLI HINCBYFLOAT $CHAIN:balances $NEW_ADDRESS $BALANCE + done <<<$DONATIONS + fi + else + # Collect all address.worker entries for the i-address for move to R-address + BALANCES_TMP=$($REDIS_CLI hscan $CHAIN:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') + if ! [ "$BALANCES_TMP" == "" ] + then + BALANCES=$BALANCES$BALANCES_TMP" " + R_ADDRESS=$(echo $ID_MAINCHAIN | jq -r .identity.primaryaddresses[0]) + while read OLD_ADDRESS + do + tmp=(${OLD_ADDRESS//./ }) + addr=${tmp[0]} + NEW_ADDRESS=$(echo $OLD_ADDRESS | sed "s/${addr}/${R_ADDRESS}/g") + BALANCE=$($REDIS_CLI HGET $CHAIN:balances $OLD_ADDRESS) + $REDIS_CLI HDEL $CHAIN:balances $OLD_ADDRESS + $REDIS_CLI HINCRBYFLOAT $CHAIN:balances $NEW_ADDRESS $BALANCE + done <<<$BALANCES + fi + fi + fi + fi + done<<<$ALL_ADDRESSES +done + +rm /tmp/pbaascheck.pid + +# ToDo: add in mechanism to zero redis verus:shares:pbaasCurrent on a schedule (not every 15 minutes) + +#EOF \ No newline at end of file From 5fe69013c291caeb2a75b4d74223409be21ee683 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Fri, 5 Apr 2024 09:11:20 +0000 Subject: [PATCH 22/41] Get replacement address from s-nomp config for invalid i-addresses --- scripts/pbaascheck.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 510fd3878..3f5ea1e8b 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash ## ## © verus.io 2018-2024, released under MIT license ## Script written in 2023 by Oink.vrsc@ @@ -182,8 +182,10 @@ done for CHAIN in $ACTIVE_CHAINS do - echo "Processing i-addresses on $CHAIN" - ALL_ADDRESSES=$($REDIS_CLI HSCAN $CHAIN:balances 0 COUNT 50000 | awk '{print $1}' | sed -n 'n;p' | sed 's/\..*//' | grep -e "^i.*" | sort | uniq) + CHAINlc=$(echo $(echo $CHAIN | $TR '[:upper:]' '[:lower:]')) + INVALIDADDRESS=$(cat /home/pool/pool-payments/pool_configs/$CHAINlc.json | jq -r .invalidAddress) + echo "Processing i-addresses on $CHAIN. $INVALIDADDRESS used for nonexisting IDs" + ALL_ADDRESSES=$($REDIS_CLI HSCAN $CHAINlc:balances 0 COUNT 50000 | awk '{print $1}' | sed -n 'n;p' | sed 's/\..*//' | grep -e "^i.*" | sort | uniq) while read -r ADDRESS; do if [[ $ADDRESS == i* ]] then @@ -202,7 +204,7 @@ do break # testing WTF is happening. # Collect all address.worker entries for the i-address for move to donation address echo "$I_ADDRESS balance is a donation on $CHAIN..." - DONATION_TMP=$($REDIS_CLI hscan $CHAIN:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') + DONATION_TMP=$($REDIS_CLI hscan $CHAINlc:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') if ! [ "$DONATION_TMP" == "" ] then DONATIONS=$DONATIONS$DONATION_TMP" " @@ -212,15 +214,15 @@ do NEW_ADDRESS=0 tmp=(${OLD_ADDRESS//./ }) addr=${tmp[0]} - NEW_ADDRESS=$(echo $OLD_ADDRESS | sed "s/${addr}/REpxm9bCLMiHRNVPA9unPBWixie7uHFA5C/g") - BALANCE=$($REDIS_CLI HGET $CHAIN:balances $OLD_ADDRESS) - $REDIS_CLI HDEL $CHAIN:balances $OLD_ADDRESS - $REDIS_CLI HINCBYFLOAT $CHAIN:balances $NEW_ADDRESS $BALANCE + NEW_ADDRESS=$(echo $OLD_ADDRESS | sed "s/${addr}/${INVALIDADDRESS}/g") + BALANCE=$($REDIS_CLI HGET $CHAINlc:balances $OLD_ADDRESS) + $REDIS_CLI HDEL $CHAINlc:balances $OLD_ADDRESS + $REDIS_CLI HINCBYFLOAT $CHAINlc:balances $NEW_ADDRESS $BALANCE done <<<$DONATIONS fi else # Collect all address.worker entries for the i-address for move to R-address - BALANCES_TMP=$($REDIS_CLI hscan $CHAIN:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') + BALANCES_TMP=$($REDIS_CLI hscan $CHAINlc:balances 0 COUNT 40000 MATCH $ADDRESS* | awk 'NR % 2 == 0') if ! [ "$BALANCES_TMP" == "" ] then BALANCES=$BALANCES$BALANCES_TMP" " @@ -230,9 +232,9 @@ do tmp=(${OLD_ADDRESS//./ }) addr=${tmp[0]} NEW_ADDRESS=$(echo $OLD_ADDRESS | sed "s/${addr}/${R_ADDRESS}/g") - BALANCE=$($REDIS_CLI HGET $CHAIN:balances $OLD_ADDRESS) - $REDIS_CLI HDEL $CHAIN:balances $OLD_ADDRESS - $REDIS_CLI HINCRBYFLOAT $CHAIN:balances $NEW_ADDRESS $BALANCE + BALANCE=$($REDIS_CLI HGET $CHAINlc:balances $OLD_ADDRESS) + $REDIS_CLI HDEL $CHAINlc:balances $OLD_ADDRESS + $REDIS_CLI HINCRBYFLOAT $CHAINlc:balances $NEW_ADDRESS $BALANCE done <<<$BALANCES fi fi From 72ec3c2a4b7996ddc7929e1df4d62109a7963b07 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Sat, 6 Apr 2024 12:20:00 +0000 Subject: [PATCH 23/41] Include Redispass and share management --- scripts/pbaascheck.sh | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 3f5ea1e8b..5a809d9bc 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -17,8 +17,9 @@ fi VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client MAIN_CHAIN=VRSC # main hashing chain REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` -REDIS_HOST=162.55.8.164 # If you run this script on another system, alter the IP address of your Redis server +REDIS_HOST=127.0.0.1 # If you run this script on another system, alter the IP address of your Redis server REDIS_PORT=6379 # If you use a different REDIS port, alter the port accordingly +REDIS_PASS=examplepass # if your Redis database requires a password, set it here ## Set script folder SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" @@ -40,7 +41,14 @@ else fi -## Dependencies: jq, tr, cut, redis-cli/keydb-cli +## Dependencies: bc, jq, tr, cut, redis-cli/keydb-cli +## bc +if ! command -v bc &>/dev/null ; then + echo "jq not found. please install using your package manager." + exit 1 +else + BC=$(which bc) +fi ## jq if ! command -v jq &>/dev/null ; then echo "jq not found. please install using your package manager." @@ -68,9 +76,9 @@ if ! command -v redis-cli &>/dev/null ; then echo "Both redis-cli or keydb-cli not found. Please install one using your package manager." exit 1 fi - REDIS_CLI="$(which keydb-cli) -h $REDIS_HOST -p $REDIS_PORT" + REDIS_CLI="$(which keydb-cli) -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASS" else - REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT" + REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASS" fi ## Can we connect to Redis? @@ -243,8 +251,28 @@ do done<<<$ALL_ADDRESSES done -rm /tmp/pbaascheck.pid +WORKERSHAREREDUCTION= +## Retrieve data from REDIS +WORKERSHARES=$($REDIS_CLI HGETALL $REDIS_NAME:shares:pbaasCurrent) + +## if the value of shares is below two, remove the key from the database, otherwise substract 50% of the value +for LINE in $WORKERSHARES +do + if [[ "$LINE" =~ ^[0-9] ]] + then + if [[ "$LINE" < "2.00000000" ]] + then + $REDIS_CLI HDEL $REDIS_NAME:shares:pbaasCurrent "$WORKERSHAREREDUCTION" + else + REDUCTION=$(echo "scale=8;$LINE / 2" | $BC) + $REDIS_CLI HINCRBYFLOAT $REDIS_NAME:shares:pbaasCurrent "$WORKERSHAREREDUCTION" "-$REDUCTION" + fi + WORKERSHAREREDUCTION= + else + WORKERSHAREREDUCTION=$LINE + fi +done <<<$WORKERSHARES -# ToDo: add in mechanism to zero redis verus:shares:pbaasCurrent on a schedule (not every 15 minutes) +rm /tmp/pbaascheck.pid #EOF \ No newline at end of file From 192d375646c73c4581aec17109814fcf1bacd855 Mon Sep 17 00:00:00 2001 From: Oink Date: Sat, 6 Apr 2024 15:14:01 +0200 Subject: [PATCH 24/41] Update pbaascheck.sh using password on redis servers that have no password set, breaks connection --- scripts/pbaascheck.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 5a809d9bc..9ea6a7fd5 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -19,7 +19,6 @@ MAIN_CHAIN=VRSC # main hashing chain REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` REDIS_HOST=127.0.0.1 # If you run this script on another system, alter the IP address of your Redis server REDIS_PORT=6379 # If you use a different REDIS port, alter the port accordingly -REDIS_PASS=examplepass # if your Redis database requires a password, set it here ## Set script folder SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" @@ -76,9 +75,9 @@ if ! command -v redis-cli &>/dev/null ; then echo "Both redis-cli or keydb-cli not found. Please install one using your package manager." exit 1 fi - REDIS_CLI="$(which keydb-cli) -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASS" + REDIS_CLI="$(which keydb-cli) -h $REDIS_HOST -p $REDIS_PORT" else - REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASS" + REDIS_CLI="$(which redis-cli) -h $REDIS_HOST -p $REDIS_PORT" fi ## Can we connect to Redis? @@ -275,4 +274,4 @@ done <<<$WORKERSHARES rm /tmp/pbaascheck.pid -#EOF \ No newline at end of file +#EOF From 93a258e4c3b63047c80c34d07d188ff7b6a4fcf1 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Sun, 7 Apr 2024 07:51:32 +0000 Subject: [PATCH 25/41] Payment instance location is now a variable --- scripts/pbaascheck.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 9ea6a7fd5..c3ac50d0a 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -13,7 +13,8 @@ else touch /tmp/pbaascheck.pid fi -## default settings +## default settings (change where needed) +PAYMENT=/home/pool/payment # Change if you used a different location VERUS=/home/verus/bin/verus # complete path to (and including) the verus RPC client MAIN_CHAIN=VRSC # main hashing chain REDIS_NAME=verus # name you assigned the coin in `/home/pool/s-nomp/coins/*.json` @@ -190,7 +191,7 @@ done for CHAIN in $ACTIVE_CHAINS do CHAINlc=$(echo $(echo $CHAIN | $TR '[:upper:]' '[:lower:]')) - INVALIDADDRESS=$(cat /home/pool/pool-payments/pool_configs/$CHAINlc.json | jq -r .invalidAddress) + INVALIDADDRESS=$(cat $PAYMENT/pool_configs/$CHAINlc.json | jq -r .invalidAddress) echo "Processing i-addresses on $CHAIN. $INVALIDADDRESS used for nonexisting IDs" ALL_ADDRESSES=$($REDIS_CLI HSCAN $CHAINlc:balances 0 COUNT 50000 | awk '{print $1}' | sed -n 'n;p' | sed 's/\..*//' | grep -e "^i.*" | sort | uniq) while read -r ADDRESS; do From a2d8c889bb171494e45dc4ffefc343a7ae4c1985 Mon Sep 17 00:00:00 2001 From: Oink Date: Thu, 11 Apr 2024 10:45:11 +0200 Subject: [PATCH 26/41] Update vrsc.json Missed a comma --- pool_configs/examples/vrsc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool_configs/examples/vrsc.json b/pool_configs/examples/vrsc.json index af3fd906b..99f34c046 100644 --- a/pool_configs/examples/vrsc.json +++ b/pool_configs/examples/vrsc.json @@ -35,7 +35,7 @@ "paymentMode": "prop", "_comment_paymentMode":"prop, pplnt", "pplnt": 51, - "_comment_pplnt": "If pplnt is active and clients have mined less that this part, their shares are slashed." + "_comment_pplnt": "If pplnt is active and clients have mined less that this part, their shares are slashed.", "paymentInterval": 120, "_comment_paymentInterval": "Interval in seconds to check and perform payments.", "minimumPayment": 1, From 3f18ddced88da8cb7d61007ee146f0ccd53875d0 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 11:16:11 +0000 Subject: [PATCH 27/41] raise 1000 worker limit to 50k when counting shares. --- libs/stats.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/stats.js b/libs/stats.js index 61040376f..460ce666f 100644 --- a/libs/stats.js +++ b/libs/stats.js @@ -244,7 +244,7 @@ module.exports = function(logger, portalConfig, poolConfigs){ async.each(_this.stats.pools, function(pool, pcb) { pindex++; var coin = String(_this.stats.pools[pool.name].name); - client.hscan(coin + ':shares:roundCurrent', 0, "match", a+"*", "count", 1000, function(error, result) { + client.hscan(coin + ':shares:roundCurrent', 0, "match", a+"*", "count", 50000, function(error, result) { if (error) { pcb(error); return; @@ -290,11 +290,11 @@ module.exports = function(logger, portalConfig, poolConfigs){ async.each(_this.stats.pools, function(pool, pcb) { var coin = String(_this.stats.pools[pool.name].name); // get all immature balances from address - client.hscan(coin + ':immature', 0, "match", a+"*", "count", 10000, function(error, pends) { + client.hscan(coin + ':immature', 0, "match", a+"*", "count", 50000, function(error, pends) { // get all balances from address - client.hscan(coin + ':balances', 0, "match", a+"*", "count", 10000, function(error, bals) { + client.hscan(coin + ':balances', 0, "match", a+"*", "count", 50000, function(error, bals) { // get all payouts from address - client.hscan(coin + ':payouts', 0, "match", a+"*", "count", 10000, function(error, pays) { + client.hscan(coin + ':payouts', 0, "match", a+"*", "count", 50000, function(error, pays) { var workerName = ""; var balAmount = 0; From 79b44651092e6d8be57d85bab1cfde325648fddf Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 12:21:18 +0000 Subject: [PATCH 28/41] Add in api call worker_balances --- libs/api.js | 52 ++++++++++++++++++++++++++++++++++++- libs/stats.js | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/libs/api.js b/libs/api.js index 1b4161174..4c85a913d 100644 --- a/libs/api.js +++ b/libs/api.js @@ -23,7 +23,57 @@ module.exports = function(logger, portalConfig, poolConfigs){ res.end(JSON.stringify(portalStats.statPoolHistory)); return; case 'blocks': - case 'getblocksstats': + case 'worker_balances': + res.header('Content-Type', 'application/json'); + if (req.url.indexOf("?") > 0) { + var url_parms = req.url.split("?"); + if (url_parms.length > 0) { + var address = url_parms[1] || null; + if (address != null && address.length > 0) { + address = address.split(".")[0]; + //portalStats.getPoolBalancesByAddress(address, function(balances) { + // res.end(JSON.stringify(balances)); + //}); + portalStats.getPoolBalancesByAddress(address, function(balances) { + var formattedBalances = {}; + + balances.forEach(function (balance) { + if (!formattedBalances[balance.pool]) { + formattedBalances[balance.pool] = { + name: balance.pool, + totalPaid: 0, + totalBalance: 0, + totalImmature: 0, + workers: [] + }; + } + + formattedBalances[balance.pool].totalPaid += balance.paid; + formattedBalances[balance.pool].totalBalance += balance.balance; + formattedBalances[balance.pool].totalImmature += balance.immature; + + formattedBalances[balance.pool].workers.push({ + name: balance.worker, + balance: balance.balance, + paid: balance.paid, + immature: balance.immature + }); + }); + + var finalBalances = Object.values(formattedBalances); + res.end(JSON.stringify(finalBalances)); + }); + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid wallet address" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid URL parameters" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "URL parameters not found" })); + } + return; + case 'getblocksstats': portalStats.getBlocks(function(data){ res.header('Content-Type', 'application/json'); res.end(JSON.stringify(data)); diff --git a/libs/stats.js b/libs/stats.js index 460ce666f..e183b55fe 100644 --- a/libs/stats.js +++ b/libs/stats.js @@ -360,6 +360,78 @@ module.exports = function(logger, portalConfig, poolConfigs){ }); }; + this.getPoolBalancesByAddress = function(address, callback){ + var a = address.split(".")[0]; + + var client = redisClients[0].client, + coins = redisClients[0].coins, + poolBalances = []; + + async.each(_this.stats.pools, function(pool, pcb) { + var poolName = pool.name; + var coin = String(poolName); + + // get all immature balances from address + client.hscan(coin + ':immature', 0, "match", a + "*", "count", 10000, function(error, pends) { + // get all balances from address + client.hscan(coin + ':balances', 0, "match", a + "*", "count", 10000, function(error, bals) { + // get all payouts from address + client.hscan(coin + ':payouts', 0, "match", a + "*", "count", 10000, function(error, pays) { + + var workers = {}; + + // Process payouts + for (var i = 0; i < pays[1].length; i += 2) { + var workerName = String(pays[1][i]); + var paidAmount = parseFloat(pays[1][i + 1]); + + workers[workerName] = workers[workerName] || {}; + workers[workerName].paid = coinsRound(paidAmount); + } + + // Process balances + for (var j = 0; j < bals[1].length; j += 2) { + var workerName = String(bals[1][j]); + var balAmount = parseFloat(bals[1][j + 1]); + + workers[workerName] = workers[workerName] || {}; + workers[workerName].balance = coinsRound(balAmount); + } + + // Process immature balances + for (var k = 0; k < pends[1].length; k += 2) { + var workerName = String(pends[1][k]); + var pendingAmount = parseFloat(pends[1][k + 1]); + + workers[workerName] = workers[workerName] || {}; + workers[workerName].immature = coinsRound(pendingAmount); + } + + // Push balances for each worker to the poolBalances array + for (var worker in workers) { + poolBalances.push({ + pool: poolName, + worker: worker, + balance: workers[worker].balance || 0, + paid: workers[worker].paid || 0, + immature: workers[worker].immature || 0 + }); + } + + pcb(); + }); + }); + }); + }, function(err) { + if (err) { + callback("There was an error getting balances"); + return; + } + + callback(poolBalances); + }); + }; + this.getGlobalStats = function(callback){ var statGatherTime = Date.now() / 1000 | 0; From ef4dbf36dd8da582e1714a129f0d7624984344c3 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 14:37:09 +0000 Subject: [PATCH 29/41] show all balances on the miner statictics pages --- libs/api.js | 109 +++++++++++++-------------- libs/stats.js | 58 +++++++------- website/pages/miner_stats.html | 133 ++++++++++++++++++++++++++------- 3 files changed, 186 insertions(+), 114 deletions(-) diff --git a/libs/api.js b/libs/api.js index 4c85a913d..84a0f90f3 100644 --- a/libs/api.js +++ b/libs/api.js @@ -23,62 +23,59 @@ module.exports = function(logger, portalConfig, poolConfigs){ res.end(JSON.stringify(portalStats.statPoolHistory)); return; case 'blocks': - case 'worker_balances': - res.header('Content-Type', 'application/json'); - if (req.url.indexOf("?") > 0) { - var url_parms = req.url.split("?"); - if (url_parms.length > 0) { - var address = url_parms[1] || null; - if (address != null && address.length > 0) { - address = address.split(".")[0]; - //portalStats.getPoolBalancesByAddress(address, function(balances) { - // res.end(JSON.stringify(balances)); - //}); - portalStats.getPoolBalancesByAddress(address, function(balances) { - var formattedBalances = {}; - - balances.forEach(function (balance) { - if (!formattedBalances[balance.pool]) { - formattedBalances[balance.pool] = { - name: balance.pool, - totalPaid: 0, - totalBalance: 0, - totalImmature: 0, - workers: [] - }; - } - - formattedBalances[balance.pool].totalPaid += balance.paid; - formattedBalances[balance.pool].totalBalance += balance.balance; - formattedBalances[balance.pool].totalImmature += balance.immature; - - formattedBalances[balance.pool].workers.push({ - name: balance.worker, - balance: balance.balance, - paid: balance.paid, - immature: balance.immature - }); - }); - - var finalBalances = Object.values(formattedBalances); - res.end(JSON.stringify(finalBalances)); - }); - } else { - res.end(JSON.stringify({ result: "error", message: "Invalid wallet address" })); - } - } else { - res.end(JSON.stringify({ result: "error", message: "Invalid URL parameters" })); - } - } else { - res.end(JSON.stringify({ result: "error", message: "URL parameters not found" })); - } - return; - case 'getblocksstats': - portalStats.getBlocks(function(data){ - res.header('Content-Type', 'application/json'); - res.end(JSON.stringify(data)); - }); - break; + case 'worker_balances': + res.header('Content-Type', 'application/json'); + if (req.url.indexOf("?") > 0) { + var url_parms = req.url.split("?"); + if (url_parms.length > 0) { + var address = url_parms[1] || null; + if (address != null && address.length > 0) { + address = address.split(".")[0]; + //portalStats.getPoolBalancesByAddress(address, function(balances) { + // res.end(JSON.stringify(balances)); + //}); + portalStats.getPoolBalancesByAddress(address, function(balances) { + var formattedBalances = {}; + + balances.forEach(function (balance) { + if (!formattedBalances[balance.pool]) { + formattedBalances[balance.pool] = { + name: balance.pool, + totalPaid: 0, + totalBalance: 0, + totalImmature: 0, + workers: [] + }; + } + + formattedBalances[balance.pool].totalPaid += balance.paid; + formattedBalances[balance.pool].totalBalance += balance.balance; + formattedBalances[balance.pool].totalImmature += balance.immature; + + formattedBalances[balance.pool].workers.push({ + name: balance.worker, + balance: balance.balance, + paid: balance.paid, + immature: balance.immature + }); + formattedBalances[balance.pool].totalPaid = (Math.round(formattedBalances[balance.pool].totalPaid * 100000000) / 100000000); + formattedBalances[balance.pool].totalBalance = (Math.round(formattedBalances[balance.pool].totalBalance * 100000000) / 100000000); + formattedBalances[balance.pool].totalImmature = (Math.round(formattedBalances[balance.pool].totalImmature * 100000000) / 100000000); + }); + + var finalBalances = Object.values(formattedBalances); + res.end(JSON.stringify(finalBalances)); + }); + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid wallet address" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid URL parameters" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "URL parameters not found" })); + } + return; case 'payments': var poolBlocks = []; for(var pool in portalStats.stats.pools) { diff --git a/libs/stats.js b/libs/stats.js index e183b55fe..973e51522 100644 --- a/libs/stats.js +++ b/libs/stats.js @@ -277,32 +277,32 @@ module.exports = function(logger, portalConfig, poolConfigs){ this.getBalanceByAddress = function(address, cback){ - var a = address.split(".")[0]; - + var a = address.split(".")[0]; + var client = redisClients[0].client, coins = redisClients[0].coins, balances = []; - - var totalHeld = parseFloat(0); - var totalPaid = parseFloat(0); + + var totalHeld = parseFloat(0); + var totalPaid = parseFloat(0); var totalImmature = parseFloat(0); - - async.each(_this.stats.pools, function(pool, pcb) { - var coin = String(_this.stats.pools[pool.name].name); - // get all immature balances from address - client.hscan(coin + ':immature', 0, "match", a+"*", "count", 50000, function(error, pends) { + + async.each(_this.stats.pools, function(pool, pcb) { + var coin = String(_this.stats.pools[pool.name].name); + // get all immature balances from address + client.hscan(coin + ':immature', 0, "match", a+"*", "count", 50000, function(error, pends) { // get all balances from address client.hscan(coin + ':balances', 0, "match", a+"*", "count", 50000, function(error, bals) { // get all payouts from address client.hscan(coin + ':payouts', 0, "match", a+"*", "count", 50000, function(error, pays) { - + var workerName = ""; var balAmount = 0; var paidAmount = 0; var pendingAmount = 0; - + var workers = {}; - + for (var i in pays[1]) { if (Math.abs(i % 2) != 1) { workerName = String(pays[1][i]); @@ -333,7 +333,7 @@ module.exports = function(logger, portalConfig, poolConfigs){ totalImmature += pendingAmount; } } - + for (var w in workers) { balances.push({ worker:String(w), @@ -342,23 +342,23 @@ module.exports = function(logger, portalConfig, poolConfigs){ immature:workers[w].immature }); } - + pcb(); }); }); }); - }, function(err) { - if (err) { - callback("There was an error getting balances"); - return; - } - - _this.stats.balances = balances; - _this.stats.address = address; + }, function(err) { + if (err) { + callback("There was an error getting balances"); + return; + } - cback({totalHeld:coinsRound(totalHeld), totalPaid:coinsRound(totalPaid), totalImmature:satoshisToCoins(totalImmature), balances}); - }); - }; + _this.stats.balances = balances; + _this.stats.address = address; + + cback({totalHeld:coinsRound(totalHeld), totalPaid:coinsRound(totalPaid), totalImmature:satoshisToCoins(totalImmature), balances}); + }); + }; this.getPoolBalancesByAddress = function(address, callback){ var a = address.split(".")[0]; @@ -372,11 +372,11 @@ module.exports = function(logger, portalConfig, poolConfigs){ var coin = String(poolName); // get all immature balances from address - client.hscan(coin + ':immature', 0, "match", a + "*", "count", 10000, function(error, pends) { + client.hscan(coin + ':immature', 0, "match", a + "*", "count", 50000, function(error, pends) { // get all balances from address - client.hscan(coin + ':balances', 0, "match", a + "*", "count", 10000, function(error, bals) { + client.hscan(coin + ':balances', 0, "match", a + "*", "count", 50000, function(error, bals) { // get all payouts from address - client.hscan(coin + ':payouts', 0, "match", a + "*", "count", 10000, function(error, pays) { + client.hscan(coin + ':payouts', 0, "match", a + "*", "count", 50000, function(error, pays) { var workers = {}; diff --git a/website/pages/miner_stats.html b/website/pages/miner_stats.html index 5349f9b97..0fd65c13b 100644 --- a/website/pages/miner_stats.html +++ b/website/pages/miner_stats.html @@ -1,9 +1,9 @@
- -
{{=String(it.stats.address).split(".")[0]}}
-
... (Avg)
-
... (Now)
-
Luck ... Days
-
-
-
-
Shares: ...
-
Immature: ...
-
Bal: ...
-
Paid: ...
-
+ +
{{=String(it.stats.address).split(".")[0]}}
+
... (Avg)
+
... (Now)
+
Luck ... Days
+
+
+
+
Shares: ...
+
+
+ + +
+
+
+
Pool Balances

+
+
+ +
From f85048aec41570a2a219d15c4f0164ba14332c9d Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 15:16:01 +0000 Subject: [PATCH 30/41] convert satoshi to coins for immatire balances --- libs/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/stats.js b/libs/stats.js index 973e51522..5879bef99 100644 --- a/libs/stats.js +++ b/libs/stats.js @@ -329,7 +329,7 @@ module.exports = function(logger, portalConfig, poolConfigs){ workers[workerName] = (workers[workerName] || {}); } else { pendingAmount = parseFloat(pends[1][b]); - workers[workerName].immature = coinsRound(pendingAmount); + workers[workerName].immature = coinsRound(satoshisToCoins(pendingAmount)); totalImmature += pendingAmount; } } From be08602571e8dadc6dd7937a89e4429ad9cebe9e Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 19:39:27 +0000 Subject: [PATCH 31/41] Only show pools with active workers --- website/pages/workers.html | 74 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/website/pages/workers.html b/website/pages/workers.html index 27f6378f4..f28fd68d3 100644 --- a/website/pages/workers.html +++ b/website/pages/workers.html @@ -52,43 +52,45 @@ {{ function capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)} }} {{ var i=0; for(var pool in it.stats.pools) { }} -
-
-
- - Miner Lookup: - - - - - - - {{=capitalizeFirstLetter(it.stats.pools[pool].name)}} Top Miners    - {{=it.stats.pools[pool].minerCount}} Miners    - {{=it.stats.pools[pool].workerCount}} Workers    - {{=it.stats.pools[pool].shareCount}} Shares -
-
- - - - - - - - - - {{ for(var worker in it.stats.pools[pool].miners) { }} - {{var workerstat = it.stats.pools[pool].miners[worker];}} - - - - - +{{ if (it.stats.pools[pool].minerCount > 0) { }} +
+
+
+ + Miner Lookup: + + + + + + + {{=capitalizeFirstLetter(it.stats.pools[pool].name)}} Top Miners    + {{=it.stats.pools[pool].minerCount}} Miners    + {{=it.stats.pools[pool].workerCount}} Workers    + {{=it.stats.pools[pool].shareCount}} Shares +
+
+
AddressSharesEfficiencyHashrate
{{=worker}}{{=Math.round(workerstat.currRoundShares * 100) / 100}}{{? workerstat.shares > 0}} {{=Math.floor(10000 * workerstat.shares / (workerstat.shares + workerstat.invalidshares)) / 100}}% {{??}} 0% {{?}}{{=workerstat.hashrateString}}
+ + + + + + - {{ } }} -
AddressSharesEfficiencyHashrate
+ + {{ for(var worker in it.stats.pools[pool].miners) { }} + {{var workerstat = it.stats.pools[pool].miners[worker];}} + + {{=worker}} + {{=Math.round(workerstat.currRoundShares * 100) / 100}} + {{? workerstat.shares > 0}} {{=Math.floor(10000 * workerstat.shares / (workerstat.shares + workerstat.invalidshares)) / 100}}% {{??}} 0% {{?}} + {{=workerstat.hashrateString}} + + {{ } }} + +
- +{{ } }} {{ } }} From f36a12618d68c1d36a0d461ca20b29a0dc4db74d Mon Sep 17 00:00:00 2001 From: Oink70 Date: Thu, 11 Apr 2024 19:52:21 +0000 Subject: [PATCH 32/41] Mention worker_balances api opn the api page. --- website/pages/api.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/pages/api.html b/website/pages/api.html index 1fdb5889a..719bc9fa9 100644 --- a/website/pages/api.html +++ b/website/pages/api.html @@ -7,7 +7,9 @@
  • /pool_stats - historical stats
  • /payments - payment history
  • /worker_stats?taddr - historical time per pool json
  • +
  • /worker_balances?taddr - balance per pool json
  • /live_stats - live stats
  • + From 127ff036a80510067cade2d93bab7e951e1364aa Mon Sep 17 00:00:00 2001 From: uncharted9898 <93306735+uncharted9898@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:42:01 -0400 Subject: [PATCH 33/41] Resolve lack /api/blocks Missed the break in getblockstats joining blocks/getblockstats as two api methods to resolve one command which is portalStats.getBlocks --- libs/api.js | 112 +++++++++++++++++++++++++++------------------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/libs/api.js b/libs/api.js index 84a0f90f3..6487ad817 100644 --- a/libs/api.js +++ b/libs/api.js @@ -23,59 +23,65 @@ module.exports = function(logger, portalConfig, poolConfigs){ res.end(JSON.stringify(portalStats.statPoolHistory)); return; case 'blocks': - case 'worker_balances': - res.header('Content-Type', 'application/json'); - if (req.url.indexOf("?") > 0) { - var url_parms = req.url.split("?"); - if (url_parms.length > 0) { - var address = url_parms[1] || null; - if (address != null && address.length > 0) { - address = address.split(".")[0]; - //portalStats.getPoolBalancesByAddress(address, function(balances) { - // res.end(JSON.stringify(balances)); - //}); - portalStats.getPoolBalancesByAddress(address, function(balances) { - var formattedBalances = {}; - - balances.forEach(function (balance) { - if (!formattedBalances[balance.pool]) { - formattedBalances[balance.pool] = { - name: balance.pool, - totalPaid: 0, - totalBalance: 0, - totalImmature: 0, - workers: [] - }; - } - - formattedBalances[balance.pool].totalPaid += balance.paid; - formattedBalances[balance.pool].totalBalance += balance.balance; - formattedBalances[balance.pool].totalImmature += balance.immature; - - formattedBalances[balance.pool].workers.push({ - name: balance.worker, - balance: balance.balance, - paid: balance.paid, - immature: balance.immature - }); - formattedBalances[balance.pool].totalPaid = (Math.round(formattedBalances[balance.pool].totalPaid * 100000000) / 100000000); - formattedBalances[balance.pool].totalBalance = (Math.round(formattedBalances[balance.pool].totalBalance * 100000000) / 100000000); - formattedBalances[balance.pool].totalImmature = (Math.round(formattedBalances[balance.pool].totalImmature * 100000000) / 100000000); - }); - - var finalBalances = Object.values(formattedBalances); - res.end(JSON.stringify(finalBalances)); - }); - } else { - res.end(JSON.stringify({ result: "error", message: "Invalid wallet address" })); - } - } else { - res.end(JSON.stringify({ result: "error", message: "Invalid URL parameters" })); - } - } else { - res.end(JSON.stringify({ result: "error", message: "URL parameters not found" })); - } - return; + case 'getblocksstats': + portalStats.getBlocks(function(data){ + res.header('Content-Type', 'application/json'); + res.end(JSON.stringify(data)); + }); + break; + case 'worker_balances': + res.header('Content-Type', 'application/json'); + if (req.url.indexOf("?") > 0) { + var url_parms = req.url.split("?"); + if (url_parms.length > 0) { + var address = url_parms[1] || null; + if (address != null && address.length > 0) { + address = address.split(".")[0]; + //portalStats.getPoolBalancesByAddress(address, function(balances) { + // res.end(JSON.stringify(balances)); + //}); + portalStats.getPoolBalancesByAddress(address, function(balances) { + var formattedBalances = {}; + + balances.forEach(function (balance) { + if (!formattedBalances[balance.pool]) { + formattedBalances[balance.pool] = { + name: balance.pool, + totalPaid: 0, + totalBalance: 0, + totalImmature: 0, + workers: [] + }; + } + + formattedBalances[balance.pool].totalPaid += balance.paid; + formattedBalances[balance.pool].totalBalance += balance.balance; + formattedBalances[balance.pool].totalImmature += balance.immature; + + formattedBalances[balance.pool].workers.push({ + name: balance.worker, + balance: balance.balance, + paid: balance.paid, + immature: balance.immature + }); + formattedBalances[balance.pool].totalPaid = (Math.round(formattedBalances[balance.pool].totalPaid * 100000000) / 100000000); + formattedBalances[balance.pool].totalBalance = (Math.round(formattedBalances[balance.pool].totalBalance * 100000000) / 100000000); + formattedBalances[balance.pool].totalImmature = (Math.round(formattedBalances[balance.pool].totalImmature * 100000000) / 100000000); + }); + + var finalBalances = Object.values(formattedBalances); + res.end(JSON.stringify(finalBalances)); + }); + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid wallet address" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "Invalid URL parameters" })); + } + } else { + res.end(JSON.stringify({ result: "error", message: "URL parameters not found" })); + } + return; case 'payments': var poolBlocks = []; for(var pool in portalStats.stats.pools) { From 88446bb1436248a74e8e7d72208716976335d989 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Mon, 22 Apr 2024 08:40:22 +0000 Subject: [PATCH 34/41] show coin on payments page --- website/pages/payments.html | 1 + 1 file changed, 1 insertion(+) diff --git a/website/pages/payments.html b/website/pages/payments.html index af1f318f0..bab582f61 100644 --- a/website/pages/payments.html +++ b/website/pages/payments.html @@ -66,6 +66,7 @@ {{ for(var p in it.stats.pools[pool].payments) { }} +

    {{=it.stats.pools[pool].symbol}} payments

    {{ if (it.poolsConfigs[pool].coin.explorer && it.poolsConfigs[pool].coin.explorer.txURL) { }} From 3eca5cbbb8caea89b56ac0718e5ab7ac0ac89d58 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 30 Apr 2024 13:42:00 +0000 Subject: [PATCH 35/41] Avoid script not firing if PID file doesn't get cleared for any reason --- scripts/pbaascheck.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index c3ac50d0a..2fe38f4e8 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -7,8 +7,16 @@ # check if script is already running if [ -f /tmp/pbaascheck.pid ] then - echo "script is already running" - exit 1 + PID_TIME=$(stat -c '%W' /tmp/pbaascheck.pid) + CUR_TIME=$(date +%s) + PID_AGE=$(echo "$CUR_TIME - $PID_TIME" | bc) + if [[ $PID_AGE <= 3600 ]] + then + echo "script is already running" + exit 1 + else + echo "script has apparently aborted before removing /tmp/pbaascheck.pid, continuing" + fi else touch /tmp/pbaascheck.pid fi From a5d3fcb3609d67d2c3443b4e33f5ac004af86668 Mon Sep 17 00:00:00 2001 From: Oink70 Date: Tue, 30 Apr 2024 13:43:47 +0000 Subject: [PATCH 36/41] remove unnecessary database copy and use correct share key --- scripts/pbaascheck.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 2fe38f4e8..6698f6fbe 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -111,7 +111,7 @@ fi ## Return a list of found PBaaS hashes: HASHLIST=$($REDIS_CLI smembers $REDIS_NAME:pbaasPending | $CUT -d' ' -f2-) ## return a list on found shares per miner -SHARELIST=$($REDIS_CLI hgetall $REDIS_NAME:shares:roundCurrent| $CUT -d' ' -f2-) +SHARELIST=$($REDIS_CLI hgetall $REDIS_NAME:shares:pbaasCurrent| $CUT -d' ' -f2-) ## get list of active chains in ecosystem PBAAS_CHAINS=$($VERUS -chain=$MAIN_CHAIN listcurrencies '{"systemtype":"pbaas"}' | jq --arg MAIN_CHAIN "${MAIN_CHAIN}" -r '.[].currencydefinition | select (.name != "$MAIN_CHAIN") | .name') ## determine chains active on this system @@ -129,16 +129,6 @@ do done ACTIVE_CHAINS=$(echo $ACTIVE_CHAINS | sed 's/VRSC//g'); -## copy shares -for j in $ACTIVE_CHAINS -do - # Do not insert data for the main mining chain - if [[ "$(echo $j | $TR '[:upper:]' '[:lower:]')" != "$(echo $MAIN_CHAIN | $TR '[:upper:]' '[:lower:]')" ]] - then - $REDIS_CLI hset $(echo $j | $TR '[:upper:]' '[:lower:]'):shares:roundCurrent $SHARELIST 1>/dev/null - fi -done - ## Check each hash on all chains for i in $HASHLIST do From c1aa1de0490c9d16cd4e6d25cbd59e35e09b7e91 Mon Sep 17 00:00:00 2001 From: Oink Date: Wed, 1 May 2024 07:17:59 +0200 Subject: [PATCH 37/41] Update pbaascheck.sh --- scripts/pbaascheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pbaascheck.sh b/scripts/pbaascheck.sh index 6698f6fbe..351ac7356 100755 --- a/scripts/pbaascheck.sh +++ b/scripts/pbaascheck.sh @@ -10,7 +10,7 @@ then PID_TIME=$(stat -c '%W' /tmp/pbaascheck.pid) CUR_TIME=$(date +%s) PID_AGE=$(echo "$CUR_TIME - $PID_TIME" | bc) - if [[ $PID_AGE <= 3600 ]] + if [[ $PID_AGE -le 3600 ]] then echo "script is already running" exit 1 From 23a2026e816bfb27fec0803285b53fa4aebe066d Mon Sep 17 00:00:00 2001 From: Oink70 Date: Sun, 8 Sep 2024 12:50:27 +0000 Subject: [PATCH 38/41] Add option for address banning --- config_example.json | 9 +++++++++ libs/poolWorker.js | 26 +++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/config_example.json b/config_example.json index 52d28f631..d25bd57e0 100644 --- a/config_example.json +++ b/config_example.json @@ -24,6 +24,15 @@ "checkThreshold": 500, "purgeInterval": 300 }, + "bannedAddresses": { + "enabled": false, + "banned": [ + "banned address 1", + "banned address 2", + "etcetera" + ] + }, + "redis": { "_disabled_socket": "/var/run/redis/redis.sock", "_socket": "Set socket to enable UNIX domain sockets, otherwise leave unset and set host and port.", diff --git a/libs/poolWorker.js b/libs/poolWorker.js index b4bfe8ca0..1bc0a22e9 100644 --- a/libs/poolWorker.js +++ b/libs/poolWorker.js @@ -135,19 +135,23 @@ module.exports = function(logger){ var shareProcessor = new ShareProcessor(logger, poolOptions); handlers.auth = function(port, workerName, password, authCallback){ - if (poolOptions.validateWorkerUsername !== true) - authCallback(true); - else { - //Validation of Public and Identity addresses - var isvalid = WAValidator.validate(String(workerName).split(".")[0], 'VRSC'); + if (poolOptions.bannedAddresses.banned.indexOf(workerName) !== -1 && poolOptions.bannedAddresses.enabled == true) { + //Banned addresses return false if that option is enabled + isvalid = false; + } else if (poolOptions.validateWorkerUsername !== true) { + //Addresses are not checked for validity + isvalid = true; + } else { + //Validation of Public and Identity addresses + var isvalid = WAValidator.validate(String(workerName).split(".")[0], 'VRSC'); /* - //Validation of sapling addreses (disabled until paymentProcessor.js can handle sapling payments) - if(isvalid !== true){ - var isvalid = WAValidator.validate(String(address).split(".")[0], 'VRSC', 'sapling'); - } -*/ - authCallback(isvalid); + //Validation of sapling addreses (disabled until paymentProcessor.js can handle sapling payments) + if(isvalid !== true){ + var isvalid = WAValidator.validate(String(address).split(".")[0], 'VRSC', 'sapling'); } +*/ + } + authCallback(isvalid); }; handlers.share = function(isValidShare, isValidBlock, data){ From 315be63d7ed03667b3a44cc0e317dfa68fa61a17 Mon Sep 17 00:00:00 2001 From: Oink Date: Tue, 28 Oct 2025 11:56:09 +0100 Subject: [PATCH 39/41] Update package.json Changed bitgo-utx-lib download source to https://github.com/Oink70/bitgo-utxo-lib, because of unavailability of nested dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd24a7a09..0bc314962 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "dependencies": { "async": "^2.6.1", "bignum": "^0.13.0", - "bitgo-utxo-lib": "git+https://github.com/VerusCoin/bitgo-utxo-lib.git", + "bitgo-utxo-lib": "git+https://github.com/Oink70/bitgo-utxo-lib.git", "body-parser": "^1.18.3", "colors": "^1.3.2", "compression": "^1.7.3", From 42a0c09bc2901090fa3571b11b0300b155ef1dd7 Mon Sep 17 00:00:00 2001 From: Oink Date: Tue, 28 Oct 2025 12:03:44 +0100 Subject: [PATCH 40/41] Update package.json Changed source for `stratum-pool` due to nested dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bc314962..dd2cedafb 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "pm2": "^3.2.2", "redis": "^3.0.0", "request": "^2.88.0", - "stratum-pool": "git+https://github.com/VerusCoin/node-stratum-pool.git", + "stratum-pool": "git+https://github.com/Oink70/node-stratum-pool.git", "wallet-address-validator": "git+https://github.com/Oink70/wallet-address-validator.git#cf7835d1a569eed6fa98dd3d4aa4cd287bb59623", "jssha": "^2.3.1" }, From de50d5690a7b85708f41be50b6ed419509aa170d Mon Sep 17 00:00:00 2001 From: Oink Date: Tue, 28 Oct 2025 20:10:50 +0100 Subject: [PATCH 41/41] Update package.json Reflect the current node version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd2cedafb..332e5efb5 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "jssha": "^2.3.1" }, "engines": { - "node": ">=8.11" + "node": "10" }, "scripts": { "start": "NODE_PATH=$NODE_PATH:$PWD/node_modules/verushash/build/Release/:$PWD/node_modules/stratum-pool/node_modules/verushash/build/Release/ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/node_modules/stratum-pool/node_modules/equihashverify/build/Release/:$PWD/node_modules/equihashverify/build/Release/:$PWD/node_modules/verushash/build/Release/:$PWD/node_modules/stratum-pool/node_modules/verushash/build/Release/ node init.js"