diff --git a/README.md b/README.md index 90a92355f..6d62e61e9 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# Filecoin Station +# Checker [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai/) [![](https://img.shields.io/badge/project-Filecoin-blue.svg?style=flat-square)](https://filecoin.io/) -[![ci](https://github.com/filecoin-station/desktop/actions/workflows/ci.yml/badge.svg)](https://github.com/filecoin-station/desktop/actions/workflows/ci.yml) +[![ci](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml/badge.svg)](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml) -Filecoin Station is a desktop app that connects your computer’s idle resources +Checker is a desktop app that connects your computer’s idle resources to the Filecoin network and rewards you with Filecoin. Taking part is simple, just launch the app and start earning. Learn more at -[filstation.app](https://filstation.app). +[app.checker.network](https://app.checker.network). ## Install -Release notes and all versions of Filecoin Station can be found on the -[releases page](https://github.com/filecoin-station/desktop/releases). +Release notes and all versions of Checker can be found on the +[releases page](https://github.com/CheckerNetwork/app/releases). Each release has packages for desktop platforms: diff --git a/SECURITY.md b/SECURITY.md index b259c68d2..87cf5f80f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -33,4 +33,4 @@ as a security vulnerability, . ## Reporting a non security bug For non-security bugs, please simply file a GitHub -[issue](https://github.com/filecoin-station/desktop/issues/new). +[issue](https://github.com/CheckerNetwork/app/issues/new). diff --git a/assets/tray/off-macos.png b/assets/tray/off-macos.png index 7e7fcfd09..8bbd54539 100644 Binary files a/assets/tray/off-macos.png and b/assets/tray/off-macos.png differ diff --git a/assets/tray/off-macos@2x.png b/assets/tray/off-macos@2x.png index b53e0f4c2..ef2ccf3be 100644 Binary files a/assets/tray/off-macos@2x.png and b/assets/tray/off-macos@2x.png differ diff --git a/assets/tray/off-macos@3x.png b/assets/tray/off-macos@3x.png index b0c9c9ca5..23ab09edb 100644 Binary files a/assets/tray/off-macos@3x.png and b/assets/tray/off-macos@3x.png differ diff --git a/assets/tray/off.png b/assets/tray/off.png index 9b9f109ad..35251e9c4 100644 Binary files a/assets/tray/off.png and b/assets/tray/off.png differ diff --git a/assets/tray/on-macos.png b/assets/tray/on-macos.png index 11d3792ba..92c0d88ca 100644 Binary files a/assets/tray/on-macos.png and b/assets/tray/on-macos.png differ diff --git a/assets/tray/on-macos@2x.png b/assets/tray/on-macos@2x.png index 915a48c83..098878e91 100644 Binary files a/assets/tray/on-macos@2x.png and b/assets/tray/on-macos@2x.png differ diff --git a/assets/tray/on-macos@3x.png b/assets/tray/on-macos@3x.png index d7c32f1f6..92e10fb15 100644 Binary files a/assets/tray/on-macos@3x.png and b/assets/tray/on-macos@3x.png differ diff --git a/assets/tray/on.png b/assets/tray/on.png index 0a34b7fba..db471cc0a 100644 Binary files a/assets/tray/on.png and b/assets/tray/on.png differ diff --git a/assets/tray/update-macos.png b/assets/tray/update-macos.png index 2aea6158e..4f1957fa3 100644 Binary files a/assets/tray/update-macos.png and b/assets/tray/update-macos.png differ diff --git a/assets/tray/update-macos@2x.png b/assets/tray/update-macos@2x.png index 63c619fdc..59ad78341 100644 Binary files a/assets/tray/update-macos@2x.png and b/assets/tray/update-macos@2x.png differ diff --git a/assets/tray/update-macos@3x.png b/assets/tray/update-macos@3x.png index efdc29a53..c7150da54 100644 Binary files a/assets/tray/update-macos@3x.png and b/assets/tray/update-macos@3x.png differ diff --git a/assets/tray/update-off-macos.png b/assets/tray/update-off-macos.png index a51fcbdd4..b76ac3908 100644 Binary files a/assets/tray/update-off-macos.png and b/assets/tray/update-off-macos.png differ diff --git a/assets/tray/update-off-macos@2x.png b/assets/tray/update-off-macos@2x.png index 9760c257a..3904ce822 100644 Binary files a/assets/tray/update-off-macos@2x.png and b/assets/tray/update-off-macos@2x.png differ diff --git a/assets/tray/update-off-macos@3x.png b/assets/tray/update-off-macos@3x.png index 208d5c4a4..007c264b4 100644 Binary files a/assets/tray/update-off-macos@3x.png and b/assets/tray/update-off-macos@3x.png differ diff --git a/assets/tray/update-off.png b/assets/tray/update-off.png index f313c6aaf..84450e079 100644 Binary files a/assets/tray/update-off.png and b/assets/tray/update-off.png differ diff --git a/assets/tray/update-on.png b/assets/tray/update-on.png index 4530e5998..fa821f3ad 100644 Binary files a/assets/tray/update-on.png and b/assets/tray/update-on.png differ diff --git a/build/after-pack.js b/build/after-pack.js index a122ab831..9cbe7e854 100644 --- a/build/after-pack.js +++ b/build/after-pack.js @@ -29,7 +29,7 @@ exports.default = async function (context) { { cwd: join( context.appOutDir, - 'Filecoin Station.app', + 'Checker.app', 'Contents', 'Resources', 'core' diff --git a/build/icon.icns b/build/icon.icns index 827a47adb..a28c4d2e6 100644 Binary files a/build/icon.icns and b/build/icon.icns differ diff --git a/build/icon.ico b/build/icon.ico index d56f2628b..b653b5b3e 100644 Binary files a/build/icon.ico and b/build/icon.ico differ diff --git a/build/icon.png b/build/icon.png index bd7783ac1..2134f02e8 100644 Binary files a/build/icon.png and b/build/icon.png differ diff --git a/build/installerSidebar.bmp b/build/installerSidebar.bmp index 44a71447d..74073863a 100644 Binary files a/build/installerSidebar.bmp and b/build/installerSidebar.bmp differ diff --git a/build/installerSidebar.png b/build/installerSidebar.png index d09234dc6..4eee1b421 100644 Binary files a/build/installerSidebar.png and b/build/installerSidebar.png differ diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index 5b7ae9a59..3415bcd8f 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -6,8 +6,8 @@ ```mermaid graph - fil-stat-repo(github.com/filecoin-station/desktop) --> fil-stat-main(Station main process) - fil-stat-repo --> fil-stat-webui(Station WebUI) + fil-stat-repo(github.com/CheckerNetwork/app) --> fil-stat-main(Checker main process) + fil-stat-repo --> fil-stat-webui(Checker WebUI) saturn-l2-repo(https://github.com/filecoin-project/saturn-l2) --> saturn-l2-go(Saturn L2 Node binary) @@ -23,7 +23,7 @@ graph Repositories: -- https://github.com/filecoin-station/desktop +- https://github.com/CheckerNetwork/app - https://github.com/filecoin-saturn/L2-node - https://github.com/filecoin-project/saturn-webui @@ -32,8 +32,8 @@ Repositories: 1. `filecoin-project/saturn-webui` publishes a new release with WebUI assets 2. `filecoin-saturn/L2-node` is updated to use the new `saturn-webui` version 3. `filecoin-saturn/L2-node` publishes a new release -4. `filecoin-station/desktop` is updated to use the new `L2-node` version -5. `filecoin-station/desktop` publishes a new release +4. `CheckerNetwork/app` is updated to use the new `L2-node` version +5. `CheckerNetwork/app` publishes a new release ## Development workflow diff --git a/docs/RELEASE_PROCESS.md b/docs/RELEASE_PROCESS.md index 275e9641f..e78f9a256 100644 --- a/docs/RELEASE_PROCESS.md +++ b/docs/RELEASE_PROCESS.md @@ -1,6 +1,6 @@ ## Overview -Filecoin Station uses +Checker uses [electron-build/auto-update](https://www.electron.build/auto-update) and a modified flow from [Electron Builder Action](https://github.com/samuelmeuli/action-electron-builder#electron-builder-action): @@ -38,12 +38,12 @@ modified flow from ``` 1. Wait for GitHub Actions CI to upload the binaries to a draft release - [here](https://github.com/filecoin-station/desktop/releases) (a new + [here](https://github.com/CheckerNetwork/app/releases) (a new one will be created if you haven't drafted one). 1. Review and publish the release draft. - Once a release is published, users will receive the app update - The `latest.yml, latest-mac.yml, latest-linux.yml` files attached to - [/releases](https://github.com/filecoin-station/desktop/releases) + [/releases](https://github.com/CheckerNetwork/app/releases) are used by the desktop app to determine when an app update is available. 1. Done! @@ -56,12 +56,12 @@ modified flow from 4. Publish local changes and the tag to the GitHub repo: `git push && git push origin vA.B.C`. 5. Wait for GitHub Actions CI to upload the binaries to a draft release - [here](https://github.com/filecoin-station/desktop/releases) (a new + [here](https://github.com/CheckerNetwork/app/releases) (a new one will be created if you haven't drafted one). 6. Review and publish the release draft. - Once a release is published, users will receive the app update - The `latest.yml, latest-mac.yml, latest-linux.yml` files attached to - [/releases](https://github.com/filecoin-station/desktop/releases) + [/releases](https://github.com/CheckerNetwork/app/releases) are used by the desktop app to determine when an app update is available. 7. Done! diff --git a/docs/MODULE_INTERFACE.md b/docs/SUBNET_INTERFACE.md similarity index 50% rename from docs/MODULE_INTERFACE.md rename to docs/SUBNET_INTERFACE.md index a80ebe05d..434ef4733 100644 --- a/docs/MODULE_INTERFACE.md +++ b/docs/SUBNET_INTERFACE.md @@ -1,20 +1,20 @@ -# Station module interface +# Checker subnet interface -1. A module itself is a long-running executable, which +1. A subnet itself is a long-running executable, which - performs its business logic - writes informative messages to `stdio` - exposes stats via a builtin webserver -1. A module needs to have its __binaries hosted__ on HTTPS accessible URLs, so that Station can download updates. Path patterns are flexible, GitHub Releases would be nice. +1. A subnet needs to have its __binaries hosted__ on HTTPS accessible URLs, so that Checker can download updates. Path patterns are flexible, GitHub Releases would be nice. Example: ``` https://github.com/filecoin-saturn/L2-node/releases ``` -1. A module should run on as many operating systems as possible, without requiring any prior setup before executing its binary. On macOS, x86 is required, arm64 nice to have. +1. A subnet should run on as many operating systems as possible, without requiring any prior setup before executing its binary. On macOS, x86 is required, arm64 nice to have. -2. A module can provide a custom __command string__ for launching its executable. Ideally a module doesn't require any extra arguments when launching. +2. A subnet can provide a custom __command string__ for launching its executable. Ideally a subnet doesn't require any extra arguments when launching. Example: ```bash @@ -22,12 +22,12 @@ $ bacalhau --foo=bar ``` -3. A module's executable gets passed the following environment variables: +3. A subnet's executable gets passed the following environment variables: - `FIL_WALLET_ADDRESS` The user's Filecoin wallet address - - `STATE_ROOT` The long-lived working directory on disk. The module must store + - `STATE_ROOT` The long-lived working directory on disk. The subnet must store all of its permanent files inside (subdirectories of) this directory. The directory isn't expected to be backed up or shared across machines in any way. - - `CACHE_ROOT` The temporary working directory on disk. The module must store + - `CACHE_ROOT` The temporary working directory on disk. The subnet must store all of its caches inside (subdirectories of) this directory. The directory isn't expected to be backed up or shared across machines in any way. @@ -36,17 +36,17 @@ $ FIL_WALLET_ADDRESS=f1... STATE_ROOT=~/.local/state/bacalhau CACHE_ROOT=~/.cache/bacalhau bacalhau ``` -4. A module communicates activity by writing to its `stdout` stream: - - `API: $1` The module has launched and `$1` can be queried for fetching module stats (see below) - - `INFO: $1` `$1` will be displayed to the user inside Station's Activity Log - - `ERROR: $1` `$1` will be displayed to the user inside Station's Activity Log, with a warning icon - - `$1` all log lines will be stored in a module-specific log file, which can be submitted to Sentry for error handling +4. A subnet communicates activity by writing to its `stdout` stream: + - `API: $1` The subnet has launched and `$1` can be queried for fetching subnet stats (see below) + - `INFO: $1` `$1` will be displayed to the user inside Checker's Activity Log + - `ERROR: $1` `$1` will be displayed to the user inside Checker's Activity Log, with a warning icon + - `$1` all log lines will be stored in a subnet-specific log file, which can be submitted to Sentry for error handling -5. A module is expected to have provided its `API` URL in `<=500ms` +5. A subnet is expected to have provided its `API` URL in `<=500ms` -6. A module's `stderr` will be stored in the same module-specific log file as its `stdout`, to be used for post-mortem debugging. +6. A subnet's `stderr` will be stored in the same subnet-specific log file as its `stdout`, to be used for post-mortem debugging. -7. A module exposes its stats via HTTP(S), on an address communicated via +7. A subnet exposes its stats via HTTP(S), on an address communicated via `stdout` (see above `API:`). The response will be a JSON object with at least the following fields: @@ -57,12 +57,12 @@ the following fields: ``` The number of jobs completed is expected to be a monotonically increasing - number. It's the responsibility of the module to persist this number across + number. It's the responsibility of the subnet to persist this number across process restarts, somewhere in `ROOT_DIR`. - The module may include additional fields in the JSON response, although - these will be ignored by Station. + The subnet may include additional fields in the JSON response, although + these will be ignored by Checker. -7. A module can be told to shut down via signal `SIGTERM` +7. A subnet can be told to shut down via signal `SIGTERM` -8. A module can shut down at any time, which is always considered an error. Its exit will be shown in Station's UI, and the last 100 lines of its output streams forwarded to Sentry. The module won't automatically be restarted by Station (for now). +8. A subnet can shut down at any time, which is always considered an error. Its exit will be shown in Checker's UI, and the last 100 lines of its output streams forwarded to Sentry. The subnet won't automatically be restarted by Checker (for now). diff --git a/electron-builder.yml b/electron-builder.yml index 3ccf8c83c..2b8ce41de 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,4 +1,4 @@ -appId: io.filecoin.station +appId: network.checker.app generateUpdatesFilesForAllChannels: true extraMetadata: @@ -58,8 +58,8 @@ nsis: linux: artifactName: ${name}-${os}-${arch}.${ext} - executableName: filecoin-station - icon: filecoin-station + executableName: checker + icon: checker category: Network;FileTransfer;P2P synopsis: A desktop client for Filecoin Retrieval Markets maintainer: changeme@example.com diff --git a/main/activities.js b/main/activities.js index 42a6a54c0..045217034 100644 --- a/main/activities.js +++ b/main/activities.js @@ -7,7 +7,7 @@ class Activities { /** @type {Activity[]} */ #activities = [] #online = { - spark: false, + spark: true, voyager: false } diff --git a/main/app-menu.js b/main/app-menu.js index 74f17b4bf..39bd86003 100644 --- a/main/app-menu.js +++ b/main/app-menu.js @@ -11,8 +11,8 @@ function setupAppMenu (/** @type {import('./typings').Context} */ ctx) { // File menu menu.items[1].submenu?.insert(0, new MenuItem({ - label: 'Save Module Logs As…', - click: () => { ctx.saveModuleLogsAs() } + label: 'Save Subnet Logs As…', + click: () => { ctx.saveSubnetLogsAs() } })) Menu.setApplicationMenu(menu) @@ -37,7 +37,7 @@ function setupCheckForUpdatesMenuItem (ctx, menu) { visible: false }) - // Filecoin Station menu + // Checker menu menu.items[0].submenu?.insert(1, checkForUpdates) menu.items[0].submenu?.insert(2, checkingForUpdates) } diff --git a/main/station-config.js b/main/checker-config.js similarity index 66% rename from main/station-config.js rename to main/checker-config.js index 414e08217..1194a7865 100644 --- a/main/station-config.js +++ b/main/checker-config.js @@ -5,11 +5,11 @@ const Store = require('electron-store') const log = require('electron-log').scope('config') const ConfigKeys = { - OnboardingCompleted: 'station.OnboardingCompleted', - TrayOperationExplained: 'station.TrayOperationExplained', - StationID: 'station.StationID', - FilAddress: 'station.FilAddress', - DestinationFilAddress: 'station.DestinationFilAddress' + OnboardingCompleted: 'checker.OnboardingCompleted', + TrayOperationExplained: 'checker.TrayOperationExplained', + CheckerID: 'checker.CheckerID', + FilAddress: 'checker.FilAddress', + DestinationFilAddress: 'checker.DestinationFilAddress' } // Use this to test migrations @@ -18,6 +18,31 @@ const ConfigKeys = { const configStore = new Store({ migrations: { + '>=3.0.0': store => { + const migration = [ + { + from: 'station.OnboardingCompleted', + to: ConfigKeys.OnboardingCompleted + }, { + from: 'station.TrayOperationExplained', + to: ConfigKeys.TrayOperationExplained + }, { + from: 'station.stationID', + to: ConfigKeys.CheckerID + }, { + from: 'station.FilAddress', + to: ConfigKeys.FilAddress + }, { + from: 'station.DestinationFilAddress', + to: ConfigKeys.DestinationFilAddress + } + ] + for (const { from, to } of migration) { + if (store.has(from)) { + store.set(to, store.get(from)) + } + } + }, '>=0.9.0': store => { if (store.has('station.onboardingCompleted')) { store.set( @@ -32,13 +57,13 @@ const configStore = new Store({ }, beforeEachMigration: (_, context) => { log.info( - `Migrating station-config from ${context.fromVersion} → ` + + `Migrating checker-config from ${context.fromVersion} → ` + context.toVersion ) } }) -log.info('Loading Station configuration from', configStore.path) +log.info('Loading Checker configuration from', configStore.path) let OnboardingCompleted = /** @type {boolean} */ diff --git a/main/consts.js b/main/consts.js index fb8677f4f..88d6ee766 100644 --- a/main/consts.js +++ b/main/consts.js @@ -9,9 +9,9 @@ const assert = require('assert') const { getBuildVersion } = require('./build-version') const appIDs = { - darwin: 'app.filstation.desktop', - win32: 'Filecoin Station Desktop', - linux: 'filecoin-station-desktop' + darwin: 'network.checker.app', + win32: 'Checker', + linux: 'checker' } module.exports = Object.freeze({ @@ -21,7 +21,7 @@ module.exports = Object.freeze({ IS_MAC: os.platform() === 'darwin', IS_WIN: os.platform() === 'win32', IS_APPIMAGE: typeof process.env.APPIMAGE !== 'undefined', - STATION_VERSION: packageJson.version, + CHECKER_VERSION: packageJson.version, BUILD_VERSION: getBuildVersion(packageJson), ELECTRON_VERSION: process.versions.electron @@ -30,8 +30,8 @@ module.exports = Object.freeze({ // Replace with `app.get('localUserData')` after this PR is landed & released: // https://github.com/electron/electron/pull/34337 function getCacheRoot () { - if (process.env.STATION_ROOT) { - return path.join(process.env.STATION_ROOT, 'cache') + if (process.env.CHECKER_ROOT) { + return path.join(process.env.CHECKER_ROOT, 'cache') } const platform = os.platform() @@ -55,8 +55,8 @@ function getCacheRoot () { } function getStateRoot () { - if (process.env.STATION_ROOT) { - return path.join(process.env.STATION_ROOT, 'state') + if (process.env.CHECKER_ROOT) { + return path.join(process.env.CHECKER_ROOT, 'state') } const platform = os.platform() @@ -87,8 +87,8 @@ function getStateRoot () { // Used for migrations function getLegacyCacheHome () { - if (process.env.STATION_ROOT) { - return path.join(process.env.STATION_ROOT, 'cache') + if (process.env.CHECKER_ROOT) { + return path.join(process.env.CHECKER_ROOT, 'cache') } const platform = os.platform() diff --git a/main/core.js b/main/core.js index 8fb1e0c7b..69f37ca0c 100644 --- a/main/core.js +++ b/main/core.js @@ -35,9 +35,9 @@ let totalJobsCompleted = 0 * @param {Context} ctx */ async function setup (ctx) { - ctx.saveModuleLogsAs = async () => { + ctx.saveSubnetLogsAs = async () => { const opts = { - defaultPath: `station-modules-${(new Date()).getTime()}.log` + defaultPath: `checker-subnets-${(new Date()).getTime()}.log` } // The dialog might not show if the UI is hidden ctx.showUI() @@ -67,7 +67,7 @@ function maybeReportErrorToSentry (err, scopeFn) { if (now - lastCrashReportedAt < 4 /* HOURS */ * 3600_000) return lastCrashReportedAt = now log.error( - 'Reporting the problem to Sentry for inspection by the Station team.' + 'Reporting the problem to Sentry for inspection by the Checker team.' ) Sentry.captureException(err, scopeFn) } diff --git a/main/index.js b/main/index.js index 32b5480a8..2a5d2e077 100644 --- a/main/index.js +++ b/main/index.js @@ -14,8 +14,8 @@ const log = electronLog.scope('main') // store. // https://www.npmjs.com/package/electron-store // https://www.electronjs.org/docs/latest/api/app#appgetpathname -if (process.env.STATION_ROOT) { - app.setPath('userData', path.join(process.env.STATION_ROOT, 'user-data')) +if (process.env.CHECKER_ROOT) { + app.setPath('userData', path.join(process.env.CHECKER_ROOT, 'user-data')) // Also set 'localUserData' after this PR is landed & released: // We are using localUserData for Saturn L2 cache @@ -44,7 +44,7 @@ const inTest = (process.env.NODE_ENV === 'test') const isDev = !app.isPackaged && !inTest log.info(format( - 'Filecoin Station build version: %s %s-%s%s%s', + 'Checker build version: %s %s-%s%s%s', BUILD_VERSION, os.platform(), os.arch(), @@ -65,7 +65,7 @@ if (app.runningUnderARM64Translation) { } // Expose additional metadata for Electron preload script -process.env.STATION_BUILD_VERSION = BUILD_VERSION +process.env.CHECKER_BUILD_VERSION = BUILD_VERSION function handleError (/** @type {any} */ err) { Sentry.captureException(err) @@ -83,7 +83,7 @@ process.on('unhandledRejection', handleError) // appUserModelID // See https://www.electronjs.org/docs/tutorial/notifications#windows if (process.platform === 'win32') { - app.setAppUserModelId('io.filecoin.station') + app.setAppUserModelId('network.checker.app') } // Only one instance can run at a time @@ -91,7 +91,7 @@ if (!inTest && !app.requestSingleInstanceLock()) { app.quit() } -// When the user attempts to start the app and didn't notice the Station icon in +// When the user attempts to start the app and didn't notice the Checker icon in // the tray, help them out by showing the main window app.on('second-instance', () => { ctx.showUI() @@ -124,7 +124,7 @@ const ctx = { getWalletBalance: () => wallet.getBalance(), manualCheckForUpdates: () => { throw new Error('never get here') }, - saveModuleLogsAs: () => { throw new Error('never get here') }, + saveSubnetLogsAs: () => { throw new Error('never get here') }, toggleOpenAtLogin: () => { throw new Error('never get here') }, isOpenAtLogin: () => { throw new Error('never get here') }, exportSeedPhrase: () => { throw new Error('never get here') }, diff --git a/main/ipc.js b/main/ipc.js index 320d36645..43d1082e0 100644 --- a/main/ipc.js +++ b/main/ipc.js @@ -2,97 +2,97 @@ const { ipcMain } = require('electron') -const stationConfig = require('./station-config') +const checkerConfig = require('./checker-config') const wallet = require('./wallet') /** @typedef {import('./typings').Context} Context */ const ipcMainEvents = Object.freeze({ - ACTIVITY_LOGGED: 'station:activity-logged', - JOB_STATS_UPDATED: 'station:job-stats-updated', + ACTIVITY_LOGGED: 'checker:activity-logged', + JOB_STATS_UPDATED: 'checker:job-stats-updated', - UPDATE_CHECK_STARTED: 'station:update-check:started', - UPDATE_CHECK_FINISHED: 'station:update-check:finished', - READY_TO_UPDATE: 'station:ready-to-update', + UPDATE_CHECK_STARTED: 'checker:update-check:started', + UPDATE_CHECK_FINISHED: 'checker:update-check:finished', + READY_TO_UPDATE: 'checker:ready-to-update', - TRANSACTION_UPDATE: 'station:transaction-update', - BALANCE_UPDATE: 'station:wallet-balance-update', - SCHEDULED_REWARDS_UPDATE: 'station:scheduled-rewards-update' + TRANSACTION_UPDATE: 'checker:transaction-update', + BALANCE_UPDATE: 'checker:wallet-balance-update', + SCHEDULED_REWARDS_UPDATE: 'checker:scheduled-rewards-update' }) function setupIpcMain (/** @type {Context} */ ctx) { - // Station-wide config + // Checker-wide config ipcMain.handle( - 'station:getOnboardingCompleted', - stationConfig.getOnboardingCompleted + 'checker:getOnboardingCompleted', + checkerConfig.getOnboardingCompleted ) ipcMain.handle( - 'station:setOnboardingCompleted', - (_event) => stationConfig.setOnboardingCompleted() + 'checker:setOnboardingCompleted', + (_event) => checkerConfig.setOnboardingCompleted() ) // Wallet-wide config - ipcMain.handle('station:getStationWalletAddress', wallet.getAddress) + ipcMain.handle('checker:getCheckerWalletAddress', wallet.getAddress) ipcMain.handle( - 'station:getDestinationWalletAddress', - stationConfig.getDestinationWalletAddress + 'checker:getDestinationWalletAddress', + checkerConfig.getDestinationWalletAddress ) ipcMain.handle( - 'station:setDestinationWalletAddress', - (_event, address) => stationConfig.setDestinationWalletAddress(address) + 'checker:setDestinationWalletAddress', + (_event, address) => checkerConfig.setDestinationWalletAddress(address) ) - ipcMain.handle('station:getStationWalletBalance', wallet.getBalance) + ipcMain.handle('checker:getCheckerWalletBalance', wallet.getBalance) ipcMain.handle( - 'station:getScheduledRewards', + 'checker:getScheduledRewards', ctx.getScheduledRewardsForAddress ) ipcMain.handle( - 'station:getStationWalletTransactionsHistory', + 'checker:getCheckerWalletTransactionsHistory', wallet.listTransactions ) ipcMain.handle( - 'station:transferAllFundsToDestinationWallet', + 'checker:transferAllFundsToDestinationWallet', (_event, _args) => wallet.transferAllFundsToDestinationWallet()) ipcMain.handle( - 'station:getActivities', + 'checker:getActivities', (_event, _args) => ctx.getActivities()) ipcMain.handle( - 'station:getTotalJobsCompleted', + 'checker:getTotalJobsCompleted', (_event, _args) => ctx.getTotalJobsCompleted()) ipcMain.handle( - 'station:restartToUpdate', + 'checker:restartToUpdate', (_event, _args) => ctx.restartToUpdate() ) ipcMain.handle( - 'station:openReleaseNotes', + 'checker:openReleaseNotes', (_event) => ctx.openReleaseNotes() ) ipcMain.handle( - 'station:getUpdaterStatus', + 'checker:getUpdaterStatus', (_events, _args) => ctx.getUpdaterStatus() ) ipcMain.handle( - 'station:openExternalURL', + 'checker:openExternalURL', (_events, url) => ctx.openExternalURL(url) ) ipcMain.handle( - 'station:toggleOpenAtLogin', + 'checker:toggleOpenAtLogin', (_events) => ctx.toggleOpenAtLogin() ) ipcMain.handle( - 'station:isOpenAtLogin', + 'checker:isOpenAtLogin', (_events) => ctx.isOpenAtLogin() ) ipcMain.handle( - 'station:exportSeedPhrase', + 'checker:exportSeedPhrase', (_events) => ctx.exportSeedPhrase() ) ipcMain.handle( - 'station:saveModuleLogsAs', - (_events) => ctx.saveModuleLogsAs() + 'checker:saveSubnetLogsAs', + (_events) => ctx.saveSubnetLogsAs() ) ipcMain.handle( - 'station:checkForUpdates', + 'checker:checkForUpdates', (_events) => ctx.manualCheckForUpdates() ) } diff --git a/main/preload.js b/main/preload.js index 44829dc91..d70b12fa3 100644 --- a/main/preload.js +++ b/main/preload.js @@ -10,80 +10,80 @@ const { contextBridge, ipcRenderer } = require('electron') contextBridge.exposeInMainWorld('electron', { - stationBuildVersion: process.env.STATION_BUILD_VERSION, + checkerBuildVersion: process.env.CHECKER_BUILD_VERSION, - getActivities: () => ipcRenderer.invoke('station:getActivities'), + getActivities: () => ipcRenderer.invoke('checker:getActivities'), getTotalJobsCompleted: () => - ipcRenderer.invoke('station:getTotalJobsCompleted'), - getUpdaterStatus: () => ipcRenderer.invoke('station:getUpdaterStatus'), - restartToUpdate: () => ipcRenderer.invoke('station:restartToUpdate'), - openReleaseNotes: () => ipcRenderer.invoke('station:openReleaseNotes'), + ipcRenderer.invoke('checker:getTotalJobsCompleted'), + getUpdaterStatus: () => ipcRenderer.invoke('checker:getUpdaterStatus'), + restartToUpdate: () => ipcRenderer.invoke('checker:restartToUpdate'), + openReleaseNotes: () => ipcRenderer.invoke('checker:openReleaseNotes'), getScheduledRewards: () => - ipcRenderer.invoke('station:getScheduledRewards'), + ipcRenderer.invoke('checker:getScheduledRewards'), - stationConfig: { + checkerConfig: { getOnboardingCompleted: () => - ipcRenderer.invoke('station:getOnboardingCompleted'), + ipcRenderer.invoke('checker:getOnboardingCompleted'), setOnboardingCompleted: () => - ipcRenderer.invoke('station:setOnboardingCompleted'), - getStationWalletAddress: () => - ipcRenderer.invoke('station:getStationWalletAddress'), + ipcRenderer.invoke('checker:setOnboardingCompleted'), + getCheckerWalletAddress: () => + ipcRenderer.invoke('checker:getCheckerWalletAddress'), getDestinationWalletAddress: () => - ipcRenderer.invoke('station:getDestinationWalletAddress'), + ipcRenderer.invoke('checker:getDestinationWalletAddress'), setDestinationWalletAddress: (/** @type {string | undefined} */ address) => - ipcRenderer.invoke('station:setDestinationWalletAddress', address), - getStationWalletBalance: () => - ipcRenderer.invoke('station:getStationWalletBalance'), - getStationWalletTransactionsHistory: () => - ipcRenderer.invoke('station:getStationWalletTransactionsHistory'), + ipcRenderer.invoke('checker:setDestinationWalletAddress', address), + getCheckerWalletBalance: () => + ipcRenderer.invoke('checker:getCheckerWalletBalance'), + getCheckerWalletTransactionsHistory: () => + ipcRenderer.invoke('checker:getCheckerWalletTransactionsHistory'), transferAllFundsToDestinationWallet: () => - ipcRenderer.invoke('station:transferAllFundsToDestinationWallet'), + ipcRenderer.invoke('checker:transferAllFundsToDestinationWallet'), openExternalURL: (/** @type {string } */ url) => - ipcRenderer.invoke('station:openExternalURL', url), + ipcRenderer.invoke('checker:openExternalURL', url), getScheduledRewards: () => - ipcRenderer.invoke('station:getScheduledRewards'), + ipcRenderer.invoke('checker:getScheduledRewards'), toggleOpenAtLogin: () => - ipcRenderer.invoke('station:toggleOpenAtLogin'), - isOpenAtLogin: () => ipcRenderer.invoke('station:isOpenAtLogin'), - exportSeedPhrase: () => ipcRenderer.invoke('station:exportSeedPhrase'), - saveModuleLogsAs: () => ipcRenderer.invoke('station:saveModuleLogsAs'), - checkForUpdates: () => ipcRenderer.invoke('station:checkForUpdates') + ipcRenderer.invoke('checker:toggleOpenAtLogin'), + isOpenAtLogin: () => ipcRenderer.invoke('checker:isOpenAtLogin'), + exportSeedPhrase: () => ipcRenderer.invoke('checker:exportSeedPhrase'), + saveSubnetLogsAs: () => ipcRenderer.invoke('checker:saveSubnetLogsAs'), + checkForUpdates: () => ipcRenderer.invoke('checker:checkForUpdates') }, - stationEvents: { + checkerEvents: { onActivityLogged: (/** @type {(value: Activity) => void} */ callback) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, activities) => callback(activities) - ipcRenderer.on('station:activity-logged', listener) + ipcRenderer.on('checker:activity-logged', listener) return () => - ipcRenderer.removeListener('station:activity-logged', listener) + ipcRenderer.removeListener('checker:activity-logged', listener) }, onJobProcessed: (/** @type {(value: number) => void} */ callback) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, totalJobCount) => callback(totalJobCount) - ipcRenderer.on('station:job-stats-updated', listener) + ipcRenderer.on('checker:job-stats-updated', listener) return () => - ipcRenderer.removeListener('station:job-stats-updated', listener) + ipcRenderer.removeListener('checker:job-stats-updated', listener) }, onEarningsChanged: (/** @type {(value: number) => void} */ callback) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, totalEarnings) => callback(totalEarnings) - ipcRenderer.on('station:earnings-counter', listener) + ipcRenderer.on('checker:earnings-counter', listener) return () => - ipcRenderer.removeListener('station:earnings-counter', listener) + ipcRenderer.removeListener('checker:earnings-counter', listener) }, onReadyToUpdate: (/** @type {() => void} */ callback) => { const listener = () => callback() - ipcRenderer.on('station:ready-to-update', listener) + ipcRenderer.on('checker:ready-to-update', listener) return () => - ipcRenderer.removeListener('station:ready-to-update', listener) + ipcRenderer.removeListener('checker:ready-to-update', listener) }, onBalanceUpdate: (/** @type {(value: string) => void} */ callback) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, balance) => callback(balance) - ipcRenderer.on('station:wallet-balance-update', listener) + ipcRenderer.on('checker:wallet-balance-update', listener) return () => - ipcRenderer.removeListener('station:wallet-balance-update', listener) + ipcRenderer.removeListener('checker:wallet-balance-update', listener) }, onTransactionUpdate: ( /** @type { @@ -93,9 +93,9 @@ contextBridge.exposeInMainWorld('electron', { ) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, transactions) => callback(transactions) - ipcRenderer.on('station:transaction-update', listener) + ipcRenderer.on('checker:transaction-update', listener) return () => - ipcRenderer.removeListener('station:transaction-update', listener) + ipcRenderer.removeListener('checker:transaction-update', listener) }, onScheduledRewardsUpdate: ( @@ -103,9 +103,9 @@ contextBridge.exposeInMainWorld('electron', { ) => { /** @type {(event: IpcRendererEvent, ...args: any[]) => void} */ const listener = (_event, balance) => callback(balance) - ipcRenderer.on('station:scheduled-rewards-update', listener) + ipcRenderer.on('checker:scheduled-rewards-update', listener) return () => - ipcRenderer.removeListener('station:scheduled-rewards-update', listener) + ipcRenderer.removeListener('checker:scheduled-rewards-update', listener) } } }) diff --git a/main/telemetry.js b/main/telemetry.js index c12d258bd..0c7b0a0a2 100644 --- a/main/telemetry.js +++ b/main/telemetry.js @@ -3,7 +3,7 @@ const { app } = require('electron') const { InfluxDB, Point } = require('@influxdata/influxdb-client') const { createHash } = require('node:crypto') -const { getDestinationWalletAddress } = require('./station-config') +const { getDestinationWalletAddress } = require('./checker-config') const wallet = require('./wallet') const Sentry = require('@sentry/node') const { platform, arch } = require('node:os') @@ -47,7 +47,7 @@ async function setup () { point.tag('platform', platform()) // `os.arch()` returns `x64` when running in a translated environment on // ARM64 machine, e.g. via macOS Rosetta. We don't provide Apple `arm64` - // builds yet. As a result, Stations running on Apple Silicon were reporting + // builds yet. As a result, Checkers running on Apple Silicon were reporting // `x64` arch. To fix the problem, we detect `arm64` translation and report // a different architecture. point.tag('arch', app?.runningUnderARM64Translation ? 'arm64' : arch()) diff --git a/main/tray.js b/main/tray.js index c95aa27fd..c490c7cf1 100644 --- a/main/tray.js +++ b/main/tray.js @@ -1,6 +1,6 @@ 'use strict' -const { IS_MAC, STATION_VERSION } = require('./consts') +const { IS_MAC, CHECKER_VERSION } = require('./consts') const { Menu, Tray, app, ipcMain, nativeImage } = require('electron') const { ipcMainEvents } = require('./ipc') const path = require('path') @@ -48,11 +48,11 @@ function getTrayIcon (readyToUpdate, isOnline) { const createContextMenu = (/** @type {Context} */ ctx) => { const contextMenu = Menu.buildFromTemplate([ { - label: `Filecoin Station v${STATION_VERSION}`, + label: `Checker v${CHECKER_VERSION}`, enabled: false }, { - label: 'Open Station', + label: 'Open Checker', click: () => ctx.showUI() }, { type: 'separator' }, @@ -77,7 +77,7 @@ const createContextMenu = (/** @type {Context} */ ctx) => { }, { type: 'separator' }, { - label: 'Quit Station', + label: 'Quit Checker', click: () => app.quit(), accelerator: IS_MAC ? 'Command+Q' : undefined } @@ -89,7 +89,7 @@ module.exports = async function (/** @type {Context} */ ctx) { tray = new Tray(getTrayIcon(false, core.isOnline())) const contextMenu = createContextMenu(ctx) - tray.setToolTip('Filecoin Station') + tray.setToolTip('Checker') tray.setContextMenu(contextMenu) setupIpcEventListeners(ctx) diff --git a/main/typings.ts b/main/typings.ts index 140c63040..d8df58b84 100644 --- a/main/typings.ts +++ b/main/typings.ts @@ -41,7 +41,7 @@ export interface Context { isShowingUI: boolean; loadWebUIFromDist: import('electron-serve').loadURL; manualCheckForUpdates: () => void; - saveModuleLogsAs: () => Promise; + saveSubnetLogsAs: () => Promise; openReleaseNotes: () => void; restartToUpdate: () => void; diff --git a/main/ui.js b/main/ui.js index 8a8464994..6281fe7d3 100644 --- a/main/ui.js +++ b/main/ui.js @@ -8,7 +8,7 @@ const { getTrayOperationExplained, setTrayOperationExplained, getOnboardingCompleted -} = require('./station-config') +} = require('./checker-config') const { showDialogSync } = require('./dialog') const wallet = require('./wallet') @@ -22,7 +22,7 @@ module.exports = async function (ctx) { const dimensions = screen.getPrimaryDisplay().size const ui = new BrowserWindow({ - title: 'Filecoin Station', + title: 'Checker', show: false, // we show it via ready-to-show width: Math.min(dimensions.width, 1440), height: Math.min(dimensions.height, 900), @@ -80,7 +80,7 @@ module.exports = async function (ctx) { if (app.dock) app.dock.show() ui.show() } - // We want the Station to start hidden in the tray. + // We want the Checker to start hidden in the tray. // However, when the user did not complete the onboarding flow, // we need to show the app to ask them to finish the setup process if (!getOnboardingCompleted()) { @@ -94,8 +94,8 @@ module.exports = async function (ctx) { event.preventDefault() if (!getTrayOperationExplained()) { showDialogSync({ - title: 'Closing Filecoin Station', - message: 'Station will continue running in the background.' + title: 'Closing Checker', + message: 'Checker will continue running in the background.' }) setTrayOperationExplained() } diff --git a/main/updater.js b/main/updater.js index 31196137c..a83b69f71 100644 --- a/main/updater.js +++ b/main/updater.js @@ -26,7 +26,7 @@ let nextVersion const store = new Store({ name: 'updater' }) function quitAndInstall () { - log.info('Restarting Station to install the new version') + log.info('Restarting Checker to install the new version') beforeQuitCleanup() store.set('upgradeToVersion', nextVersion) autoUpdater.quitAndInstall() @@ -156,7 +156,7 @@ function onUpdateAvailable ({ version /*, releaseNotes */ }) { function openReleaseNotes () { const version = nextVersion ? `v${nextVersion}` : 'latest' - shell.openExternal(`https://github.com/filecoin-station/desktop/releases/${version}`) + shell.openExternal(`https://github.com/CheckerNetwork/app/releases/${version}`) } /** @@ -170,7 +170,7 @@ function onUpdateNotAvailable ({ version }) { showDialogSync({ title: 'Update not available', - message: `You are on the latest version of Filecoin Station (${version}).`, + message: `You are on the latest version of Checker (${version}).`, type: 'info', buttons: ['Close'] }) @@ -186,8 +186,8 @@ function onUpdateDownloaded (ctx, { version /*, releaseNotes */ }) { const showUpdateDialog = () => { const buttonIx = showDialogSync({ - title: 'Update Filecoin Station', - message: `An update to Filecoin Station ${version} is available. ` + + title: 'Update Checker', + message: `An update to Checker ${version} is available. ` + 'Would you like to install it now?', type: 'info', buttons: ['Later', 'Show Release Notes', 'Install now'] @@ -202,14 +202,14 @@ function onUpdateDownloaded (ctx, { version /*, releaseNotes */ }) { if (checkingManually) { // when checking manually, show the dialog immediately showUpdateDialog() - // also don't trigger the automatic Station restart + // also don't trigger the automatic Checker restart // showUpdateDialog() offers the user to restart } else if (ctx.isShowingUI) { // show unobtrusive notification + dialog on click ipcMain.emit(ipcMainEvents.READY_TO_UPDATE) updateNotification = new Notification({ - title: 'Filecoin Station Update', - body: `An update to Filecoin Station ${version} is available.` + title: 'Checker Update', + body: `An update to Checker ${version} is available.` }) updateNotification.on('click', showUpdateDialog) updateNotification.show() @@ -218,7 +218,7 @@ function onUpdateDownloaded (ctx, { version /*, releaseNotes */ }) { // We have a new version that we did not tried to install previously // Let's go ahead and restart the app to update updateNotification = new Notification({ - title: 'Restarting Filecoin Station', + title: 'Restarting Checker', body: `Updating to version ${version}.` }) updateNotification.show() diff --git a/main/utils.js b/main/utils.js index 9cfff5ba7..f6eaed98a 100644 --- a/main/utils.js +++ b/main/utils.js @@ -17,9 +17,9 @@ function formatTokenValue (input) { const allowedURLs = [ 'https://filspark.com/', - 'https://github.com/filecoin-station/voyager', + 'https://github.com/CheckerNetwork/voyager', 'https://filstation.app/', - 'https://github.com/filecoin-station/spark', + 'https://github.com/CheckerNetwork/spark', 'https://beryx.io', 'https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4', 'https://checker.network', diff --git a/main/wallet-backend.js b/main/wallet-backend.js index f4ae2be78..4cd889154 100644 --- a/main/wallet-backend.js +++ b/main/wallet-backend.js @@ -100,15 +100,33 @@ class WalletBackend { return { seedIsNew: isNew } } + /** + * @param {string} service + */ + async maybeMigrateSeedPhrase (service) { + try { + await keytar.getPassword(service, 'seed') + return + } catch {} + let seed + try { + seed = await keytar.getPassword('filecoin-station-wallet-0x', 'seed') + } catch {} + if (seed) { + await keytar.setPassword(service, 'seed', seed) + } + } + /** * @returns {Promise} */ async getSeedPhrase () { - const service = 'filecoin-station-wallet-0x' + const service = 'checker-wallet-0x' let seed if (!this.disableKeytar) { log.info('Reading the seed phrase from the keychain...') try { + await this.maybeMigrateSeedPhrase(service) seed = await keytar.getPassword(service, 'seed') } catch (err) { throw new Error( diff --git a/main/wallet.js b/main/wallet.js index 4dddf7322..1ccbac038 100644 --- a/main/wallet.js +++ b/main/wallet.js @@ -2,7 +2,7 @@ const electronLog = require('electron-log') const assert = require('assert') -const { getDestinationWalletAddress } = require('./station-config') +const { getDestinationWalletAddress } = require('./checker-config') const timers = require('node:timers/promises') const { format } = require('node:util') const Store = require('electron-store') diff --git a/package-lock.json b/package-lock.json index 71f3245f7..52e8b219e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "filecoin-station", + "name": "checker", "version": "2.3.14", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "filecoin-station", + "name": "checker", "version": "2.3.14", "hasInstallScript": true, "license": "(Apache-2.0 AND MIT)", diff --git a/package.json b/package.json index 1426b620c..01fc372aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "filecoin-station", - "productName": "Filecoin Station", + "name": "checker", + "productName": "Checker", "private": true, "version": "2.3.14", "description": "Desktop application for Filecoin Retrieval Markets", @@ -27,17 +27,17 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/filecoin-station/desktop.git" + "url": "git+https://github.com/CheckerNetwork/app.git" }, "keywords": [ "filecoin" ], - "author": "Protocol Labs", + "author": "Space Meridian", "license": "(Apache-2.0 AND MIT)", "bugs": { - "url": "https://github.com/filecoin-station/desktop/issues" + "url": "https://github.com/CheckerNetwork/app/issues" }, - "homepage": "https://github.com/filecoin-station/desktop#readme", + "homepage": "https://github.com/CheckerNetwork/app#readme", "dependencies": { "@filecoin-station/core": "^21.2.5", "@filecoin-station/spark-impact-evaluator": "^1.2.4", diff --git a/renderer/README.md b/renderer/README.md index d0839578d..cfbdd3ddd 100644 --- a/renderer/README.md +++ b/renderer/README.md @@ -1,3 +1,3 @@ # Renderer -This is the front-end application providing Station Shell UI. +This is the front-end application providing Checker Shell UI. diff --git a/renderer/index.html b/renderer/index.html index 27387cb2b..fdc654774 100644 --- a/renderer/index.html +++ b/renderer/index.html @@ -3,7 +3,7 @@ - Filecoin Station + Checker
diff --git a/renderer/src/App.tsx b/renderer/src/App.tsx index 5dfc8c169..1a3390cc2 100644 --- a/renderer/src/App.tsx +++ b/renderer/src/App.tsx @@ -9,7 +9,7 @@ import { ROUTES } from 'src/lib/routes' import Layout from 'src/components/Layout' import Settings from 'src/pages/settings/Settings' import Wallet from 'src/pages/wallet/Wallet' -import Modules from 'src/pages/modules/Modules' +import Subnets from 'src/pages/subnets/Subnets' import { DialogProvider } from './components/DialogProvider' import { TooltipProvider } from '@radix-ui/react-tooltip' @@ -17,7 +17,7 @@ const App = ():JSX.Element => { return ( - Filecoin Station + Checker @@ -34,7 +34,7 @@ const App = ():JSX.Element => { } /> } /> } /> - } /> + } /> } diff --git a/renderer/src/assets/img/icons/logo-symbol.svg b/renderer/src/assets/img/icons/logo-symbol.svg index d411c26a7..50c0879a6 100644 --- a/renderer/src/assets/img/icons/logo-symbol.svg +++ b/renderer/src/assets/img/icons/logo-symbol.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/renderer/src/assets/img/icons/modules.svg b/renderer/src/assets/img/icons/subnets.svg similarity index 100% rename from renderer/src/assets/img/icons/modules.svg rename to renderer/src/assets/img/icons/subnets.svg diff --git a/renderer/src/components/Layout.tsx b/renderer/src/components/Layout.tsx index 8b3716edf..6d0d5a7fc 100644 --- a/renderer/src/components/Layout.tsx +++ b/renderer/src/components/Layout.tsx @@ -3,14 +3,12 @@ import Sidebar from 'src/components/Sidebar' import UpdateBanner from 'src/components/UpdateBanner' import WalletWidget from 'src/components/WalletWidget' import DraggableArea from 'src/components/DraggableArea' -import RebrandBanner from 'src/components/RebrandBanner' const Layout = ({ children }: {children: ReactNode}) => { return (
-
diff --git a/renderer/src/components/Onboarding.tsx b/renderer/src/components/Onboarding.tsx index 4379e55e5..3ec4abf7d 100644 --- a/renderer/src/components/Onboarding.tsx +++ b/renderer/src/components/Onboarding.tsx @@ -2,7 +2,7 @@ import { FC, useState } from 'react' import Back from 'src/assets/img/icons/arrow-left.svg?react' import Page from 'src/assets/img/icons/paginator-page.svg?react' import CurrentPage from 'src/assets/img/icons/paginator-current.svg?react' -import { showTermsOfService } from 'src/lib/station-config' +import { showTermsOfService } from 'src/lib/checker-config' interface FooterProps { page: number; @@ -58,15 +58,14 @@ const Onboarding: FC = ({ onFinish }) => { >

- Join the Filecoin Economy. + Join the Checker Network.

- Station securely connects your computer to Filecoin's global peer-to-peer network, which - rewards you for your participation. Once you've connected, you will begin completing network - jobs. + Checker securely connects your computer to the global peer-to-peer Checker Network, which rewards + you for your participation. Once you've connected, you will begin completing checker jobs.

@@ -113,14 +112,14 @@ const Onboarding: FC = ({ onFinish }) => {

- Station asks for your consent to use your personal data to store and/or access information on a + Checker asks for your consent to use your personal data to store and/or access information on a device. Your personal data will be processed and information from your device (cookies, unique identifiers, and other device data) may be stored by, accessed by and shared with third party vendors, or used specifically by this app.

By clicking {'"'}Create Wallet{'"'} or otherwise continuing to use this service, you agree, you - have read, understand and accept Station's + have read, understand and accept Checker's {' '} { - const { pathname } = useLocation() - const [visible, setVisible] = useState(true) - - if (!visible) { - return null - } - - if (pathname === ROUTES.wallet) { - return null - } - - return ( -

-
- 🚨 Filecoin Station is becoming the Checker Network. - -
- -
- ) -} - -export default RebrandBanner diff --git a/renderer/src/components/Sentry.tsx b/renderer/src/components/Sentry.tsx index a61d4cfb6..991e59342 100644 --- a/renderer/src/components/Sentry.tsx +++ b/renderer/src/components/Sentry.tsx @@ -4,12 +4,12 @@ import * as Sentry from '@sentry/react' const SentryComponent = () => { useEffect(() => { // Disable Sentry integration for dev builds - if (window.electron.stationBuildVersion.endsWith('-dev')) { return } + if (window.electron.checkerBuildVersion.endsWith('-dev')) { return } Sentry.init({ dsn: 'https://8667b1c7749ae24e35ba531bffa3ed7a@o1408530.ingest.us.sentry.io/6762462', integrations: [Sentry.browserTracingIntegration()], - release: window.electron.stationBuildVersion, + release: window.electron.checkerBuildVersion, // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production diff --git a/renderer/src/components/Sidebar.tsx b/renderer/src/components/Sidebar.tsx index 7cf06fabd..63205a76b 100644 --- a/renderer/src/components/Sidebar.tsx +++ b/renderer/src/components/Sidebar.tsx @@ -2,7 +2,7 @@ import { useState } from 'react' import { NavLink } from 'react-router' import { ROUTES } from 'src/lib/routes' import HomeIcon from 'src/assets/img/icons/home.svg?react' -import ModulesIcon from 'src/assets/img/icons/modules.svg?react' +import SubnetsIcon from 'src/assets/img/icons/subnets.svg?react' import WalletIcon from 'src/assets/img/icons/wallet.svg?react' import SettingsIcon from 'src/assets/img/icons/settings.svg?react' import MenuArrow from 'src/assets/img/icons/menu-arrow.svg?react' @@ -17,9 +17,9 @@ const links = [ Icon: HomeIcon }, { - href: ROUTES.modules, - title: 'Modules', - Icon: ModulesIcon + href: ROUTES.subnets, + title: 'Subnets', + Icon: SubnetsIcon }, { href: ROUTES.wallet, diff --git a/renderer/src/components/UpdateBanner.tsx b/renderer/src/components/UpdateBanner.tsx index 2c1fe0ff3..52b18925e 100644 --- a/renderer/src/components/UpdateBanner.tsx +++ b/renderer/src/components/UpdateBanner.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import Warning from 'src/assets/img/icons/error.svg?react' -import { openReleaseNotes, restartToUpdate } from 'src/lib/station-config' +import { openReleaseNotes, restartToUpdate } from 'src/lib/checker-config' const UpdateBanner = () => { const [isReadyToUpdate, setIsReadyToUpdate] = useState(false) @@ -12,7 +12,7 @@ const UpdateBanner = () => { } reload() - const unsubscribeUpdateNotification = window.electron.stationEvents.onReadyToUpdate(() => { + const unsubscribeUpdateNotification = window.electron.checkerEvents.onReadyToUpdate(() => { setIsReadyToUpdate(true) }) @@ -26,7 +26,7 @@ const UpdateBanner = () => {
- New version available: Station will update itself on next launch. + New version available: Checker will update itself on next launch.
diff --git a/renderer/src/components/WalletModal.tsx b/renderer/src/components/WalletModal.tsx index 48e6985fb..ef3bb89d0 100644 --- a/renderer/src/components/WalletModal.tsx +++ b/renderer/src/components/WalletModal.tsx @@ -1,4 +1,4 @@ -import useWallet from 'src/hooks/StationWallet' +import useWallet from 'src/hooks/CheckerWallet' import { useDialog } from './DialogProvider' import BorderedBox from './BorderedBox' import Text from './Text' @@ -13,8 +13,8 @@ import TransactionStatusIndicator from './TransactionStatusIndicator' const WalletModal = () => { const { - stationAddress, - stationAddress0x, + checkerAddress, + checkerAddress0x, walletBalance, processingTransaction } = useWallet() @@ -32,14 +32,14 @@ const WalletModal = () => { - // Station address ... : + // Checker address ... :
-
-
+
+
diff --git a/renderer/src/components/WalletWidget.tsx b/renderer/src/components/WalletWidget.tsx index 07879caa8..891ddf866 100644 --- a/renderer/src/components/WalletWidget.tsx +++ b/renderer/src/components/WalletWidget.tsx @@ -1,4 +1,4 @@ -import useWallet from 'src/hooks/StationWallet' +import useWallet from 'src/hooks/CheckerWallet' import WalletIcon from 'src/assets/img/icons/wallet.svg?react' import { useDialog } from './DialogProvider' import { formatFilValue } from 'src/lib/utils' diff --git a/renderer/src/hooks/StationActivity.tsx b/renderer/src/hooks/CheckerActivity.tsx similarity index 79% rename from renderer/src/hooks/StationActivity.tsx rename to renderer/src/hooks/CheckerActivity.tsx index a47846615..8c329b2a9 100644 --- a/renderer/src/hooks/StationActivity.tsx +++ b/renderer/src/hooks/CheckerActivity.tsx @@ -2,14 +2,14 @@ import { useState, useEffect } from 'react' import { getActivities, getTotalJobsCompleted -} from 'src/lib/station-config' +} from 'src/lib/checker-config' import { Activity } from 'src/typings' -interface StationActivity { +interface CheckerActivity { totalJobs: number; activities: Activity[] | []; } -const useStationActivity = (): StationActivity => { +const useCheckerActivity = (): CheckerActivity => { const [totalJobs, setTotalJobs] = useState(0) const [activities, setActivities] = useState([]) @@ -24,14 +24,14 @@ const useStationActivity = (): StationActivity => { }, []) useEffect(() => { - const unsubscribeOnJobProcessed = window.electron.stationEvents.onJobProcessed(setTotalJobs) + const unsubscribeOnJobProcessed = window.electron.checkerEvents.onJobProcessed(setTotalJobs) return () => { unsubscribeOnJobProcessed() } }, []) useEffect(() => { - const unsubscribeOnActivityLogged = window.electron.stationEvents.onActivityLogged(activity => { + const unsubscribeOnActivityLogged = window.electron.checkerEvents.onActivityLogged(activity => { setActivities(activities => { const updatedActivities = [activity, ...activities] updatedActivities.length = Math.min(updatedActivities.length, 100) @@ -46,4 +46,4 @@ const useStationActivity = (): StationActivity => { return { totalJobs, activities } } -export default useStationActivity +export default useCheckerActivity diff --git a/renderer/src/hooks/StationRewards.tsx b/renderer/src/hooks/CheckerRewards.tsx similarity index 93% rename from renderer/src/hooks/StationRewards.tsx rename to renderer/src/hooks/CheckerRewards.tsx index bae028bf5..dc812f4fb 100644 --- a/renderer/src/hooks/StationRewards.tsx +++ b/renderer/src/hooks/CheckerRewards.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react' -import { getScheduledRewards } from 'src/lib/station-config' -import useWallet from 'src/hooks/StationWallet' +import { getScheduledRewards } from 'src/lib/checker-config' +import useWallet from 'src/hooks/CheckerWallet' import { formattedFilToBigInt } from 'src/lib/utils' import { voyagerAirdrop } from './voyagerAirdrop' @@ -116,7 +116,7 @@ export function sumAllRewards (data: RewardsRecord['totalRewardsReceived']) { return Object.values(data).reduce((acc, val) => acc + val, 0n) } -const useStationRewards = () => { +const useCheckerRewards = () => { const wallet = useWallet() const [scheduledRewards, setScheduledRewards] = useState() const [historicalRewards, setHistoricalRewards] = useState([]) @@ -128,9 +128,9 @@ const useStationRewards = () => { useEffect(() => { async function loadStoredInfo () { - if (!wallet.stationAddress0x || document.hidden) return + if (!wallet.checkerAddress0x || document.hidden) return setHistoricalRewards( - await getHistoricalRewardsData(wallet.stationAddress0x) + await getHistoricalRewardsData(wallet.checkerAddress0x) ) } loadStoredInfo() @@ -140,7 +140,7 @@ const useStationRewards = () => { clearInterval(id) document.removeEventListener('visibilitychange', loadStoredInfo) } - }, [wallet.stationAddress0x]) + }, [wallet.checkerAddress0x]) useEffect(() => { async function loadStoredInfo () { @@ -154,10 +154,10 @@ const useStationRewards = () => { clearInterval(id) document.removeEventListener('visibilitychange', loadStoredInfo) } - }, [wallet.stationAddress0x]) + }, [wallet.checkerAddress0x]) useEffect(() => { - const unsubscribeOnScheduledRewardsUpdate = window.electron.stationEvents.onScheduledRewardsUpdate(balance => { + const unsubscribeOnScheduledRewardsUpdate = window.electron.checkerEvents.onScheduledRewardsUpdate(balance => { setScheduledRewards(formattedFilToBigInt(balance)) }) return () => { @@ -200,4 +200,4 @@ const useStationRewards = () => { } } -export default useStationRewards +export default useCheckerRewards diff --git a/renderer/src/hooks/StationWallet.tsx b/renderer/src/hooks/CheckerWallet.tsx similarity index 84% rename from renderer/src/hooks/StationWallet.tsx rename to renderer/src/hooks/CheckerWallet.tsx index 5db6704ea..ca45186de 100644 --- a/renderer/src/hooks/StationWallet.tsx +++ b/renderer/src/hooks/CheckerWallet.tsx @@ -2,11 +2,11 @@ import { useState, useEffect, useCallback, useRef } from 'react' import { getDestinationWalletAddress, setDestinationWalletAddress, - getStationWalletAddress, - getStationWalletBalance, - getStationWalletTransactionsHistory, + getCheckerWalletAddress, + getCheckerWalletBalance, + getCheckerWalletTransactionsHistory, transferAllFundsToDestinationWallet -} from 'src/lib/station-config' +} from 'src/lib/checker-config' import { FILTransaction, FILTransactionProcessing, @@ -16,8 +16,8 @@ import { import { ethAddressFromDelegated } from '@glif/filecoin-address' export interface Wallet { - stationAddress: string; - stationAddress0x: string; + checkerAddress: string; + checkerAddress0x: string; destinationFilAddress: string | undefined; walletBalance: string | undefined; walletTransactions: FILTransaction[] | undefined; @@ -28,7 +28,7 @@ export interface Wallet { } const useWallet = (): Wallet => { - const [stationAddress, setStationAddress] = useState('') + const [checkerAddress, setCheckerAddress] = useState('') const [destinationFilAddress, setDestinationFilAddress] = useState() const [walletBalance, setWalletBalance] = useState() const [walletTransactions, setWalletTransactions] = useState() @@ -87,21 +87,21 @@ const useWallet = (): Wallet => { useEffect(() => { const loadStoredInfo = async () => { - setStationAddress(await getStationWalletAddress()) + setCheckerAddress(await getCheckerWalletAddress()) } loadStoredInfo() - }, [stationAddress]) + }, [checkerAddress]) useEffect(() => { const loadStoredInfo = async () => { - setWalletBalance(await getStationWalletBalance()) + setWalletBalance(await getCheckerWalletBalance()) } loadStoredInfo() }, []) useEffect(() => { const loadStoredInfo = async () => { - setTransactions(await getStationWalletTransactionsHistory()) + setTransactions(await getCheckerWalletTransactionsHistory()) } loadStoredInfo() }, [setTransactions]) @@ -109,7 +109,7 @@ const useWallet = (): Wallet => { // Subscribe to events useEffect(() => { - const unsubscribeOnTransactionUpdate = window.electron.stationEvents.onTransactionUpdate( + const unsubscribeOnTransactionUpdate = window.electron.checkerEvents.onTransactionUpdate( setTransactions ) return () => { @@ -118,7 +118,7 @@ const useWallet = (): Wallet => { }, [setTransactions]) useEffect(() => { - const unsubscribeOnBalanceUpdate = window.electron.stationEvents.onBalanceUpdate(balance => { + const unsubscribeOnBalanceUpdate = window.electron.checkerEvents.onBalanceUpdate(balance => { setWalletBalance(balance) }) return () => { @@ -127,9 +127,9 @@ const useWallet = (): Wallet => { }, [walletBalance]) return { - stationAddress, - stationAddress0x: stationAddress !== '' - ? ethAddressFromDelegated(stationAddress) + checkerAddress, + checkerAddress0x: checkerAddress !== '' + ? ethAddressFromDelegated(checkerAddress) : '', destinationFilAddress, walletBalance, diff --git a/renderer/src/hooks/StationModules.tsx b/renderer/src/hooks/Subnets.tsx similarity index 92% rename from renderer/src/hooks/StationModules.tsx rename to renderer/src/hooks/Subnets.tsx index 57c2e5604..1c2b58826 100644 --- a/renderer/src/hooks/StationModules.tsx +++ b/renderer/src/hooks/Subnets.tsx @@ -4,7 +4,7 @@ import SparkLogo from 'src/assets/img/icons/spark-logo.png' import SaturnLogo from 'src/assets/img/icons/saturn-logo.svg' /** - * @returns {Promise} The contract address of the Spark module + * @returns {Promise} The contract address of the Spark subnet */ async function getSparkContractAddress () { const name = Name.parse( @@ -82,7 +82,7 @@ async function getSparkTransfersFromStats () { } /** - * @returns {Promise} The total rewards of the Spark module + * @returns {Promise} The total rewards of the Spark subnet */ async function getSparkTotalRewards () { const [balanceHeld, transfersFromStats] = await Promise.all([ @@ -94,7 +94,7 @@ async function getSparkTotalRewards () { } /* eslint-disable max-len */ -export const modules = { +export const subnets = { spark: { name: 'Spark', description: 'Spark is a trustless protocol for sampling retrievals from Filecoin Storage Providers. Spark aims to drive improvements in the retrievability of data stored on Filecoin.', @@ -131,9 +131,9 @@ export const modules = { } } as const -export type Module = (typeof modules)[keyof typeof modules] & {id: string} +export type Subnet = (typeof subnets)[keyof typeof subnets] & {id: string} -export const useModules = () => { +export const useSubnets = () => { const [sparkContractAddress, setSparkContractAddress] = useState() const [sparkTotalRewards, setSparkTotalRewards] = useState(0) @@ -151,19 +151,19 @@ export const useModules = () => { load() }, []) - const modulesUpdated = { - ...modules, + const subnetsUpdated = { + ...subnets, spark: { - ...modules.spark, + ...subnets.spark, contractAddress: sparkContractAddress, stats: { - ...modules.spark.stats, + ...subnets.spark.stats, totalRewards: sparkTotalRewards } } } return { - modules: Object.entries(modulesUpdated).map(([id, mod]) => ({ ...mod, id })) as Module[] + subnets: Object.entries(subnetsUpdated).map(([id, subnet]) => ({ ...subnet, id })) as Subnet[] } } diff --git a/renderer/src/lib/station-config.tsx b/renderer/src/lib/checker-config.tsx similarity index 58% rename from renderer/src/lib/station-config.tsx rename to renderer/src/lib/checker-config.tsx index ebb79084b..b29233c76 100644 --- a/renderer/src/lib/station-config.tsx +++ b/renderer/src/lib/checker-config.tsx @@ -2,11 +2,11 @@ import { Activity, FILTransaction, FILTransactionProcessing } from 'src/typings' import pDebounce from 'p-debounce' export async function getOnboardingCompleted (): Promise { - return await window.electron.stationConfig.getOnboardingCompleted() + return await window.electron.checkerConfig.getOnboardingCompleted() } export async function setOnboardingCompleted (): Promise { - return await window.electron.stationConfig.setOnboardingCompleted() + return await window.electron.checkerConfig.setOnboardingCompleted() } export async function getActivities (): Promise { @@ -30,68 +30,68 @@ export function openReleaseNotes (): void { } export async function getDestinationWalletAddress (): Promise { - return await window.electron.stationConfig.getDestinationWalletAddress() + return await window.electron.checkerConfig.getDestinationWalletAddress() } export async function setDestinationWalletAddress (address: string | undefined): Promise { - return await window.electron.stationConfig.setDestinationWalletAddress(address) + return await window.electron.checkerConfig.setDestinationWalletAddress(address) } -export async function getStationWalletAddress (): Promise { - return await window.electron.stationConfig.getStationWalletAddress() +export async function getCheckerWalletAddress (): Promise { + return await window.electron.checkerConfig.getCheckerWalletAddress() } -export async function getStationWalletBalance (): Promise { - return await window.electron.stationConfig.getStationWalletBalance() +export async function getCheckerWalletBalance (): Promise { + return await window.electron.checkerConfig.getCheckerWalletBalance() } -export const getStationWalletTransactionsHistory = pDebounce( +export const getCheckerWalletTransactionsHistory = pDebounce( async function (): Promise<(FILTransaction|FILTransactionProcessing)[]> { - return await window.electron.stationConfig.getStationWalletTransactionsHistory() + return await window.electron.checkerConfig.getCheckerWalletTransactionsHistory() }, 0 ) export async function transferAllFundsToDestinationWallet (): Promise { - return await window.electron.stationConfig.transferAllFundsToDestinationWallet() + return await window.electron.checkerConfig.transferAllFundsToDestinationWallet() } export function browseTransactionTracker (transactionHash: string): void { - return window.electron.stationConfig.openExternalURL(`https://beryx.zondax.ch/v1/search/fil/mainnet/address/${transactionHash}`) + return window.electron.checkerConfig.openExternalURL(`https://beryx.zondax.ch/v1/search/fil/mainnet/address/${transactionHash}`) } export function openExternalURL (url: string): void { - return window.electron.stationConfig.openExternalURL(url) + return window.electron.checkerConfig.openExternalURL(url) } export function openBeryx (): void { - return window.electron.stationConfig.openExternalURL('https://beryx.io/') + return window.electron.checkerConfig.openExternalURL('https://beryx.io/') } export function showTermsOfService (): void { - return window.electron.stationConfig.openExternalURL('https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4') + return window.electron.checkerConfig.openExternalURL('https://pl-strflt.notion.site/Station-Terms-Conditions-e97da76bb89f49e280c2897aebe4c41f?pvs=4') } export function openDocsLink () { - return window.electron.stationConfig.openExternalURL('https://docs.filstation.app/your-station-wallet') + return window.electron.checkerConfig.openExternalURL('https://docs.filstation.app/your-station-wallet') } export function toggleOpenAtLogin () { - return window.electron.stationConfig.toggleOpenAtLogin() + return window.electron.checkerConfig.toggleOpenAtLogin() } export function isOpenAtLogin () { - return window.electron.stationConfig.isOpenAtLogin() + return window.electron.checkerConfig.isOpenAtLogin() } export function exportSeedPhrase () { - return window.electron.stationConfig.exportSeedPhrase() + return window.electron.checkerConfig.exportSeedPhrase() } -export function saveModuleLogsAs () { - return window.electron.stationConfig.saveModuleLogsAs() +export function saveSubnetLogsAs () { + return window.electron.checkerConfig.saveSubnetLogsAs() } export function checkForUpdates () { - return window.electron.stationConfig.checkForUpdates() + return window.electron.checkerConfig.checkForUpdates() } diff --git a/renderer/src/lib/routes.ts b/renderer/src/lib/routes.ts index 236f4c8fb..3d85f7bb2 100644 --- a/renderer/src/lib/routes.ts +++ b/renderer/src/lib/routes.ts @@ -1,7 +1,7 @@ export const ROUTES = { onboarding: '/', dashboard: '/dashboard', - modules: '/modules', + subnets: '/subnets', settings: '/settings', wallet: '/wallet' } as const diff --git a/renderer/src/lib/utils.ts b/renderer/src/lib/utils.ts index 41e0a0e16..2bc5fd34e 100644 --- a/renderer/src/lib/utils.ts +++ b/renderer/src/lib/utils.ts @@ -1,5 +1,5 @@ import { BigNumber, FilecoinNumber } from '@glif/filecoin-number' -import { browseTransactionTracker } from './station-config' +import { browseTransactionTracker } from './checker-config' import { delegatedFromEthAddress, ethAddressFromDelegated, newFromString } from '@glif/filecoin-address' export function truncateString (value: string, size = 6) { diff --git a/renderer/src/pages/dashboard/ActivityInfo.tsx b/renderer/src/pages/dashboard/ActivityInfo.tsx index 646d359ea..cd3dafedc 100644 --- a/renderer/src/pages/dashboard/ActivityInfo.tsx +++ b/renderer/src/pages/dashboard/ActivityInfo.tsx @@ -1,6 +1,6 @@ import BorderedBox from 'src/components/BorderedBox' import Text from 'src/components/Text' -import useStationActivity from 'src/hooks/StationActivity' +import useCheckerActivity from 'src/hooks/CheckerActivity' import WarningIcon from 'src/assets/img/icons/warning.svg?react' import JobIcon from 'src/assets/img/icons/job.svg?react' import { Activity } from 'shared/typings' @@ -24,7 +24,7 @@ const ActivityItem = ({ activity }: {activity: Activity}) => { } const ActivityInfo = () => { - const { totalJobs, activities } = useStationActivity() + const { totalJobs, activities } = useCheckerActivity() const activitiesByDate = useMemo(() => activities .sort((x, y) => y.timestamp.getTime() - x.timestamp.getTime()) diff --git a/renderer/src/pages/dashboard/Chart.tsx b/renderer/src/pages/dashboard/Chart.tsx index 4f35bbae2..c3c725d7c 100644 --- a/renderer/src/pages/dashboard/Chart.tsx +++ b/renderer/src/pages/dashboard/Chart.tsx @@ -9,7 +9,7 @@ import { Chart as ChartType } from 'chart.js' import { Line } from 'react-chartjs-2' -import { RewardsRecord, sumAllRewards } from 'src/hooks/StationRewards' +import { RewardsRecord, sumAllRewards } from 'src/hooks/CheckerRewards' import { TimeRange } from './ChartController' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { @@ -36,22 +36,22 @@ ChartJS.register( Tooltip ) -function getRewardValue (data: RewardsRecord['totalRewardsReceived'], moduleId: string) { - if (moduleId === 'all') { +function getRewardValue (data: RewardsRecord['totalRewardsReceived'], subnetId: string) { + if (subnetId === 'all') { return bigIntFilToNumber(sumAllRewards(data)) } - return bigIntFilToNumber(data[moduleId]) + return bigIntFilToNumber(data[subnetId]) } const Chart = ({ historicalRewards, timeRange, - moduleId + subnetId }: { historicalRewards: RewardsRecord[]; timeRange: TimeRange; - moduleId: string; + subnetId: string; }) => { const [aspectRatio, setAspectRatio] = useState() const containerRef = useRef(null) @@ -67,14 +67,14 @@ const Chart = ({ }>( (acc, record, index) => { acc.labels.push(new Date(record.timestamp).getTime()) - acc.totalRewards.push(getRewardValue(record.totalRewardsReceived, moduleId)) - const isPayout = index > 0 && getRewardValue(record.totalRewardsReceived, moduleId) > - getRewardValue(historicalRewards[index - 1].totalRewardsReceived, moduleId) + acc.totalRewards.push(getRewardValue(record.totalRewardsReceived, subnetId)) + const isPayout = index > 0 && getRewardValue(record.totalRewardsReceived, subnetId) > + getRewardValue(historicalRewards[index - 1].totalRewardsReceived, subnetId) acc.scheduled.push( isPayout - ? getRewardValue(record.totalRewardsReceived, moduleId) - : getRewardValue(record.totalScheduledRewards, moduleId) + - getRewardValue(record.totalRewardsReceived, moduleId) + ? getRewardValue(record.totalRewardsReceived, subnetId) + : getRewardValue(record.totalScheduledRewards, subnetId) + + getRewardValue(record.totalRewardsReceived, subnetId) ) return acc }, { @@ -82,7 +82,7 @@ const Chart = ({ totalRewards: [], scheduled: [] }) - , [historicalRewards, moduleId]) + , [historicalRewards, subnetId]) const onTooltipUpdate = useCallback((args) => { if (!tooltipRef.current) { diff --git a/renderer/src/pages/dashboard/ChartController.tsx b/renderer/src/pages/dashboard/ChartController.tsx index 281d669ec..5b0f47964 100644 --- a/renderer/src/pages/dashboard/ChartController.tsx +++ b/renderer/src/pages/dashboard/ChartController.tsx @@ -1,5 +1,5 @@ import { useMemo, useState } from 'react' -import { RewardsRecord } from 'src/hooks/StationRewards' +import { RewardsRecord } from 'src/hooks/CheckerRewards' import Chart from './Chart' import { Select, SelectItem } from 'src/components/Select' import { ToggleGroup, ToggleGroupButton } from 'src/components/ToggleGroup' @@ -26,19 +26,19 @@ function getDataInTimeRange (data: RewardsRecord[], timeRange: TimeRange) { const ChartController = ({ historicalRewards }: {historicalRewards: RewardsRecord[]}) => { const [timeRange, setTimeRange] = useState('7d') - const [moduleId, setModuleId] = useState('all') + const [subnetId, setSubnetId] = useState('all') const filteredHistoricalRewards = useMemo( () => getDataInTimeRange(historicalRewards, timeRange), [timeRange, historicalRewards] ) - const moduleIdsInRange = useMemo( + const subnetIdsInRange = useMemo( () => filteredHistoricalRewards.reduce( (acc, record) => [ ...acc, ...Object.keys(record.totalScheduledRewards).filter((id) => !acc.includes(id)) - ], ['All modules'] + ], ['All subnets'] ), [filteredHistoricalRewards]) return ( @@ -61,13 +61,13 @@ const ChartController = ({ historicalRewards }: {historicalRewards: RewardsRecor ))}