Skip to content

Commit

Permalink
Add response states
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhn committed Apr 20, 2020
1 parent 76da258 commit fa4c99f
Showing 1 changed file with 100 additions and 4 deletions.
104 changes: 100 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Folding@home web proxy
When [Folding@home](https://foldingathome.org) is running, its web client is also available at http://127.0.0.1:7396. This client makes API calls to server on intervals to update client status and ongoing work progress then receive status data and display to user.
When [Folding@home](https://foldingathome.org) operates, its web client is also available at http://127.0.0.1:7396. This client makes API calls to server on intervals to update client status and ongoing work progress then receive status data and display to user.

This proxy is a wrapper on the web client to watch for its API calls and capture response data to use it for your own purposes.

## Response format
```
### Attributes and their values
```json
{
id: '00',
status: 'READY' | 'RUNNING' | 'STOPPING' | 'PAUSED',
description: 'cpu:5' | 'cpu:11' | 'cpu:12',
options: { idle: 'true', paused: 'true' },
reason: 'waiting for idle' | 'on battery',
reason: 'by user' | 'waiting for idle' | 'on battery',
idle: true,
unit_id: 0,
project: 16384,
Expand All @@ -22,7 +23,102 @@ This proxy is a wrapper on the web client to watch for its API calls and capture
ppd: '65536',
creditestimate: '9216',
waitingon: 'unit download' | 'WS Assignment',
nextattempt: '0.00 secs',
nextattempt: '10.24 secs' | '20 mins 48 secs',
timeremaining: '7 days' | 'unknown time'
}
```

### `READY` state
#### Wait for new work unit
```json
{
...
status: 'READY',
...
waitingon: 'WS Assignment',
nextattempt: '2 hours 1 mins 21 secs',
timeremaining: 'unknown time'
}
```

### `RUNNING` state
```json
{
...
status: 'RUNNING',
...
project: 14400,
run: 0,
clone: 1920,
gen: 56,
percentdone: '9.01%',
eta: '1 hours 55 mins',
ppd: '69651',
creditestimate: '6127',
...
timeremaining: '6.99 days'
}
```

### `STOPPING` state
#### By user
```json
{
...
status: 'STOPPING',
...
options: { paused: 'true' },
reason: 'by user',
...
}
```

#### Wait for idle
```json
{
...
status: 'STOPPING',
...
options: { idle: 'true', paused: 'false' },
reason: 'waiting for idle',
idle: true,
...
}
```

### `PAUSED` state
#### By user
```json
{
...
status: 'PAUSED',
...
options: { paused: 'true' },
reason: 'by user',
...
}
```

#### Wait for idle
```json
{
...
status: 'PAUSED',
...
options: { idle: 'true', paused: 'false' },
reason: 'waiting for idle',
idle: true,
...
}
```

#### On battery
```json
{
...
status: 'PAUSED',
...
reason: 'on battery',
...
}
```

0 comments on commit fa4c99f

Please sign in to comment.