Skip to content

Commit

Permalink
Merge branch 'main' into build-monero
Browse files Browse the repository at this point in the history
  • Loading branch information
brianp authored Oct 24, 2024
2 parents 6d60472 + 42a1ebf commit 299a7bd
Show file tree
Hide file tree
Showing 36 changed files with 86 additions and 11 deletions.
5 changes: 4 additions & 1 deletion public/locales/af/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
"disconnect": "Ontkoppel van Airdrop",
"inviteCode": "Uitnodigingskode",
"use-tor": "Gebruik Tor",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "Beursie invoer",
"action-requires-restart": "Hierdie aksie vereis \"n herbegin om veranderinge toe te pas",
"low-hash-rate-warning": "Jou hash rate is baie laag. Probeer om alle toepassings behalwe Tari Universe te sluit",
Expand All @@ -85,4 +88,4 @@
"invalid-control-port": "Control Port configuration is invalid",
"invalid-bridge": "Bridge configuration is invalid"
}
}
}
5 changes: 4 additions & 1 deletion public/locales/cn/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "断开与空投的连接",
"inviteCode": "邀请代码",
"use-tor": "使用Tor",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "正在导入钱包",
"action-requires-restart": "此操作需要重启以应用更改",
"low-hash-rate-warning": "您的哈希率非常低。尝试关闭除Tari Universe以外的所有应用程序",
Expand All @@ -85,4 +88,4 @@
"invalid-control-port": "Control Port configuration is invalid",
"invalid-bridge": "Bridge configuration is invalid"
}
}
}
5 changes: 3 additions & 2 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@

"update-versions": "Update versions",
"use-tor": "Use Tor",

"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"visual-mode": "Visual mode",

"yes": "Yes",
"your-feedback": "Describe your issue, including your Telegram handle if you have one, so that we can contact you with updates.",
"your-reference": "Your reference:<br/><bold>{{logRef}}</bold>",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@
"tari-wallet-address": "Tari Wallet Address",
"seed-words": "Mots de récupération",
"feedback-required": "Les commentaires sont requis",
"low-hash-rate-warning": "Votre hashrate est très bas. Essayez de fermer toutes les applications sauf Tari Universe",
"reset-permanently": "Êtes-vous sûr de vouloir réinitialiser tous les paramètres de manière permanente ?",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"low-hash-rate-warning": "Votre hashrate est très bas. Essayez de fermer toutes les applications sauf Tari Universe",
"yes": "Yes",
"cancel": "Cancel",
"report-issue": "Signaler un problème",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/hi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "एयरड्रॉप से डिस्कनेक्ट करें",
"inviteCode": "आमंत्रण कोड",
"use-tor": "टोर का उपयोग करें",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "वॉलेट आयात किया जा रहा है",
"action-requires-restart": "इस क्रिया के लिए परिवर्तनों को लागू करने हेतु पुनः आरंभ करना आवश्यक है",
"low-hash-rate-warning": "आपकी हैश रेट बहुत कम है। Tari Universe के अलावा सभी ऐप्स को बंद करने का प्रयास करें",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "Putuskan dari Airdrop",
"inviteCode": "Kode Undangan",
"use-tor": "Gunakan Tor",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "Mengimpor dompet",
"action-requires-restart": "Tindakan ini memerlukan restart untuk menerapkan perubahan",
"low-hash-rate-warning": "Hashrate Anda sangat rendah. Coba tutup semua aplikasi selain Tari Universe",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "エアドロップから切断",
"inviteCode": "招待コード",
"use-tor": "Torを使用する",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "ウォレットのインポート",
"action-requires-restart": "この操作には再起動が必要です。変更を適用します",
"low-hash-rate-warning": "ハッシュレートが非常に低いです。Tari Universe以外のすべてのアプリを閉じてみてください",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/ko/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "에어드롭 연결 해제",
"inviteCode": "초대 코드",
"use-tor": "Tor 사용하기",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "지갑 가져오기",
"action-requires-restart": "이 작업은 변경 사항을 적용하기 위해 재시작이 필요합니다",
"low-hash-rate-warning": "해시레이트가 매우 낮습니다. Tari Universe 외의 모든 앱을 닫아보세요",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/pl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"applyInviteCode": "Zastosuj Kod Zaproszenia",
"disconnect": "Odłącz od Airdrop",
"inviteCode": "Kod Zaproszenia",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"use-tor": "Używaj Tor",
"importing-wallet": "Importowanie portfela",
"action-requires-restart": "Ta akcja wymaga ponownego uruchomienia, aby wprowadzić zmiany",
Expand Down
3 changes: 3 additions & 0 deletions public/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "Отключиться от Airdrop",
"inviteCode": "Код приглашения",
"use-tor": "Использовать Tor",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Network",
"importing-wallet": "Импорт кошелька",
"action-requires-restart": "Для применения изменений требуется перезапуск",
"low-hash-rate-warning": "Ваш хешрейт очень низкий. Попробуйте закрыть все приложения, кроме Tari Universe",
Expand Down
5 changes: 4 additions & 1 deletion public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"disconnect": "Airdrop\"tan Bağlantıyı Kes",
"inviteCode": "Davet Kodu",
"use-tor": "Tor Kullan",
"sha-network-hash-rate": "Sha3 network hashrate",
"randomx-network-hash-rate": "Randomx network hashrate",
"network": "Sieć",
"importing-wallet": "Cüzdan İçe Aktarılıyor",
"action-requires-restart": "Bu işlem değişikliklerin uygulanması için yeniden başlatma gerektirir",
"low-hash-rate-warning": "Hashrate\"iniz çok düşük. Tari Evreni dışındaki tüm uygulamaları kapatmayı deneyin",
Expand All @@ -85,4 +88,4 @@
"invalid-control-port": "Control Port configuration is invalid",
"invalid-bridge": "Bridge configuration is invalid"
}
}
}
Binary file added src-tauri/beta-icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square107x107Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square142x142Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square284x284Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square30x30Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square310x310Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square71x71Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/Square89x89Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/beta-icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/beta-icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/beta-icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/beta-icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/beta-icons/systray_icon.icns
Binary file not shown.
Binary file added src-tauri/beta-icons/systray_icon.ico
Binary file not shown.
Binary file added src-tauri/beta-icons/systray_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src-tauri/beta-icons/tari.png
Binary file not shown.
7 changes: 5 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ async fn get_app_config(
Ok(state.config.read().await.clone())
}

#[allow(clippy::too_many_lines)]
#[tauri::command]
async fn get_miner_metrics(
state: tauri::State<'_, UniverseAppState>,
Expand Down Expand Up @@ -1609,7 +1610,6 @@ async fn get_miner_metrics(
.write()
.await
.load_status_file(config_path);

let hardware_status = HardwareMonitor::current()
.write()
.await
Expand All @@ -1635,6 +1635,8 @@ async fn get_miner_metrics(
}

let ret = MinerMetrics {
sha_network_hash_rate: sha_hash_rate,
randomx_network_hash_rate: randomx_hash_rate,
cpu: CpuMinerMetrics {
hardware: hardware_status.cpu,
mining: cpu_mining_status,
Expand All @@ -1653,7 +1655,6 @@ async fn get_miner_metrics(
};
let mut lock = state.cached_miner_metrics.write().await;
*lock = Some(ret.clone());

state
.is_getting_miner_metrics
.store(false, Ordering::SeqCst);
Expand Down Expand Up @@ -1789,6 +1790,8 @@ pub struct GpuMinerMetrics {

#[derive(Debug, Serialize, Clone)]
pub struct MinerMetrics {
sha_network_hash_rate: u64,
randomx_network_hash_rate: u64,
cpu: CpuMinerMetrics,
gpu: GpuMinerMetrics,
base_node: BaseNodeStatus,
Expand Down
28 changes: 25 additions & 3 deletions src/containers/Settings/sections/experimental/DebugSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ import {
} from '@app/containers/Settings/components/SettingsGroup.styles.ts';
import { useBlockchainVisualisationStore } from '@app/store/useBlockchainVisualisationStore';
import { useMemo } from 'react';
import { formatHashrate } from '@app/utils/formatHashrate';

export default function DebugSettings() {
const { t } = useTranslation(['common', 'settings'], { useSuspense: false });
const lastBlockTime = useBlockchainVisualisationStore((state) => state.debugBlockTime);
const isConnectedToTariNetwork = useMiningStore((s) => s.base_node?.is_connected);
const connectedPeers = useMiningStore((state) => state.base_node?.connected_peers || []);
const sha_network_hash_rate = useMiningStore((state) => state?.sha_network_hash_rate);
const randomx_network_hash_rate = useMiningStore((state) => state?.randomx_network_hash_rate);

const displayTime = useMemo(() => {
if (!lastBlockTime) return '-';
Expand Down Expand Up @@ -50,11 +53,30 @@ export default function DebugSettings() {
</SettingsGroup>
</SettingsGroupWrapper>
<SettingsGroupWrapper>
<SettingsGroupTitle>
<Typography variant="h6">{t('connected-peers', { ns: 'settings' })}</Typography>
</SettingsGroupTitle>
<SettingsGroup>
<SettingsGroupContent>
<SettingsGroupTitle>
<Typography variant="h6">{t('network', { ns: 'settings' })}</Typography>
</SettingsGroupTitle>
</SettingsGroupContent>
</SettingsGroup>
<SettingsGroup>
<SettingsGroupContent style={{ fontSize: '11px' }}>
<Stack direction="row" justifyContent="space-between">
<Typography variant="p">{t('sha-network-hash-rate', { ns: 'settings' })}</Typography>
<Typography>{formatHashrate(sha_network_hash_rate || 0)}</Typography>
</Stack>
<Stack direction="row" justifyContent="space-between">
<Typography variant="p">{t('randomx-network-hash-rate', { ns: 'settings' })}</Typography>
<Typography>{formatHashrate(randomx_network_hash_rate || 0)}</Typography>
</Stack>
</SettingsGroupContent>
</SettingsGroup>
<SettingsGroup>
<SettingsGroupContent>
<Typography variant="p">{t('connected-peers', { ns: 'settings' })}</Typography>
</SettingsGroupContent>
<SettingsGroupContent style={{ fontSize: '11px', textAlign: 'right' }}>
{connectedPeers?.length
? connectedPeers.map((peer, i) => (
<Typography key={`peer-${peer}:${i}`}>
Expand Down
2 changes: 2 additions & 0 deletions src/store/useMiningStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ interface Actions {
type MiningStoreState = State & Actions;

const initialState: State = {
sha_network_hash_rate: 0,
randomx_network_hash_rate: 0,
counter: 0,
hashrateReady: false,
miningInitiated: false,
Expand Down
2 changes: 2 additions & 0 deletions src/types/app-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export interface GpuMinerMetrics {
}

export interface MinerMetrics {
sha_network_hash_rate: number;
randomx_network_hash_rate: number;
cpu: CpuMinerMetrics;
gpu: GpuMinerMetrics;
base_node: BaseNodeStatus;
Expand Down
15 changes: 15 additions & 0 deletions src/utils/formatHashrate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function formatHashrate(hashrate: number) {
if (hashrate < 1000) {
return hashrate + ' H/s';
} else if (hashrate < 1000000) {
return (hashrate / 1000).toFixed(2) + ' kH/s';
} else if (hashrate < 1000000000) {
return (hashrate / 1000000).toFixed(2) + ' MH/s';
} else if (hashrate < 1000000000000) {
return (hashrate / 1000000000).toFixed(2) + ' GH/s';
} else if (hashrate < 1000000000000000) {
return (hashrate / 1000000000000).toFixed(2) + ' TH/s';
} else {
return (hashrate / 1000000000000000).toFixed(2) + ' PH/s';
}
}

0 comments on commit 299a7bd

Please sign in to comment.