cazala / coin-hive

CoinHive cryptocurrency miner for node.js
https://www.npmjs.com/package/coin-hive
MIT License
1.99k stars 399 forks source link

Fails to run Monero miner on raspberry pi #75

Open felixgalindo opened 6 years ago

felixgalindo commented 6 years ago

(node:5095) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r497674 (node:5095) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

node -v v8.9.3

uname -a Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

chromium-browser -version Chromium 60.0.3112.89 Built on Ubuntu 14.04, running on Raspbian 9.1

Code: `const CoinHive = require('coin-hive');

(async() => {

// Create miner const miner = await CoinHive('address', { launch: { executablePath: '/usr/bin/chromium-browser', args: ['--disable-setuid-sandbox', '--no-sandbox'] } });

// Start miner await miner.start();

// Listen on events miner.on('found', () => console.log('Found!')) miner.on('accepted', () => console.log('Accepted!')) miner.on('update', data => console.log( Hashes per second: ${data.hashesPerSecond} Total hashes: ${data.totalHashes} Accepted hashes: ${data.acceptedHashes} ));

// Stop miner setTimeout(async() => await miner.stop(), 60000); })();`

cazala commented 6 years ago

have you tried this? https://github.com/cazala/coin-hive#troubleshooting

felixgalindo commented 6 years ago

Yes

On Dec 14, 2017, at 1:36 PM, Juan Cazala notifications@github.com wrote:

have you tried this? https://github.com/cazala/coin-hive#troubleshooting

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

benocd commented 6 years ago

I'm having the same issue. Already tried with https://github.com/cazala/coin-hive#troubleshooting but I think it's a chromium's problem as the latest version ain't available for ARM https://github.com/GoogleChrome/puppeteer/issues/550 I also tried installing a lower version of puppeteer and installing an alternative built for headless-chromium but still no success. Anyhow, if anyone figures out how to fix this please share it.

felixgalindo commented 6 years ago

The way I did it was by downloading the chromium build from this url https://drive.google.com/a/chromium.org/uc?id=0B7RLEApsOKBLZUZuQl9JR3dXS2c&export=download Then set executablePath to where you extracted it to. For example:

const miner = await CoinHive('something', { launch: { executablePath: '/home/pi/coin-hive/headless-chrome/chrome', args: ['--disable-setuid-sandbox', '--no-sandbox'] } });

This has been tested on Pi 3.

antonio-gomez commented 6 years ago

@felixgalindo Thanks for that man, it worked! I was about to buy ExaGear to run Chrome instead of Chromium and then I found your hack. Awesome!

felixgalindo commented 6 years ago

No problem. Glad it worked for you too.

On Dec 23, 2017, at 2:37 AM, Antonio Gomez notifications@github.com wrote:

@felixgalindo Thanks for that man, it worked! I was about to buy ExaGear to run Chrome instead of Chromium and then I found your hack. Awesome!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ghost commented 6 years ago

Just to know, how many hashrate gives running in a PI 3? Thanks in advance :)

felixgalindo commented 6 years ago

Nothing to write home about.... I am getting around 3-5 hashes per second.

On Tue, Jan 2, 2018 at 9:56 PM, tejanous notifications@github.com wrote:

Just to know, how many hashrate gives running in a PI 3? Thanks in advance :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cazala/coin-hive/issues/75#issuecomment-354933290, or mute the thread https://github.com/notifications/unsubscribe-auth/ARa7fKm5v24oDlUp_ABeM2H5I7pm_7IIks5tGvpugaJpZM4RCQgL .

ghost commented 6 years ago

Oh, that's a tiny amount. I was expecting about 5-10 H/s. Thanks for your answer

MaestroJurko commented 6 years ago

I am still getting this error even though I download headless-chrome

executablePath: '/home/pi/Downloads/headless-chrome/chrome'

(node:2435) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!