fix: mining always starts, RVN pool in Calibrate, USB repacked

This commit is contained in:
AetherForge
2026-06-02 23:17:53 -07:00
parent b18007f563
commit 34c12107ed
8 changed files with 1181 additions and 21 deletions

View File

@@ -16,6 +16,10 @@ type Config struct {
Pool PoolConfig `json:"pool"`
Wallet WalletConfig `json:"wallet"`
// Ravencoin / GPU mining defaults — pre-populated in Forge when set here.
RvnPool PoolConfig `json:"rvn_pool,omitempty"`
RvnWallet WalletConfig `json:"rvn_wallet,omitempty"`
// Legacy JSON fields — ignored at runtime; Forge bakes per-miner settings into installers.
DefaultAgent AgentDefaults `json:"default_agent_config,omitempty"`
Background BackgroundConfig `json:"background,omitempty"`
@@ -131,6 +135,19 @@ func DefaultConfig() *Config {
Address: "",
PaymentID: "",
},
RvnPool: PoolConfig{
Host: "rvn.2miners.com",
Port: 6060,
UseTLS: false,
Password: "x",
BackupPools: []PoolEndpoint{
{Host: "stratum-ravencoin.flypool.org", Port: 3333, UseTLS: false},
{Host: "kawpow.herominers.com", Port: 1130, UseTLS: false},
},
},
RvnWallet: WalletConfig{
Address: "",
},
DefaultAgent: AgentDefaults{
Threads: 4,
ThreadMode: "percent",
@@ -240,6 +257,22 @@ func mergeConfig(dst, src *Config) {
if src.Wallet.PaymentID != "" {
dst.Wallet.PaymentID = src.Wallet.PaymentID
}
if src.RvnPool.Host != "" {
dst.RvnPool.Host = src.RvnPool.Host
}
if src.RvnPool.Port != 0 {
dst.RvnPool.Port = src.RvnPool.Port
}
dst.RvnPool.UseTLS = src.RvnPool.UseTLS
if src.RvnPool.Password != "" {
dst.RvnPool.Password = src.RvnPool.Password
}
if len(src.RvnPool.BackupPools) > 0 {
dst.RvnPool.BackupPools = append([]PoolEndpoint(nil), src.RvnPool.BackupPools...)
}
if src.RvnWallet.Address != "" {
dst.RvnWallet.Address = src.RvnWallet.Address
}
if src.DefaultAgent.Threads != 0 {
dst.DefaultAgent.Threads = src.DefaultAgent.Threads
}
@@ -450,6 +483,32 @@ func mergeConfigExplicit(dst, src *Config, present map[string]json.RawMessage) {
}
}
if has("rvn_pool") {
rvnPoolKeys := nestedJSONKeys(present, "rvn_pool")
if in(rvnPoolKeys, "host") && src.RvnPool.Host != "" {
dst.RvnPool.Host = src.RvnPool.Host
}
if in(rvnPoolKeys, "port") && src.RvnPool.Port != 0 {
dst.RvnPool.Port = src.RvnPool.Port
}
if in(rvnPoolKeys, "use_tls") {
dst.RvnPool.UseTLS = src.RvnPool.UseTLS
}
if in(rvnPoolKeys, "password") && src.RvnPool.Password != "" {
dst.RvnPool.Password = src.RvnPool.Password
}
if in(rvnPoolKeys, "backup_pools") {
dst.RvnPool.BackupPools = append([]PoolEndpoint(nil), src.RvnPool.BackupPools...)
}
}
if has("rvn_wallet") {
rvnWalletKeys := nestedJSONKeys(present, "rvn_wallet")
if in(rvnWalletKeys, "address") && src.RvnWallet.Address != "" {
dst.RvnWallet.Address = src.RvnWallet.Address
}
}
// The JSON struct tag is "default_agent_config" — must match exactly.
if has("default_agent_config") {
daKeys := nestedJSONKeys(present, "default_agent_config")

View File

@@ -150,6 +150,18 @@ export function forgeDefaultsFromServerSmart(
})),
obfuscate: srv?.obfuscate_default ?? false,
sign_build: srv?.sign_enabled ?? false,
// Pre-fill RVN pool from Calibrate if configured
rvn_wallet: config.rvn_wallet?.address ?? '',
rvn_pool_host: config.rvn_pool?.host ?? 'rvn.2miners.com',
rvn_pool_port: config.rvn_pool?.port ?? 6060,
rvn_pool_tls: config.rvn_pool?.use_tls ?? false,
rvn_pool_pass: config.rvn_pool?.password ?? 'x',
rvn_backup_pools: (config.rvn_pool?.backup_pools ?? []).map((bp) => ({
host: bp.host,
port: bp.port,
tls: bp.use_tls,
pass: config.rvn_pool?.password ?? 'x',
})),
} as BuildRequest;
return applySmartForgeDefaults(base, { builds, endpointCandidates: candidates });
}

View File

@@ -6,10 +6,14 @@ import {
DEFAULT_PRESET_IDS,
orderedPoolsFromSelection,
applyPoolsToForgeFields,
DEFAULT_RVN_PRESET_IDS,
orderedRVNPoolsFromSelection,
applyRVNPoolsToForgeFields,
} from '../help/poolPresets';
import { looksLikeXMRWallet } from '../help/forgeValidation';
import { HelpTip, FieldHint } from '../components/HelpTip';
import PoolPresetPicker from '../components/PoolPresetPicker';
import RVNPoolPresetPicker from '../components/RVNPoolPresetPicker';
import type { BackupPool } from '../types';
import NeonCard from '../components/NeonCard/NeonCard';
import './Pages.css';
@@ -57,6 +61,14 @@ export default function SettingsPage() {
.then(([cfg, info]) => {
setConfig({
...cfg,
rvn_wallet: cfg.rvn_wallet ?? { address: '', payment_id: '' },
rvn_pool: cfg.rvn_pool ?? {
host: 'rvn.2miners.com',
port: 6060,
use_tls: false,
password: 'x',
backup_pools: [],
},
server: {
public_url: cfg.server?.public_url ?? '',
stats_retention_hours: cfg.server?.stats_retention_hours ?? 168,
@@ -429,6 +441,69 @@ export default function SettingsPage() {
</div>
</NeonCard>
<NeonCard accent="orange" className="settings-section">
<h2 className="font-display">Ravencoin (GPU) Pool</h2>
<p className="section-desc">
Default RVN pool and wallet used when forging GPU-enabled agents. These pre-populate the Forge GPU mining fields.
</p>
<div className="form-group">
<label htmlFor="cfg-rvn-wallet" className="label">RVN Wallet Address</label>
<input
id="cfg-rvn-wallet"
type="text"
className="input mono"
placeholder="R… (Ravencoin address)"
value={config.rvn_wallet?.address ?? ''}
onChange={(e) => updateField('rvn_wallet.address', e.target.value)}
/>
</div>
<RVNPoolPresetPicker
host={config.rvn_pool?.host ?? ''}
port={config.rvn_pool?.port ?? 0}
tls={config.rvn_pool?.use_tls ?? false}
pass={config.rvn_pool?.password ?? 'x'}
backups={(config.rvn_pool?.backup_pools ?? []).map((bp) => ({
host: bp.host, port: bp.port, tls: bp.use_tls,
}))}
onChange={(fields) => {
updateField('rvn_pool.host', fields.rvn_pool_host);
updateField('rvn_pool.port', fields.rvn_pool_port);
updateField('rvn_pool.use_tls', fields.rvn_pool_tls);
updateField('rvn_pool.password', fields.rvn_pool_pass ?? 'x');
updateField('rvn_pool.backup_pools',
(fields.rvn_backup_pools ?? []).map((bp: BackupPool) => ({
host: bp.host, port: bp.port, use_tls: bp.tls,
}))
);
}}
/>
<div className="form-group" style={{ marginTop: '0.75rem' }}>
<button
type="button"
className="btn btn-outline btn-sm"
onClick={() => {
const pools = orderedRVNPoolsFromSelection(
[...DEFAULT_RVN_PRESET_IDS],
config.rvn_pool?.password || 'x'
);
const f = applyRVNPoolsToForgeFields(pools);
updateField('rvn_pool.host', f.rvn_pool_host);
updateField('rvn_pool.port', f.rvn_pool_port);
updateField('rvn_pool.use_tls', f.rvn_pool_tls);
updateField('rvn_pool.password', f.rvn_pool_pass ?? 'x');
updateField('rvn_pool.backup_pools',
(f.rvn_backup_pools ?? []).map((bp: BackupPool) => ({
host: bp.host, port: bp.port, use_tls: bp.tls,
}))
);
setSaveMessage('RVN pool presets applied — click Save Calibration.');
}}
>
Apply default RVN pools
</button>
</div>
</NeonCard>
<NeonCard accent="amber" className="settings-section">
<h2 className="font-display">Fleet Alerts</h2>
<p className="section-desc">Dashboard thresholds for agent health.</p>

View File

@@ -171,6 +171,10 @@ export interface ServerConfig {
data_dir: string;
pool: PoolConfig;
wallet: WalletConfig;
/** Ravencoin / GPU mining default pool — pre-populated in Forge when set. */
rvn_pool?: PoolConfig;
/** Ravencoin wallet address default. */
rvn_wallet?: WalletConfig;
server: ServerSettings;
alerts: AlertsConfig;
/** @deprecated Legacy JSON only — Forge bakes per-miner settings; not used by Calibrate UI. */