You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
I'm getting the following error from ethashjs/index.js. The text fullSize, n, w, s and mixhashes are just my additional debugging logs. The problem occurred before I added the debugging information.
block number (hex) 0x1199e1
fullSize : 1392507008
n : 21757922
w : 32
s : ?1w�V��FJ��Ey��[��fj�#��V.
g�)����Bm��eU\y��cB3�?�f�[�� �i�ٗ
mixhashes: 2
/home/beef/BeefPool/node_modules/ethashjs/index.js:60
var mix = Buffer.concat(Array(mixhashes).fill(s))
^
TypeError: Object , has no method 'fill'
at Ethash.run (/home/beef/BeefPool/node_modules/ethashjs/index.js:60:44)
at /home/beef/BeefPool/shareHandler.js:43:19
at Object._onImmediate (/home/beef/BeefPool/node_modules/ethashjs/node_modules/levelup/lib/levelup.js:258:9)
at processImmediate as _immediateCallback
The snippet from ethashjs/index.js modified with my debugging information:
Ethash.prototype.run = function (val, nonce, fullSize) {
fullSize = fullSize || this.fullSize
console.log("fullSize : " + fullSize);
const n = Math.floor(fullSize / ethHashUtil.params.HASH_BYTES)
console.log("n : " + n);
const w = Math.floor(ethHashUtil.params.MIX_BYTES / ethHashUtil.params.WORD_BYTES)
console.log("w : " + w);
const s = ethUtil.sha3(Buffer.concat([val, ethHashUtil.bufReverse(nonce)]), 512)
console.log("s : " + s);
const mixhashes = Math.floor(ethHashUtil.params.MIX_BYTES / ethHashUtil.params.HASH_BYTES)
console.log("mixhashes: " + mixhashes);
var mix = Buffer.concat(Array(mixhashes).fill(s))
The text was updated successfully, but these errors were encountered:
/home/beef/test/ethashjs/index.js:54
var mix = Buffer.concat(Array(mixhashes).fill(s))
^
TypeError: Object , has no method 'fill'
at Ethash.run (/home/beef/test/ethashjs/index.js:54:44)
at Object. (/home/beef/test/ethashjs/example/example.js:7:21)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
I've just installed nodejs v4x instead of the default Ubuntu packaged version and the example works. I'll test the other areas. Don't worry about this at the moment - hopefully it's not a problem at all and just a nodejs version issue.
This is not an issue with your library. I was using the wrong version of nodejs that comes packaged with Ubuntu by default. I've installed nodejs 4x from the nodesource repository and it's all working. Closing this issue. Have a good day.
Hi,
I'm getting the following error from ethashjs/index.js. The text fullSize, n, w, s and mixhashes are just my additional debugging logs. The problem occurred before I added the debugging information.
block number (hex) 0x1199e1
fullSize : 1392507008
n : 21757922
w : 32
s : ?1w�V��FJ��Ey��[��fj�#��V.
g�)����Bm��eU\y��cB3�?�f�[�� �i�ٗ
mixhashes: 2
/home/beef/BeefPool/node_modules/ethashjs/index.js:60
var mix = Buffer.concat(Array(mixhashes).fill(s))
^
TypeError: Object , has no method 'fill'
at Ethash.run (/home/beef/BeefPool/node_modules/ethashjs/index.js:60:44)
at /home/beef/BeefPool/shareHandler.js:43:19
at Object._onImmediate (/home/beef/BeefPool/node_modules/ethashjs/node_modules/levelup/lib/levelup.js:258:9)
at processImmediate as _immediateCallback
The snippet from ethashjs/index.js modified with my debugging information:
Ethash.prototype.run = function (val, nonce, fullSize) {
fullSize = fullSize || this.fullSize
console.log("fullSize : " + fullSize);
const n = Math.floor(fullSize / ethHashUtil.params.HASH_BYTES)
console.log("n : " + n);
const w = Math.floor(ethHashUtil.params.MIX_BYTES / ethHashUtil.params.WORD_BYTES)
console.log("w : " + w);
const s = ethUtil.sha3(Buffer.concat([val, ethHashUtil.bufReverse(nonce)]), 512)
console.log("s : " + s);
const mixhashes = Math.floor(ethHashUtil.params.MIX_BYTES / ethHashUtil.params.HASH_BYTES)
console.log("mixhashes: " + mixhashes);
var mix = Buffer.concat(Array(mixhashes).fill(s))
The text was updated successfully, but these errors were encountered: