-h, --help show this dialog
--debug enable additional logging output
- --benchmark <value> generate work for specified number of random hashes
+ --benchmark <value> generate work for specified number of random hashes
- -b, --batch process all data before returning final results as array
+ -b, --batch process all data before returning final results as array
-d, --difficulty <value> override the minimum difficulty value
-e, --effort <value> increase demand on GPU processing
-v, --validate <value> check an existing work value instead of searching for one
for (const hash of hashes) {
try {
body.hash = hash
- const kill = setTimeout(aborter.abort, 5000)
+ const kill = setTimeout(() => aborter.abort(), 60000)
const response = await fetch(`http://localhost:${process.env.NANO_POW_PORT}`, {
method: 'POST',
body: JSON.stringify(body),
if [ "$1" = '--server' ]; then
shift;
node "$SCRIPT_DIR"/server.js > "$NANO_POW_LOGS"/nano-pow-server-$(date -u -Iseconds).log 2>&1 & echo "$!" > "$NANO_POW_HOME"/server.pid;
+ sleep 0.1;
+ if [ "$(ps | grep $(cat $NANO_POW_HOME/server.pid))" = '' ]; then
+ cat $(ls -td "$NANO_POW_LOGS"/* | head -n1);
+ fi;
else
node "$SCRIPT_DIR"/cli.js "$@";
fi;
NanoPowGl.#drawProgram = null
NanoPowGl.#gl = null
NanoPowGl.#busy = false
+ NanoPowGl.#isInitialized = false
NanoPowGl.init()
}
setTimeout(async (): Promise<void> => {
const result = this.work_generate(hash, options)
resolve(result)
- }, 100)
+ }, 500)
})
}
if (this.#isInitialized === false) this.init()
setTimeout(async (): Promise<void> => {
const result = this.work_validate(work, hash, options)
resolve(result)
- }, 100)
+ }, 500)
})
}
if (this.#isInitialized === false) this.init()
NanoPowGpu.#gpuBuffer?.destroy()
NanoPowGpu.#uboBuffer?.destroy()
NanoPowGpu.#busy = false
+ NanoPowGpu.#isInitialized = false
NanoPowGpu.init()
}
this.#cpuBuffer.unmap()
} catch (err) {
console.warn(`Error getting data from GPU. ${err}`)
- return this.#dispatch(pipeline, seed, hash, difficulty, passes)
+ this.#cpuBuffer.unmap()
+ this.reset()
}
if (this.#debug) console.log('gpuBuffer data', data)
if (data == null) throw new Error(`Failed to get data from buffer.`)
setTimeout(async (): Promise<void> => {
const result = this.work_generate(hash, options)
resolve(result)
- }, 100)
+ }, 500)
})
}
if (this.#isInitialized === false) this.init()
setTimeout(async (): Promise<void> => {
const result = this.work_validate(work, hash, options)
resolve(result)
- }, 100)
+ }, 500)
})
}
if (this.#isInitialized === false) this.init()