Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON API #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

dsbaars
Copy link

@dsbaars dsbaars commented Oct 20, 2024

As described in #15 , I added JSON API calls using jansson and rewrote the dashboard HTML pages to consume the API's. These pages now automatically update as well.

It is stil quick and dirty but at least now there is a usable API for monitoring and integration with other applications.

Home

/api/v1/stratum_server_info
/api/v1/client_stats (might be better named gateway stats?)
/api/v1/current_stratum_job

Clients

/api/v1/clients

Threads

/api/v1/threads

Coinbaser

/api/v1/coinbaser

@luke-jr
Copy link
Contributor

luke-jr commented Oct 20, 2024

But now the web interface requires Javascript :(

What do you think of something like #21 ?

@dsbaars
Copy link
Author

dsbaars commented Oct 20, 2024

But now the web interface requires Javascript :(

It already required JavaScript for the killing/disconnecting of stratum clients...
Doing a HTTP request for each property doesn't seem very efficient, but it does the job.
It looks like your solution works for just for the homepage but not (yet?) for client/thread statistics, and to make those machine-readable I don't see a way other than JSON/MsgPack.

@wizkid057
Copy link
Collaborator

I'm not a fan of requiring javascript for the dashboard, but it's great if it functions wo/javascript and is augmented by javascript for updating data wo/refreshing and such.

@luke-jr
Copy link
Contributor

luke-jr commented Oct 21, 2024

It already required JavaScript for the killing/disconnecting of stratum clients...

Fixed in #25 :)

@luke-jr luke-jr added the enhancement New feature or request label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants