node-open-mining-portal
node-open-mining-portal copied to clipboard
Can't compile stratum-pool
Hello, I got error:
`module.js:471 throw err; ^
Error: Cannot find module 'stratum-pool'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.
so if I understand it good, I need stratum-pool. So I tried sudo npm install stratum-pool
but no luck. Log (because it is too long): https://pastebin.com/RyFVF5D4 (debug.log) and https://pastebin.com/Qh8pteU0 (simply output) thanks.
Node: 6.10.3 NPM: 3.10.10
Seems that nobody has a solution for it. Did you fix the problem is also have that same problem
I am on node 8.x and NPM 5.x
Cannot find module 'stratum-pool'
Install stratum-pool via npm.
Why You use not required node and npm? https://github.com/zone117x/node-open-mining-portal Requirements Node.js v0.10+
NOMP did not work with newer Node. 0.10.x or maybe 0.12.x
Current Node version it only works with is 0.10.x
Would love to get a pull request with updates to work with latest node version and NPM modules.
I have node-multi-hashing updated here, but still needs a few updates https://github.com/krisklosterman/node-multi-hashing It compiles with 8.1.3 but it needs a little touching up, when thats done I can create a pull request. @zone117x I just pulled it into nomp and when i started nomp I am getting this error
buffer.js:125
throw new Error(
^
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:125:13)
at Object.exports.uint256BufferFromHash (/Users/seion/node-stratum-pool/lib/util.js:54:19)
at Object.exports.CreateGeneration (/Users/seion/node-stratum-pool/lib/transactions.js:222:14)
at new BlockTemplate (/Users/seion/node-stratum-pool/lib/blockTemplate.js:68:47)
at JobManager.processTemplate (/Users/seion/node-stratum-pool/lib/jobManager.js:154:32)
at /Users/seion/node-stratum-pool/lib/pool.js:576:62
at itemFinished (/Users/seion/node-stratum-pool/lib/daemon.js:156:36)
at /Users/seion/node-stratum-pool/lib/daemon.js:169:17
at parseJson (/Users/seion/node-stratum-pool/lib/daemon.js:85:17)
at IncomingMessage.<anonymous> (/Users/seion/node-stratum-pool/lib/daemon.js:95:17)
2017-07-06 13:07:34 [Master] [PoolSpawner] Fork 2 died, spawning replacement worker...
Looks like I am going to have to update node-stratum-pool to the new nodejs 8 api
new Buffer() is depreciated
Not sure if this is a good fix or not If anyone wants to help me maybe we can setup a slack channel and try to clean all this up
exports.uint256BufferFromHash = function(hex){
var fromHex;
if (hex != 0) {
fromHex = Buffer.from(hex, 'hex');
} else {
fromHex = Buffer.alloc(32);
fromHex.fill(0);
}
return exports.reverseBuffer(fromHex);
};
it was:
exports.uint256BufferFromHash = function(hex){
var fromHex = new Buffer(hex, 'hex');
if (fromHex.length != 32){
var empty = new Buffer(32);
empty.fill(0);
fromHex.copy(empty);
fromHex = empty;
}
return exports.reverseBuffer(fromHex);
};
It does not like the 0 that is passed in.
2017-07-06 13:58:51 [Pool] [verium] (Thread 1) Share accepted at diff 0.03/2.00000769 by ##HIDDEN### [::1] 2017-07-06 13:58:52 [Pool] [verium] (Thread 1) Daemon instance 0 rejected a supposedly valid block node(27397,0x7fffe01313c0) malloc: *** error for object 0x7fff5fbf4ce0: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug 2017-07-06 13:58:57 [Master] [PoolSpawner] Fork 0 died, spawning replacement worker...
https://join.slack.com/nomp/shared_invite/MjA5Nzk0MzE2NDcwLTE0OTkzNjY3NTMtMTc5ODY1OTQ5OA
I am still running into this on Ubuntu 16.04
In case anyone is still having the uint256BufferFromHash error, I was able to fix it by installing the latest node-stratum-pool module directly from Github:
npm install https://github.com/zone117x/node-stratum-pool/tarball/master