Skip to content

Commit

Permalink
station -> checker (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Feb 11, 2025
1 parent 618f696 commit ecde678
Show file tree
Hide file tree
Showing 30 changed files with 150 additions and 163 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[![](https://img.shields.io/badge/project-Filecoin-blue.svg?style=flat-square)](https://filecoin.io/)
[![ci](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml/badge.svg)](https://github.com/CheckerNetwork/app/actions/workflows/ci.yml)

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).
[checker.network](https://checker.network).

## Install

Expand Down
4 changes: 2 additions & 2 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

```mermaid
graph
fil-stat-repo(github.com/CheckerNetwork/app) --> 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)
Expand Down
12 changes: 6 additions & 6 deletions docs/MODULE_INTERFACE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Station module interface
# Checker module interface

1. A module 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 module 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:
```
Expand Down Expand Up @@ -38,8 +38,8 @@
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
- `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 module-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`
Expand All @@ -61,8 +61,8 @@ the following fields:
process restarts, somewhere in `ROOT_DIR`.
The module may include additional fields in the JSON response, although
these will be ignored by Station.
these will be ignored by Checker.
7. A module 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 module 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 module won't automatically be restarted by Checker (for now).
39 changes: 32 additions & 7 deletions main/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,6 +18,31 @@ const ConfigKeys = {

const configStore = new Store({
migrations: {
'>x': 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(
Expand All @@ -32,13 +57,13 @@ const configStore = new Store({
},
beforeEachMigration: (_, context) => {
log.info(
`Migrating station-config from ${context.fromVersion} → ` +
`Migrating config from ${context.fromVersion} → ` +
context.toVersion
)
}
})

log.info('Loading Station configuration from', configStore.path)
log.info('Loading configuration from', configStore.path)

let OnboardingCompleted =
/** @type {boolean} */
Expand Down
2 changes: 1 addition & 1 deletion main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion main/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ipcMainEvents = Object.freeze({
})

function setupIpcMain (/** @type {Context} */ ctx) {
// Station-wide config
// Checker-wide config
ipcMain.handle(
'checker:getOnboardingCompleted',
config.getOnboardingCompleted
Expand Down
2 changes: 1 addition & 1 deletion main/telemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions main/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const createContextMenu = (/** @type {Context} */ ctx) => {
enabled: false
},
{
label: 'Open Station',
label: 'Open Checker',
click: () => ctx.showUI()
},
{ type: 'separator' },
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion main/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions main/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -202,7 +202,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion renderer/README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 0 additions & 2 deletions renderer/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className='h-screen w-screen overflow-x-hidden flex relative app-bg'>
<DraggableArea />
<Sidebar />
<RebrandBanner />
<WalletWidget />
<div className='w-full flex flex-wrap justify-end absolute'>
<UpdateBanner />
Expand Down
6 changes: 3 additions & 3 deletions renderer/src/components/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Onboarding: FC<OnboardingProps> = ({ onFinish }) => {
<div className='min-h-[372px]'>
<div className='pb-20 px-20 pt-16 min-h-[250px]'>
<p className="text-body-s my-3">
Station securely connects your computer to Filecoin&apos;s global peer-to-peer network, which
Checker securely connects your computer to Filecoin&apos;s global peer-to-peer network, which
rewards you for your participation. Once you&apos;ve connected, you will begin completing network
jobs.
</p>
Expand Down Expand Up @@ -113,14 +113,14 @@ const Onboarding: FC<OnboardingProps> = ({ onFinish }) => {
<div className='min-h-[372px]'>
<div className='pb-8 px-20 pt-8 min-h-[250px]'>
<p className="text-body-s my-3">
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.
</p>
<p className="text-body-s my-3">
By clicking {'"'}Create Wallet{'"'} or otherwise continuing to use this service, you agree, you
have read, understand and accept Station&apos;s
have read, understand and accept Checker&apos;s
{' '}
<span
className="text-primary cursor-pointer"
Expand Down
36 changes: 0 additions & 36 deletions renderer/src/components/RebrandBanner.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions renderer/src/components/Sentry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/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
Expand Down
4 changes: 2 additions & 2 deletions renderer/src/components/UpdateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const UpdateBanner = () => {
}

reload()
const unsubscribeUpdateNotification = window.electron.stationEvents.onReadyToUpdate(() => {
const unsubscribeUpdateNotification = window.electron.events.onReadyToUpdate(() => {
setIsReadyToUpdate(true)
})

Expand All @@ -26,7 +26,7 @@ const UpdateBanner = () => {
<div className='flex flex-row items-center gap-1'>
<Warning width={'12px'} height={'12px'} fill="none" stroke="#fff" />
<span className='text-white text-body-xs'>
New version available: Station will update itself on next launch.
New version available: Checker will update itself on next launch.
</span>
</div>
<div>
Expand Down
12 changes: 6 additions & 6 deletions renderer/src/components/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import TransactionStatusIndicator from './TransactionStatusIndicator'

const WalletModal = () => {
const {
stationAddress,
stationAddress0x,
walletAddress,
walletAddress0x,
walletBalance,
processingTransaction
} = useWallet()
Expand All @@ -32,14 +32,14 @@ const WalletModal = () => {
</button>
</BorderedBox>
<BorderedBox isGrouped className='p-5'>
<Text as='p' font='mono' size='3xs' color='primary' uppercase>&#47;&#47; Station address ... :</Text>
<Text as='p' font='mono' size='3xs' color='primary' uppercase>&#47;&#47; Checker address ... :</Text>
<div className='flex gap-5 items-center mt-4'>
<Address address={stationAddress} />
<Address address={stationAddress0x} />
<Address address={walletAddress} />
<Address address={walletAddress0x} />
<button
type='button'
className='text-primary ml-auto focus:outline-slate-400 w-5 h-5'
onClick={() => openExplorerLink(stationAddress)}
onClick={() => openExplorerLink(walletAddress)}
>
<LinkOutIcon />
</button>
Expand Down
10 changes: 5 additions & 5 deletions renderer/src/hooks/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {
} from 'src/lib/config'
import { Activity } from 'src/typings'

interface StationActivity {
interface CheckerActivity {
totalJobs: number;
activities: Activity[] | [];
}
const useStationActivity = (): StationActivity => {
const useCheckerActivity = (): CheckerActivity => {
const [totalJobs, setTotalJobs] = useState<number>(0)
const [activities, setActivities] = useState<Activity[]>([])

Expand All @@ -24,14 +24,14 @@ const useStationActivity = (): StationActivity => {
}, [])

useEffect(() => {
const unsubscribeOnJobProcessed = window.electron.stationEvents.onJobProcessed(setTotalJobs)
const unsubscribeOnJobProcessed = window.electron.events.onJobProcessed(setTotalJobs)
return () => {
unsubscribeOnJobProcessed()
}
}, [])

useEffect(() => {
const unsubscribeOnActivityLogged = window.electron.stationEvents.onActivityLogged(activity => {
const unsubscribeOnActivityLogged = window.electron.events.onActivityLogged(activity => {
setActivities(activities => {
const updatedActivities = [activity, ...activities]
updatedActivities.length = Math.min(updatedActivities.length, 100)
Expand All @@ -46,4 +46,4 @@ const useStationActivity = (): StationActivity => {
return { totalJobs, activities }
}

export default useStationActivity
export default useCheckerActivity
Loading

0 comments on commit ecde678

Please sign in to comment.