Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e6388d2
dart format ./miner-app
illuzen Jan 31, 2026
0f46e15
quic
illuzen Jan 31, 2026
4421f05
indirect chainId
illuzen Jan 31, 2026
2e039fa
split into sub-services
illuzen Jan 31, 2026
18f265b
better logging
illuzen Jan 31, 2026
b27fae6
split up MinerProcess into smaller files
illuzen Feb 2, 2026
3ccc267
separate buttons for node and miner
illuzen Feb 2, 2026
6de1911
various bug fixes
illuzen Feb 2, 2026
87d6b45
better state handling
illuzen Feb 2, 2026
57c5e7e
improve logs, refactor shared process manager code
illuzen Feb 2, 2026
2b08467
Merge branch 'main' into illuzen/quic-mining
illuzen Feb 2, 2026
0a2419a
Merge branch 'main' into illuzen/wormhole
illuzen Feb 21, 2026
61ad03d
Merge branch 'main' into illuzen/wormhole
illuzen Feb 25, 2026
a11a6d2
merge main into wormhole
illuzen Feb 25, 2026
f72a05b
wormhole support in sdk
illuzen Feb 25, 2026
9349859
miner wallet service
illuzen Feb 25, 2026
09703e5
balance card and withdrawal
illuzen Feb 25, 2026
e3309a2
generate circuit on first withdrawal...
illuzen Feb 25, 2026
585931b
tracking wormhole utxos
illuzen Mar 2, 2026
5efa5de
added planck generated code
illuzen Mar 2, 2026
959a88d
updated sdk paths
illuzen Mar 2, 2026
49edb67
format generated code
n13 Mar 2, 2026
4fb249e
Merge branch 'illuzen/wormhole' of github.com:Quantus-Network/quantus…
n13 Mar 2, 2026
aeed778
Planck not Schrodinger
illuzen Mar 2, 2026
a744e5d
add rayon feature to speed it up
illuzen Mar 2, 2026
3f37297
do release build from xcode
illuzen Mar 2, 2026
803d504
N13/wormhole fix hash (#409)
n13 Mar 2, 2026
bca4fda
implement _addressToHex (#410)
n13 Mar 2, 2026
4b12598
confirm withdrawal
illuzen Mar 2, 2026
910efe5
dart format .
illuzen Mar 2, 2026
990e9b2
add circuit manager
illuzen Mar 2, 2026
13e91b8
ok the aggregation works but it doesn't verify on chain :/
illuzen Mar 2, 2026
3daf01d
export circuit_manager.dart
illuzen Mar 3, 2026
c0812d9
submit unsigned added (#412)
n13 Mar 3, 2026
064284c
fix log view jitter
illuzen Mar 3, 2026
4a6f747
handle events from wormholes
illuzen Mar 3, 2026
c31e518
handle utxos correctly
illuzen Mar 5, 2026
7c0aacd
move wormhole logic into sdk
illuzen Mar 5, 2026
a0c3aaf
build circuits on cargo build
illuzen Mar 16, 2026
6502953
Merge branch 'main' of https://github.com/Quantus-Network/quantus-app…
dewabisma Mar 23, 2026
feb8385
chore: formatting
dewabisma Mar 23, 2026
92b61f2
fix: debug build not properly signed and can't access secure storage …
dewabisma Mar 23, 2026
d75a33b
update to new poseidon api
illuzen Mar 24, 2026
92430fc
Merge branch 'illuzen/wormhole' of github.com:Quantus-Network/quantus…
illuzen Mar 24, 2026
02127f1
Merge branch 'main' of https://github.com/Quantus-Network/quantus-app…
dewabisma Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
359 changes: 245 additions & 114 deletions miner-app/lib/features/miner/miner_balance_card.dart

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions miner-app/lib/features/miner/miner_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:quantus_miner/src/config/miner_config.dart';
import 'package:quantus_miner/src/services/miner_wallet_service.dart';
import 'package:quantus_miner/src/services/mining_orchestrator.dart';
import 'package:quantus_miner/src/services/mining_stats_service.dart';
import 'package:quantus_miner/src/shared/extensions/snackbar_extensions.dart';
import 'package:quantus_miner/src/utils/app_logger.dart';
import 'package:quantus_sdk/quantus_sdk.dart';

import '../../main.dart';
import '../../src/services/binary_manager.dart';
Expand Down Expand Up @@ -98,10 +100,23 @@ class _MinerControlsState extends State<MinerControls> {
setState(() => _chainId = chainId);
}

// Get rewards preimage directly from the wallet (not from file)
final walletService = MinerWalletService();
final wormholeKeyPair = await walletService.getWormholeKeyPair();
if (wormholeKeyPair == null) {
_log.w('No wormhole keypair - wallet not set up');
if (mounted) {
context.showWarningSnackbar(
title: 'Wallet not configured!',
message: 'Please set up your rewards address first.',
);
}
return;
}

// Check for required files
final quantusHome = await BinaryManager.getQuantusHomeDirectoryPath();
final identityFile = File('$quantusHome/node_key.p2p');
final rewardsFile = File('$quantusHome/rewards-address.txt');
final nodeBinPath = await BinaryManager.getNodeBinaryFilePath();
final nodeBin = File(nodeBinPath);
final minerBinPath = await BinaryManager.getExternalMinerBinaryFilePath();
Expand All @@ -115,6 +130,21 @@ class _MinerControlsState extends State<MinerControls> {
return;
}

// Log comprehensive wormhole derivation info for debugging
_log.i('=== WORMHOLE DERIVATION DEBUG ===');
_log.i('Preimage (SS58): ${wormholeKeyPair.rewardsPreimage}');
_log.i('Preimage (hex): ${wormholeKeyPair.rewardsPreimageHex}');
_log.i('Address (SS58): ${wormholeKeyPair.address}');
_log.i('Address (hex): ${wormholeKeyPair.addressHex}');
_log.i('Secret (hex): ${wormholeKeyPair.secretHex.substring(0, 10)}...[redacted]');

// Verify: compute address from preimage hex and check it matches
final wormholeService = WormholeService();
final verifiedAddress = wormholeService.preimageToAddress(wormholeKeyPair.rewardsPreimageHex);
_log.i('Verified addr: $verifiedAddress');
_log.i('Addresses match: ${verifiedAddress == wormholeKeyPair.address}');
_log.i('=================================');

// Create new orchestrator
final orchestrator = MiningOrchestrator();
widget.onOrchestratorChanged(orchestrator);
Expand All @@ -125,7 +155,8 @@ class _MinerControlsState extends State<MinerControls> {
nodeBinary: nodeBin,
minerBinary: minerBin,
identityFile: identityFile,
rewardsFile: rewardsFile,
rewardsPreimage: wormholeKeyPair.rewardsPreimage,
wormholeAddress: wormholeKeyPair.address,
chainId: _chainId,
cpuWorkers: _cpuWorkers,
gpuDevices: _gpuDevices,
Expand Down
29 changes: 27 additions & 2 deletions miner-app/lib/features/miner/miner_dashboard_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:quantus_miner/features/miner/miner_balance_card.dart';
import 'package:quantus_miner/features/miner/miner_app_bar.dart';
import 'package:quantus_miner/features/miner/miner_stats_card.dart';
Expand Down Expand Up @@ -36,6 +37,9 @@ class _MinerDashboardScreenState extends State<MinerDashboardScreen> {

MiningStats _miningStats = MiningStats.empty();

// Key to force balance card refresh (incremented after withdrawal)
int _balanceRefreshKey = 0;

// The orchestrator manages all mining operations
MiningOrchestrator? _orchestrator;

Expand Down Expand Up @@ -381,21 +385,42 @@ class _MinerDashboardScreenState extends State<MinerDashboardScreen> {
);
}

void _onWithdraw(BigInt balance, String address, String secretHex) {
context.push('/withdraw', extra: {'balance': balance, 'address': address, 'secretHex': secretHex}).then((_) {
// Refresh balance when returning from withdrawal screen
if (mounted) {
setState(() {
_balanceRefreshKey++;
});
}
});
}

Widget _buildResponsiveCards() {
return LayoutBuilder(
builder: (context, constraints) {
if (constraints.maxWidth > 800) {
return Row(
children: [
Expanded(child: MinerBalanceCard(currentBlock: _miningStats.currentBlock)),
Expanded(
child: MinerBalanceCard(
currentBlock: _miningStats.currentBlock,
onWithdraw: _onWithdraw,
refreshKey: _balanceRefreshKey,
),
),
const SizedBox(width: 16),
Expanded(child: MinerStatsCard(miningStats: _miningStats)),
],
);
} else {
return Column(
children: [
MinerBalanceCard(currentBlock: _miningStats.currentBlock),
MinerBalanceCard(
currentBlock: _miningStats.currentBlock,
onWithdraw: _onWithdraw,
refreshKey: _balanceRefreshKey,
),
MinerStatsCard(miningStats: _miningStats),
],
);
Expand Down
Loading
Loading