diff --git a/app/igneum-app/ui/app.js b/app/igneum-app/ui/app.js index 5b8c301d..1df3cc39 100644 --- a/app/igneum-app/ui/app.js +++ b/app/igneum-app/ui/app.js @@ -441,7 +441,9 @@ var TuneLine = (function () { return { kind: 'idle', text: cd.sweep_note || 'tuning: not run yet (starts after 120 s of steady mining)' }; } function rel(s) { s = Math.max(0, Math.floor(s)); return s < 60 ? s + ' s' : s < 3600 ? Math.floor(s / 60) + ' min' : s < 86400 ? Math.floor(s / 3600) + ' h' : Math.floor(s / 86400) + ' d'; } - return { model: model, point: point, rel: rel }; + // Ember 2: £ a day for a draw at pence per kWh (watts × 24 / 1000 × price / 100) + function pounds(watts, pence) { var v = watts * 24 / 1000 * pence / 100; return '£' + v.toFixed(2); } + return { model: model, point: point, rel: rel, pounds: pounds }; })(); if (typeof module === 'object' && module && module.exports) { module.exports = Notices; module.exports.UpdateCard = UpdateCard; module.exports.View = View; module.exports.TuneLine = TuneLine; module.exports.tuneNotice = Notices.tuneNotice; } @@ -630,6 +632,9 @@ if (typeof document !== 'undefined') (function () { $('s-login').addEventListener('change', function () { var on = this.checked; api('api/settings', { start_at_login: on }).then(function (r) { if (!r.ok) { toast(r.error || 'could not change'); $('s-login').checked = !on; } }); }); $('s-jobs-allow').addEventListener('change', function () { api('api/jobs/allow', { on: this.checked }); }); $('s-sweep').addEventListener('change', function () { api('api/sweep/enable', { on: this.checked }).then(function (r) { if (r.ok) toast($('s-sweep').checked ? 'Ember Tune on: once after install, then weekly' : 'Ember Tune off'); }); }); + $('s-tune-goal').addEventListener('change', function () { var g = this.value; api('api/tune/goal', { goal: g }).then(function (r) { if (r.ok) toast('Goal: ' + g); }); }); + $('s-power-price').addEventListener('change', function () { var p = parseFloat(this.value); if (isNaN(p)) return; api('api/tune/goal', { price_pence: p }).then(function (r) { if (r.ok) toast('Electricity: ' + p + ' p/kWh'); }); }); + $('s-tune-climb').addEventListener('change', function () { var on = this.checked; api('api/tune/goal', { climb: on }).then(function (r) { if (r.ok) toast(on ? 'Ember 2: the clocks climb from the next tune' : 'The ladders run from the next tune'); }); }); $('s-power-control').addEventListener('change', function () { var on = this.checked; api('api/power/control', { on: on }).then(function (r) { if (r.ok) toast(on ? 'Power control on: Windows asks for administrator rights once' : 'Power control off; nothing asks'); }); }); $('s-trust').addEventListener('change', function () { var on = this.checked; api('api/settings', { proof_verify_trust: on }).then(function (r) { if (r.ok) toast(on ? 'Trust mode on (devnet only); the node restarts' : 'Trust mode off; the node restarts'); else { toast(r.error || 'could not change'); $('s-trust').checked = !on; } }); }); $('s-live').addEventListener('click', function () { if (state && state.live_page) api('api/open', { url: state.live_page }); }); @@ -1177,6 +1182,10 @@ if (typeof document !== 'undefined') (function () { sw('s-jobs-allow', s.jobs && s.jobs.allowed); sw('s-sweep', s.settings.sweep); sw('s-trust', s.settings.proof_verify_trust); sw('s-power-control', s.settings.power_control); setText('s-power-note', s.settings.tuning_off ? s.settings.tuning_note : (s.settings.power_note || (s.settings.power_control ? '' : 'Off: NVIDIA cards measure only; AMD cards need no rights.'))); setText('s-devfee-text', View.devFeeText(s)); + if (document.activeElement !== $('s-tune-goal')) $('s-tune-goal').value = (s.settings.tune_goal || 'balanced'); + if (document.activeElement !== $('s-power-price')) $('s-power-price').value = s.settings.power_price_pence > 0 ? s.settings.power_price_pence : ''; + setText('s-power-price-note', s.settings.power_price_pence > 0 ? 'the card rows read in £ a day' : 'set it to see £ a day per card'); + sw('s-tune-climb', s.settings.tune_climb); if (document.activeElement !== $('s-name')) $('s-name').value = s.display_name || ''; setText('s-mid', (s.machine_id || '').slice(0, 8)); setText('s-node-dir', 'chain data: ' + s.node_dir); @@ -1200,6 +1209,7 @@ if (typeof document !== 'undefined') (function () { } // Ember Tune's line (TuneLine.model): running, tuned, measured, stopped or not run yet, for every card h += tuneLineHtml(cd); + h += tuneCurveHtml(cd, state && state.settings ? state.settings.power_price_pence : 0); h += '
Each identity votes and is paid on its own. 8 suits a big card, 2 a small one, 1 an integrated GPU. Changing it restarts that card’s worker.
Once after install, then weekly and after a driver or program change: the power limit steps from 100% down to 50%, then the core clock from its maximum down to 60%, 75 s a step on the live program; the memory clock is never touched. The card keeps the point with the most hashes per watt within 1% of its top rate. A step with a rejected hash, a hot GPU or a dragged memory clock is reverted. A card whose model the fleet already knows starts at that point and confirms it in two steps. Every result goes back to the fleet without anything that identifies you. A cap you set by hand is left alone.
+Windows asks for administrator rights once; the NVIDIA cap and the tune need them. Off, the app never asks and NVIDIA cards measure only. AMD cards need no rights.
diff --git a/app/igneum-app/ui/tune-line.test.mjs b/app/igneum-app/ui/tune-line.test.mjs index 18fafce3..ff684f4f 100644 --- a/app/igneum-app/ui/tune-line.test.mjs +++ b/app/igneum-app/ui/tune-line.test.mjs @@ -75,3 +75,8 @@ test('a card never shows 0 MH/s without a reason word: tuning, held and tuned ro assert.equal(View.tuneEta(30), 'under a minute'); assert.equal(View.tuneEta(700), 'about 12 min'); }); + +test('Ember 2: £ a day from watts and pence per kWh', () => { + assert.equal(mod.exports.TuneLine.pounds(310, 28.5), '£2.12'); + assert.equal(mod.exports.TuneLine.pounds(102.7, 28.5), '£0.70'); +}); diff --git a/docs/plans/ember-tune.md b/docs/plans/ember-tune.md index 40bc4be9..6d771c17 100644 --- a/docs/plans/ember-tune.md +++ b/docs/plans/ember-tune.md @@ -176,6 +176,32 @@ live MH/s and W, the seconds left and the plan; a POST of state, never a quit, p reads `Tuned: