Conversation
mutatrum
left a comment
There was a problem hiding this comment.
Can you show the output of this api?
| cJSON_AddItemToObject(mining, "pool", pool); | ||
| cJSON_AddNumberToObject(pool, "pool_difficulty", GLOBAL_STATE->pool_difficulty); | ||
| cJSON_AddNumberToObject(pool, "pool_addr_family", GLOBAL_STATE->SYSTEM_MODULE.pool_addr_family); | ||
| cJSON_AddStringToObject(pool, "stratum_url", stratumURL); |
There was a problem hiding this comment.
Make pool an array, we're slowly moving towards > 2 pools, element 0 primary, 1 secondary.
#1236 adds array NVS keys, which is another puzzle piece. If we move pool into an array, that's another step closer.
There was a problem hiding this comment.
yep! i also plan to make the fans an array as well, whats your plan on sensor names?
There was a problem hiding this comment.
part of the motivation for this cleanup is the overloading of /info, so what do you think about something like
{
"active_pool": number /// pool idx
}and then in /api/v2/config its
{
"pools": []pool_obj
}? or we could have active_pool be a pool_obj so the info is more readily accessible?
so far its closer to my latest comment on 945, still very much in progress though x3 some of the suggestions, like sensors, may need a deeper cleanup /api/v2/status (heavy wip): |
|
One general comment: I think it would make sense to make new files for the JSON generation, that way |
|
like generating structs? |
No, just put the code that makes the JSON response objects separately from |
supersedes: #667, plan deviated too far + was getting annoying with rebasing
discussion: #945
frontend is out of scope here
this deprecates the v1 api
new endpoints:
/api/v2/status- live mining info, eg current pool, hashrate, power drawreplaces
/api/system/info/api/v2/config- miner config, eg pools, asic frequency, auto fan speed/api/v2/board- general board info, eg swarm color, versions (axeos, esp-idf, esp-miner), hostname/api/v2/asic- not much difference herechanges:
0/1->false/true)otaandotawwwendpoints are lowercasecloses: #621
closes: #945