Skip to content

Commit 692595c

Browse files
committed
save
1 parent 68b982d commit 692595c

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

Diff for: docs/SUBNET_INTERFACE.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# Checker module interface
1+
# Checker subnet interface
22

3-
1. A module itself is a long-running executable, which
3+
1. A subnet itself is a long-running executable, which
44
- performs its business logic
55
- writes informative messages to `stdio`
66
- exposes stats via a builtin webserver
77

8-
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.
8+
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.
99

1010
Example:
1111
```
1212
https://github.com/filecoin-saturn/L2-node/releases
1313
```
1414
15-
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.
15+
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.
1616
17-
2. A module can provide a custom __command string__ for launching its executable. Ideally a module doesn't require any extra arguments when launching.
17+
2. A subnet can provide a custom __command string__ for launching its executable. Ideally a subnet doesn't require any extra arguments when launching.
1818
1919
Example:
2020
```bash
2121
$ bacalhau # ideal
2222
$ bacalhau --foo=bar
2323
```
2424
25-
3. A module's executable gets passed the following environment variables:
25+
3. A subnet's executable gets passed the following environment variables:
2626
- `FIL_WALLET_ADDRESS` The user's Filecoin wallet address
27-
- `STATE_ROOT` The long-lived working directory on disk. The module must store
27+
- `STATE_ROOT` The long-lived working directory on disk. The subnet must store
2828
all of its permanent files inside (subdirectories of) this directory. The directory
2929
isn't expected to be backed up or shared across machines in any way.
30-
- `CACHE_ROOT` The temporary working directory on disk. The module must store
30+
- `CACHE_ROOT` The temporary working directory on disk. The subnet must store
3131
all of its caches inside (subdirectories of) this directory. The directory
3232
isn't expected to be backed up or shared across machines in any way.
3333
@@ -36,17 +36,17 @@
3636
$ FIL_WALLET_ADDRESS=f1... STATE_ROOT=~/.local/state/bacalhau CACHE_ROOT=~/.cache/bacalhau bacalhau
3737
```
3838
39-
4. A module communicates activity by writing to its `stdout` stream:
40-
- `API: $1` The module has launched and `$1` can be queried for fetching module stats (see below)
39+
4. A subnet communicates activity by writing to its `stdout` stream:
40+
- `API: $1` The subnet has launched and `$1` can be queried for fetching subnet stats (see below)
4141
- `INFO: $1` `$1` will be displayed to the user inside Checker's Activity Log
4242
- `ERROR: $1` `$1` will be displayed to the user inside Checker's Activity Log, with a warning icon
43-
- `$1` all log lines will be stored in a module-specific log file, which can be submitted to Sentry for error handling
43+
- `$1` all log lines will be stored in a subnet-specific log file, which can be submitted to Sentry for error handling
4444
45-
5. A module is expected to have provided its `API` URL in `<=500ms`
45+
5. A subnet is expected to have provided its `API` URL in `<=500ms`
4646
47-
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.
47+
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.
4848
49-
7. A module exposes its stats via HTTP(S), on an address communicated via
49+
7. A subnet exposes its stats via HTTP(S), on an address communicated via
5050
`stdout` (see above `API:`). The response will be a JSON object with at least
5151
the following fields:
5252
@@ -57,12 +57,12 @@ the following fields:
5757
```
5858
5959
The number of jobs completed is expected to be a monotonically increasing
60-
number. It's the responsibility of the module to persist this number across
60+
number. It's the responsibility of the subnet to persist this number across
6161
process restarts, somewhere in `ROOT_DIR`.
6262
63-
The module may include additional fields in the JSON response, although
63+
The subnet may include additional fields in the JSON response, although
6464
these will be ignored by Checker.
6565
66-
7. A module can be told to shut down via signal `SIGTERM`
66+
7. A subnet can be told to shut down via signal `SIGTERM`
6767
68-
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).
68+
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 for: renderer/src/pages/dashboard/Chart.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ ChartJS.register(
3636
Tooltip
3737
)
3838

39-
function getRewardValue (data: RewardsRecord['totalRewardsReceived'], moduleId: string) {
40-
if (moduleId === 'all') {
39+
function getRewardValue (data: RewardsRecord['totalRewardsReceived'], subnetId: string) {
40+
if (subnetId === 'all') {
4141
return bigIntFilToNumber(sumAllRewards(data))
4242
}
4343

44-
return bigIntFilToNumber(data[moduleId])
44+
return bigIntFilToNumber(data[subnetId])
4545
}
4646

4747
const Chart = ({
4848
historicalRewards,
4949
timeRange,
50-
moduleId
50+
subnetId
5151
}: {
5252
historicalRewards: RewardsRecord[];
5353
timeRange: TimeRange;
54-
moduleId: string;
54+
subnetId: string;
5555
}) => {
5656
const [aspectRatio, setAspectRatio] = useState<number>()
5757
const containerRef = useRef<HTMLDivElement>(null)
@@ -67,22 +67,22 @@ const Chart = ({
6767
}>(
6868
(acc, record, index) => {
6969
acc.labels.push(new Date(record.timestamp).getTime())
70-
acc.totalRewards.push(getRewardValue(record.totalRewardsReceived, moduleId))
71-
const isPayout = index > 0 && getRewardValue(record.totalRewardsReceived, moduleId) >
72-
getRewardValue(historicalRewards[index - 1].totalRewardsReceived, moduleId)
70+
acc.totalRewards.push(getRewardValue(record.totalRewardsReceived, subnetId))
71+
const isPayout = index > 0 && getRewardValue(record.totalRewardsReceived, subnetId) >
72+
getRewardValue(historicalRewards[index - 1].totalRewardsReceived, subnetId)
7373
acc.scheduled.push(
7474
isPayout
75-
? getRewardValue(record.totalRewardsReceived, moduleId)
76-
: getRewardValue(record.totalScheduledRewards, moduleId) +
77-
getRewardValue(record.totalRewardsReceived, moduleId)
75+
? getRewardValue(record.totalRewardsReceived, subnetId)
76+
: getRewardValue(record.totalScheduledRewards, subnetId) +
77+
getRewardValue(record.totalRewardsReceived, subnetId)
7878
)
7979
return acc
8080
}, {
8181
labels: [],
8282
totalRewards: [],
8383
scheduled: []
8484
})
85-
, [historicalRewards, moduleId])
85+
, [historicalRewards, subnetId])
8686

8787
const onTooltipUpdate = useCallback<ExternalToltipHandler>((args) => {
8888
if (!tooltipRef.current) {

0 commit comments

Comments
 (0)