Great work!
I tried using it, but got some errors:
(I fixed this by editing app.js)
[JS] uncaughtException: spawn /root/koinos-miner/bin/koinos_miner ENOENT
Error: spawn /root/koinos-miner/bin/koinos_miner ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
[JS] Stopping miner
/root/koinos-miner/app.js:34
console.log(`[JS](app.js) Error: `, error)
^
ReferenceError: error is not defined
at KoinosMiner.error [as errorCallback] (/root/koinos-miner/app.js:34:41)
at process.<anonymous> (/root/koinos-miner/index.js:120:39)
at process.emit (events.js:314:20)
at process._fatalException (internal/process/execution.js:165:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! koinos-miner@1.0.0 start: `node app.js "-u" "fbslo"`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the koinos-miner@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-30T13_17_22_188Z-debug.log
And after that, I received this error.
[JS] uncaughtException: spawn /root/koinos-miner/bin/koinos_miner ENOENT
Error: spawn /root/koinos-miner/bin/koinos_miner ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
[JS] Stopping miner
[JS](app.js) Error: {
kMessage: 'An uncaught exception was thrown.',
exception: Error: spawn /root/koinos-miner/bin/koinos_miner ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn /root/koinos-miner/bin/koinos_miner',
path: '/root/koinos-miner/bin/koinos_miner',
spawnargs: []
}
}
[JS] New task received. Task Id: eae1ee
(node:29040) UnhandledPromiseRejectionWarning: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:399:19)
at writeOrBuffer (_stream_writable.js:387:5)
at Socket.Writable.write (_stream_writable.js:318:11)
at MiningRequestQueue.sendRequest (/root/koinos-miner/index.js:55:22)
at KoinosMiner.sendMiningRequest (/root/koinos-miner/index.js:190:24)
at KoinosMiner.runMiner (/root/koinos-miner/index.js:230:12)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:29040) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29040) [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.
Ubuntu 18.04, Node v12.19.0
Try this: Run
npm run postinstall
to compile the C programThanks, working now :)
Thanks for the feedback. I will update the readme