moneroocean / nodejs-pool Goto Github PK
View Code? Open in Web Editor NEWThis project forked from snipa22/nodejs-pool
Official repository of MoneroOcean (XMR) mining pool
Home Page: https://moneroocean.stream
License: Other
This project forked from snipa22/nodejs-pool
Official repository of MoneroOcean (XMR) mining pool
Home Page: https://moneroocean.stream
License: Other
When viewing your workers from the dashboard, it would a nice feature to allow users to sort their workers by name, hash rate, or total hashes.
It would be nice to see the profitability of the altcoins in the page. We know that the pool auto-switches to them when they are at least 20% more profitable than XMR but we don't know the actual percentage when it happens. It is just good to know that we are switching to GRFT for example because it is 50% more profitable.
Hello,
When testing nodejs-pool with algo CN/2, the resultHash does not seem to match the user provided hash. However, it does seem to work with killallasics.moneroworld.com (cryptonote universal).
Can't quite pin down where the issue stems from, as the new cryptonight hashing does seem to convert blobs properly in it's v2 tests.
May it can be better don't add with incorrect email
let filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(pass_split[1])) {
return;
}
Line 339 in 9e81883
Title says it all. Due to this, shares are reporting incorrectly and block cleaner does not work.
It would be amazing to see workers still there on the user interface for maybe 24 hours after they stopped. Just to be visible at 0 H/S, instead of invisible.
Hi,
after first run deploy.sh
, those API:
keep telling:
TypeError: Cannot create property 'fee' on boolean 'false'
at /home/username/nodejs-pool/lib/api.js:248:28
at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
at next (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:131:13)
at makeResponseCacheable (/home/username/nodejs-pool/node_modules/apicache/src/apicache.js:207:5)
at cache (/home/username/nodejs-pool/node_modules/apicache/src/apicache.js:438:16)
at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
at next (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
at /home/username/nodejs-pool/node_modules/express/lib/router/index.js:277:22
at param (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:349:14)
at param (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:410:3)
at next (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:271:10)
at jsonParser (/home/username/nodejs-pool/node_modules/body-parser/lib/types/json.js:110:7)
at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
I've check the code, it seen not get the db cache on /api.js
line 248,
global.database.getCache('pool_stats_pplns')
which returns a false
value.
Do I miss some configs value in database pool.config or config.json something ?
And, API /leafApi
also return a 502 Bad Gateway
.
Thanks for help.
I’d like to have email merge feature so the miners will receive payments report once or twice per day (with payments and time of that payments). It’s mainly for small shit coins that low hashrate miners receive many payments.
Thanks MoneroOcean.
Very low priority ( I can disable or make payment interval higher to reduce emails as a workaround)
Hi - on trying your fork the pool
modules errors with:
2017-12-27 14:06 -05:00: Can't open wallet_trust_1 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_2 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_3 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_4 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_5 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_6 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_7 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_8 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_1 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_2 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_3 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_4 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_5 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_6 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_7 file
2017-12-27 14:06 -05:00: Can't open wallet_trust_8 file
Using your most recent commit of 2e32924
Any thoughts?
When you select one of more workers in the list below the chart, the chart updates to show the hashrates of selected workers. But the Chart Average Hash Rate remains to show the average of the total of all workers (see image below).
It would be helpful if this also updates to show the average of the selected workers.
Longrunner will not scan past a very old block, no idea why. I have tried locking, unlocking, etc.
hi guys
if i try to change the transfer func to transfer_split here is the answer ai am getting from the wallet.
11|payment | 2018-07-08 13:09:33:985 +03:00: Unknown error from the wallet: {"amount_list":[1617070000000],"fee_list":[137045640],"multisig_txset":"","tx_hash_list":["a337f500c9b56f8deecc40ebf318f2b184910060f5a1b0e30e75f87ae7c702c9"]}
what could be the issue?
Hi MonerOcean,
When you have time, could you please take a look at the Snipa's code to see why we got longRunner errors :
nodejs-pool/lib/local_comms.js :
function (lastBlock, difficulty, callback) {
let shareCount = 0;
let pplnsFound = false;
let blockList = [];
console.log("Scanning from: "+lastBlock + " for more than: " + difficulty + " shares");
range.range(0, lastBlock+1).forEach(function (blockID) {
blockID = (blockID - lastBlock+1) * -1;
if (blockID < 0){
return;
}
debug("Scanning block: " + blockID);
let txn = global.database.env.beginTxn({readOnly: true});
let cursor = new global.database.lmdb.Cursor(txn, global.database.shareDB);
for (let found = (cursor.goToRange(blockID) === blockID); found; found = cursor.goToNextDup()) {
if (pplnsFound){
The tweak that doesn't work : blockID = Number((blockID - lastBlock+1) * -1);
The tweak that works : cursor.goToRange(parseInt(blockID))
Error message : Error: You specified keyIsUint32 on the Dbi, so you can't use other key types with it.
at /home/monero/nodejs-pool/lib/local_comms.js:638:46
at Array.forEach () ....
Snipa is busy at the moment. I hope you can help. Thank you.
Hi,
I would like to see a true profit switching pool, meaning only miners with profit switching configured will be on the pool. Also on this separate pool (port) I would like to see algo switch based on true profits without giving xmr 10% advantage. Everyone on the pool would mine the most profitable coin and share the rewards.
Thank you!
It would be nice if the blocks page
https://moneroocean.stream/#/blocks
defaulted to a tab that showed a list of all coins that have been mined. Similar to the ALT-COINS tab but with XMR included. This would offer some insight on how the pool is moving to each coin.
Hello :) I forked Aeon and have everything running. Pool runs okay, can find blocks, balances change. I have one last problem that I cannot solve.
No matter what I put for the balances or payments it always fails with
This is the output from the wallet
2018-06-18 13:58:45.853 [RPC0] ERROR wallet.wallet2 src/wallet/wallet2.cpp:6315 !scanty_outs.empty(). THROW EXCEPTION: error::not_enough_outs_to_mix
2018-06-18 13:58:45.868 [RPC0] WARN net.http src/wallet/wallet_errors.h:794 /home/pooldaemon/durinscoin/src/wallet/wallet2.cpp:6315:N5tools5error22not_enough_outs_to_mixE: not enough outputs to use, ring size = 2, scanty_outs:
9.000000000000 - 1
0.800000000000 - 1
0.600000000000 - 1
70.000000000000 - 1
0.020000000000 - 1
Payments module error
payments > 2018-06-19 13:00 +00:00: Issue making payments{"code":-19,"message":"not enough outputs to use Please use sweep_dust."}
payments > Will not make more payments until the payment daemon is restarted!
I tried to do sweep_unmixable in pools wallet and sweep_all 1 mywallet to get it to work but nothing helps.
I am not sure if it something to do with the coin or the pool isn't set up to send that many coins or something?
I set the max coins per transaction to something really low and have 1 payee per and still not enough output errors
Have over 10,000 coins in the wallet from 70 per block reward and I just cannot get coins to send.
Not sure if this is the best place to ask?
Is this something I need to fix with the coin or does anyone know of a workaround some how?
I am going to try send all the coins from the pool wallet to a new one and see if that works from there.
But even so when a new pool opens, they are never going to be able to make payouts.
How are outputs made? This is blockchain starting from height 0 not a real fork.
Options window automatically minimises after entering password. Make it stay open as this causes some confusion, as seen in discord chat ;)
Hi guys,
this is my first time try to deploy the pool on server, then I got the 502 error response from API endpoint and login endpoint, after running the deploy script. Check the pm2 error logs, what it says as below. How to fix it ?
Error: No such file or directory
at Database.initEnv (/home/pooluser/nodejs-pool/lib/local_comms.js:29:29)
at /home/pooluser/nodejs-pool/init.js:54:21
at tryCatcher (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/pooluser/nodejs-pool/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
2018-07-27 13:44 +00:00: TypeError: Cannot read property 'split' of undefined
at new Miner (/home/pooldaemon/nodejs-pool/lib/pool.js:264:27)
at handleMinerData (/home/pooldaemon/nodejs-pool/lib/pool.js:898:21)
at handleMessage (/home/pooldaemon/nodejs-pool/lib/pool.js:1188:13)
at Socket. (/home/pooldaemon/nodejs-pool/lib/pool.js:1246:25)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:246:13)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:594:20)
2018-07-27 13:44 +00:00: Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
at ChildProcess.target.send (internal/child_process.js:588:16)
at Worker.send (internal/cluster/worker.js:54:28)
at /home/pooldaemon/nodejs-pool/lib/pool.js:138:16
at Array.forEach ()
at sendToWorkers (/home/pooldaemon/nodejs-pool/lib/pool.js:137:16)
at Worker.messageHandler (/home/pooldaemon/nodejs-pool/lib/pool.js:96:17)
at emitTwo (events.js:131:20)
at Worker.emit (events.js:214:7)
at ChildProcess.Worker.process.on (internal/cluster/worker.js:42:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
any idea?
I'm developing a profit switcher for cryptonight coins and pools and I would like to integrate MoneroOcean to my app. Therefore I need a way to estimate the profit per day in us dollar with a specified hash rate.
I looked at your API and found the following data:
"activePortProfit": 0.000007890717962390947,
"price": {
"usd": 163.619,
"eur": 138.690728466
}
I'm assuming that this will help me but what exactly is the value from "activePortProfit" representing?
Can you help me to calculate an estimated profit in us dollar per day based on a specified hash rate?
When running the script, there were some errors, I think my issue is that I'm running npm v6.1.0:
block 1512410 / 15574852018-06-23 19:15:12.952 7f5869bf2740 WARN blockchain.db.lmdb src/blockchain_db/lmdb/db_lmdb.cpp:72 Failed to add tx data to db transaction: Input/output error
2018-06-23 19:15:12.987 7f5869bf2740 FATAL bcutil src/blockchain_utilities/blockchain_import.cpp:450Error adding block to blockchain: Failed to add tx data to db transaction: Input/output error
export NVM_DIR="/home/pooldaemon/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
v8.9.3 is already installed.
Now using node v8.9.3 (npm v6.1.0)
bash: line 46: cd: /home/pooldaemon/nodejs-pool: No such file or directory
npm WARN saveError ENOENT: no such file or directory, open '/usr/local/src/monero/package.json'
npm WARN saveError EACCES: permission denied, open '/usr/local/src/monero/package-lock.json.495618337'
npm WARN enoent ENOENT: no such file or directory, open '/usr/local/src/monero/package.json'
npm WARN monero No description
npm WARN monero No repository field.
npm WARN monero No README data
npm WARN monero No license field.
Checking connectivity... done.
npm WARN deprecated [email protected]: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN xmrpoolui@ No repository field.
npm WARN xmrpoolui@ license should be a valid SPDX license expression
added 441 packages from 389 contributors and audited 1463 packages in 25.91s
found 11 vulnerabilities (4 low, 1 moderate, 6 high)
run npm audit fix
to fix them, or npm audit
for details
[PM2][Module] Installing module pm2-logrotate
[PM2][Module] Module already installed. Updating.
[PM2][ERROR] script not found : /home/pooldaemon/init.js
script not found : /home/pooldaemon/init.js
$ cd monero
$ ls
monero-blockchain-export monero-wallet-cli monero-wallet-rpc.log pool.keys
monero-blockchain-import monero-wallet-cli.log pool wallet_pass
monerod monero-wallet-rpc pool.address.txt
$ ./monerod --version
Monero 'Helium Hydra' (v0.11.1.0-release)
Do I need to delete this Linux account and start from scratch or is there another option.
Thank you,
To better track individual coin efforts.
After running the cache_clean script, I am getting a "TypeError: Cannot create property 'hash' on boolean 'false'" error. Any ideas?
I am working on alternative coins, but I am trying to figure out what "Block Expired" means?
It’s only my theory that there is a bug in longRunner with troublesome network. I guess it won’t happen with Monero because Monero network with high hashrate and stable.
In theory, block with higher number will have timestamp higher. For example, block m and block n, if m>n, timestamp of block m will > timestamp of block n.
With pool forking (turtlecoin case), it makes two thing, two blocks with same height but different timestamp (one correct and one forked).
With timestamp attacks (turtlecoin and graft cases), block lower have higher timestamp.
By somehow, with these hapenning, database at my pools keep growing, turtlecoin (21G) and graft(24G).
If you have free time or find something in the future, I hope you can help to fix this.
Hi MO !
Some miners use syntax from other pools of which syntax is different. Can you add support for that syntax too ? It means the pool will accept two syntaxs from zone117x's repo and Snipa's repo.
Thanks.
Would it be possible to add average hashrate columns to the worker stats part of the dashboard? For example, have a one hour and 24 hour average hashrate for each worker.
Sample implementation in PoolUI:
Here is the log (one coin pool), very slow to have block template (I guess at worker) :
7|pool | 2018-09-28 13:12:53:981 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.41) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:12:59:970 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.43) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:13:05:991 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.46) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:13:11:984 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.46) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:13:17:991 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.42) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:13:18:922 +00:00: >>> Trusted=0(0.00%) / Validated=0(0.00%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=0 shares
7|pool | 2018-09-28 13:13:24:009 +00:00: Invalid miner 8PQqeiKmBM:test (103.7.39.46) [], disconnecting due to: No active block template
7|pool | 2018-09-28 13:13:38:962 +00:00: Did not send e-mail to 'undefined' successfully! Response: undefined Response: undefined
7|pool | 2018-09-28 13:13:48:922 +00:00: >>> Trusted=0(0.00%) / Validated=0(0.00%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=0 shares
7|pool | 2018-09-28 13:14:18:922 +00:00: >>> Trusted=0(0.00%) / Validated=0(0.00%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=0 shares
7|pool | 2018-09-28 13:14:48:922 +00:00: >>> Trusted=0(0.00%) / Validated=0(0.00%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=0 shares
7|pool | 2018-09-28 13:14:59:948 +00:00: [*] New block to mine at 438167 height with 150964764 difficulty and 12090 port (with algo hash factor 1)
7|pool | 2018-09-28 13:15:18:922 +00:00: >>> Trusted=0(0.00%) / Validated=2(100.00%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=2 shares
Sorry because I haven’t dig thousand of code lines to answer for myself.
When the pool is mining a coin but in the time of mining (no block found yet), there is a new coin that is more profitable, will the pool switch or it will continue to mine the old coin up to block found ?
This was requested several times already.
I don’t know if you experience with Monero hfv7. When some one mines with wrong algo, it seems that connection is always shown up on pool connections number and won’t be decreased even that miner is off.
As I see in your code, you changed both code and database. Your repo is more active than Snipa’s and I’d like to migrate to yours. Must I reinstall my pool from scratch ? Is there a way to backup mysql and restore to the new one ? What about lmdb data about miners’ history , will I lose them ?
Hey , thanks for the top work that you are doing , so now i need a help , i try to use your
ban_user.js but if i try to start it ex : node ban_user.js WALLET , is comming this error :
Please specify user address to ban
so , how i can specific the wallet and reason ?
ty
Currently "Queue debug state: 1407 items in the queue 192 items being processed" and they continue to pile up.
After looking at the database, I think there is a typo in blockManager.js
global.config.payout.pps === true
shouble be substituated with
global.config.pps.enable === true
And this will fix the breaking.
Whether this pool supports Bittube v2 algo?
return callback(null, {hash: cachedData.hash, identifier: 'global', lastHash: Math.floor(cachedData.lastHash / 1000), totalHashes: cachedData.totalHashes, validShares: Number(cachedData.goodShares), invalidShares: Number(cachedData.badShares)});
--> to add pplnsShares: Number(cachedData.shares)
Thank you for your consideration.
If possible, can you add next total due increase with more sophicated Artificial Intelligence and Probability ? It helps the pool when it hits bad luck.
Hi
I am trying to setup your fork of the pool for a monero pool and i get the below error. the error appears about a minute after the miner started working.
what could it be?
i have followed all the how to and also checked to have the wallet addresses both pool and fee in the db.
Could you help me please?
7|pool | 2018-05-17 23:59:24:967 +02:00: >>> Trusted=1(4.35%) / Validated=22(95.65%) / Invalid=0(0.00%) / Outdated=0(0.00%) / Throttled=0(0.00%) / Total=23 shares
3|worker | 2018-05-17 23:59:34:362 +02:00: Starting stats collection for 1575017 height
3|worker | 2018-05-17 23:59:34:457 +02:00: Processed 0 workers for 0.096 seconds. Pool hashrate is: 1
3|worker | 2018-05-17 23:59:44:458 +02:00: Starting stats collection for 1575017 height
3|worker | 2018-05-17 23:59:44:517 +02:00: Processed 0 workers for 0.06 seconds. Pool hashrate is: 1
7|pool | 2018-05-17 23:59:51:072 +02:00: RangeError: Maximum call stack size exceeded
7|pool | at v4 (/home/pool/nodejs-pool/node_modules/request/node_modules/uuid/v4.js:4:12)
7|pool | at new Multipart (/home/pool/nodejs-pool/node_modules/request/lib/multipart.js:10:19)
7|pool | at new Request (/home/pool/nodejs-pool/node_modules/request/request.js:124:21)
7|pool | at request (/home/pool/nodejs-pool/node_modules/request/index.js:53:10)
7|pool | at Function.post (/home/pool/nodejs-pool/node_modules/request/index.js:61:12)
7|pool | at /home/pool/nodejs-pool/lib/remote_comms.js:12:25
7|pool | at /home/pool/nodejs-pool/node_modules/async/dist/async.js:2937:44
7|pool | at apply (/home/pool/nodejs-pool/node_modules/async/dist/async.js:21:25)
7|pool | at /home/pool/nodejs-pool/node_modules/async/dist/async.js:56:12
7|pool | at Request._callback (/home/pool/nodejs-pool/lib/remote_comms.js:16:28)
7|pool | at self.callback (/home/pool/nodejs-pool/node_modules/request/request.js:185:22)
7|pool | at emitOne (events.js:116:13)
7|pool | at Request.emit (events.js:211:7)
7|pool | at Request.init (/home/pool/nodejs-pool/node_modules/request/request.js:231:17)
7|pool | at new Request (/home/pool/nodejs-pool/node_modules/request/request.js:127:8)
7|pool | at request (/home/pool/nodejs-pool/node_modules/request/index.js:53:10)
PM2 | App [pool] with id [7] and pid [6546], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:pool id:7
Working with Bytecoin, which has not yet forked and wondering what the best options would be for the HashFactor, and algo settings. The coin functions on CN1, but I think it is causing issues.
Hi,
I'm curious to use this pool for 5 of different cryptonote based coins.
which includes:
XDN
Bitsum
Dero
BCN
Karbo
Please give some advice to put them in the pool,
I've successfully deployed this pool on the server for monero but need to know about alternate coins implementation and one more thing , if we can implement them in the pool so should we use all of them coins on parallel basis in a single pool.
Thanks
Hello
This code don't get oldest locked block. it gets first random locked blocks.
If you have some unlocked block, it can be problem.
I think this need to get all unlocked blocks sort it by "timestamp" then get oldest.
this.getOldestLockedBlock = function(){
this.refreshEnv();
debug("Getting the oldest locked block in the system");
let txn = this.env.beginTxn({readOnly: true});
let cursor = new this.lmdb.Cursor(txn, this.blockDB);
let highestBlock = null;
for (let found = cursor.goToFirst(); found; found = cursor.goToNext()) {
if (highestBlock !== null){
break;
}
cursor.getCurrentBinary(function(key, data){ // jshint ignore:line
let blockData = global.protos.Block.decode(data);
if (blockData.unlocked === false){
highestBlock = blockData;
}
});
}
cursor.close();
txn.commit();
if (highestBlock !== null) {
debug("Got the oldest locked block in the system at height: " + JSON.stringify(highestBlock));
} else {
debug("There are no unlocked blocks in the system. Woohoo!");
}
return highestBlock;
};
I told Snipa22, but he say it isn't promlem
Snipa22#227
Can you write what i offered?
Thanks
Hello i think there is need to add code to prevent send duplicate job.
function newBlockTemplate(template) {
let buffer = new Buffer(template.blocktemplate_blob, 'hex');
let previous_hash = new Buffer(32);
buffer.copy(previous_hash, 0, 7, 39);
console.log(threadName + 'New block to mine at height: ' + template.height + '. Difficulty: ' + template.difficulty);
if (activeBlockTemplate) {
if (activeBlockTemplate.previous_hash.toString('hex') === template.prev_hash ) {
console.log(threadName + "Same job");
return;
}
pastBlockTemplates.enq(activeBlockTemplate);
}
activeBlockTemplate = new BlockTemplate(template);
console.log(threadName + "Update workers");
for (let minerId in activeMiners) {
if (activeMiners.hasOwnProperty(minerId)) {
let miner = activeMiners[minerId];
debug(threadName + "Updating worker " + miner.payout + " With new work at height: " + template.height);
miner.sendNewJob();
}
}
}
example:
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 4 - 63492) New block to mine at height: 42585. Difficulty: 75447651
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 4 - 63492) activeBlockTemplate : 1cd23e23e48d238c57e536a8aac2817220ee6be70fad8b5b3c79279ae8515d09
1|pool | (Worker 4 - 63492) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | (Worker 4 - 63492) Update workers
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 1 - 63474) New block to mine at height: 42585. Difficulty: 75447651
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 1 - 63474) activeBlockTemplate : 1cd23e23e48d238c57e536a8aac2817220ee6be70fad8b5b3c79279ae8515d09
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 1 - 63474) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 1 - 63474) Update workers
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 2 - 63480) New block to mine at height: 42585. Difficulty: 75447651
1|pool | (Worker 2 - 63480) activeBlockTemplate : 1cd23e23e48d238c57e536a8aac2817220ee6be70fad8b5b3c79279ae8515d09
1|pool | (Worker 2 - 63480) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | (Worker 2 - 63480) Update workers
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 3 - 63486) New block to mine at height: 42585. Difficulty: 75447651
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 3 - 63486) activeBlockTemplate : 1cd23e23e48d238c57e536a8aac2817220ee6be70fad8b5b3c79279ae8515d09
1|pool | (Worker 3 - 63486) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | (Worker 3 - 63486) Update workers
1|pool | 2018-01-05 21:18:22 +00:00: (Master) New block to mine at height: 42585. Difficulty: 75447651
1|pool | 2018-01-05 21:18:22 +00:00: (Master) activeBlockTemplate : 1cd23e23e48d238c57e536a8aac2817220ee6be70fad8b5b3c79279ae8515d09
1|pool | (Master) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | 2018-01-05 21:18:22 +00:00: (Worker 4 - 63492) New block to mine at height: 42585. Difficulty: 75447651
1|pool | (Worker 4 - 63492) activeBlockTemplate : 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | (Worker 4 - 63492) 7062b336bc841d0d0dea6b09e94bf3b3d42371019252dbf1dbd8fdaff5af2140
1|pool | (Worker 4 - 63492) Same job
1|pool | 2018-01-05 21:18:22 +00:00: (Master) Update workers
Hi,
I tried to install monoeroocean's nodejs-pool on Ubuntu 16.04.4 several times the past days but it always comes with an error when trying to patch the monero deamon with following code:
curl https://raw.githubusercontent.com/MoneroOcean/nodejs-pool/master/deployment/monero_daemon.patch | sudo git apply -v
The error output is:
Checking patch src/cryptonote_core/tx_pool.cpp...
error: while searching for:
LockedTXN lock(m_blockchain);
auto sorted_it = m_txs_by_fee_and_receive_time.begin();
while (sorted_it != m_txs_by_fee_and_receive_time.end())
{
txpool_tx_meta_t meta = m_blockchain.get_txpool_tx_meta(sorted_it->second);
LOG_PRINT_L2("Considering " << sorted_it->second << ", size " << meta.blob_size << ", current block size " << total_size << "/" << max_total_size << ", current coinbase " << print_money(best_coinbase));
error: patch failed: src/cryptonote_core/tx_pool.cpp:863
error: src/cryptonote_core/tx_pool.cpp: patch does not apply
Annotation: The bin folder of monero under /usr/local/src/monero/build/release/bin
is not existing.
Running sudo systemctl status monero
shows the daemon is not running:
● monero.service - Monero Daemon
Loaded: loaded (/lib/systemd/system/monero.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Mi 2018-05-09 10:50:49 UTC; 43min ago
Process: 1603 ExecStart=/usr/local/src/monero/build/release/bin/monerod --rpc-bind-ip 127.0.0.1 --detach --restricted-rpc (code=exited, status=203/EXEC)
Mai 09 10:50:48 eu systemd[1]: monero.service: Unit entered failed state.
Mai 09 10:50:48 eu systemd[1]: monero.service: Failed with result 'exit-code'.
Mai 09 10:50:49 eu systemd[1]: monero.service: Service hold-off time over, scheduling restart.
Mai 09 10:50:49 eu systemd[1]: Stopped Monero Daemon.
Mai 09 10:50:49 eu systemd[1]: monero.service: Start request repeated too quickly.
Mai 09 10:50:49 eu systemd[1]: Failed to start Monero Daemon.
Does anyone has any idea? This problem prevents running the pool.
Hix, it looks complicated now. If possible, can you maintain two repos, one old repo for only one coin, one repo for multiple coins. I love your codes but it becomes too hard for me now :((. Thanks for your great work.
When running on testnet (and changing the configurations within MySQL - ports and testnet=true), I seem to get:
Block template request failed for 18081 port.
(I changed daemon RPC port to run on 18081 on testnet)
Also tried 28081 (default testnet daemon port), same error message:
[Pool] Block template request failed for 18081 port.
However, the monero-wallet-cli and monero-wallet-rpc connect to the daemon no problem. It just doesn't seem to be generating a block template?
In coin javascript, there are alot of hardcoded XMR log/email/text (mainly from Snipa's toriginal code), can you change all "XMR" to global.config.general.coinCode ?
I know it's not important. Just in case, you want to do it ;), great job !
Hello
Please add support to change email in settings after login.
app.js
secureRoutes.post('/changeEmail', function (req, res) {
global.mysql.query("UPDATE users SET email = ? WHERE id = ?", [req.body.email, req.decoded.id]).then(function () {
return res.json({'msg': 'Email updated, set to: ' + req.body.email});
});
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.