How to use the Miner function from bindings
Find comprehensive JavaScript bindings.Miner code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16
class Miner extends Nimiq.Observable { constructor(deviceOptions) { super(); this._miner = new NativeMiner.Miner(); this._devices = this._miner.getDevices(); this._devices.forEach((device, idx) => { const options = deviceOptions.forDevice(idx); if (!options.enabled) {
11
12
2
+ 3 other calls in file
23 24 25 26 27 28 29 30 31 32
this._workId = 0; allowedDevices = Array.isArray(allowedDevices) ? allowedDevices : []; memorySizes = Array.isArray(memorySizes) ? memorySizes : []; const miner = new NativeMiner.Miner(allowedDevices, memorySizes); const workers = miner.getWorkers(); this._hashes = new Array(workers.length).fill(0); this._lastHashRates = this._hashes.map(_ => []);
11
0
2
27 28 29 30 31 32 33 34 35 36
allowedDevices = Array.isArray(allowedDevices) ? allowedDevices : []; memorySizes = Array.isArray(memorySizes) ? memorySizes : []; threads = Array.isArray(threads) ? threads : []; cacheSizes = Array.isArray(cacheSizes) ? cacheSizes : []; const miner = new NativeMiner.Miner(allowedDevices, memorySizes, threads, cacheSizes); const workers = miner.getWorkers(); this._hashes = []; this._lastHashRates = [];
11
0
1
35 36 37 38 39 40 41 42 43 44
memorySizes.push(options.memory); threads.push(options.threads); } } const miner = new NativeMiner.Miner(allowedDevices, memorySizes, threads); const workers = miner.getWorkers(); this._hashes = []; this._lastHashRates = [];
0
0
3
bindings.createKey is the most popular function in bindings (8616 examples)