jtgrassie / monero-pool

A Monero mining pool server written in C
BSD 3-Clause "New" or "Revised" License
344 stars 125 forks source link

API Endpoints #120

Closed OlMi1 closed 2 years ago

OlMi1 commented 2 years ago

The file responsible for web communication does not really help me understand what API Endpoints exists. I know of: /stats /workers But not which arguments they support. Maybe this could be added to the readme.md?

jtgrassie commented 2 years ago

The only endpoints are /stats and /workers, there are no arguments. Any half competent web dev can see what's going on simply by loading the reference pool and opening the browsers inspector tools.

OlMi1 commented 2 years ago

No reason to get salty my guy. So there's no way to view the hashrate of an address? Why does the template then even exists? (From /stats:


miner_hashrate":0,"miner_hashrate_stats":[0,0,0,0,0,0],"miner_balance":0.00000000,"worker_count
```)
jtgrassie commented 2 years ago

So there's no way to view the hashrate of an address?

Of course there is, that's one thing /stats reports on:

Screen Shot 2022-01-28 at 9 30 47 AM

No reason to get salty my guy.

It's tedious explaining to people things they should be able see with their eyes. This is a bug tracker, not a user support forum.

OlMi1 commented 2 years ago

Of course there is, that's one thing /stats reports on:

I saw that when looking through the HTML for the web UI and the c class but could not really figure out How to add the address as argument since it does not seem to be server/stats/address or server/address/stats.

It's tedious explaining to people things they should be able see with their eyes. This is a bug tracker, not a user support forum.

Agreed, but in this case I was not able to reconstruct how to access the API from the source code provided. Btw, I did not intend to offend you or anything, sorry if I did.

jtgrassie commented 2 years ago

I was not able to reconstruct how to access the API from the source code provided

If you look at the HTML, you'll see the wallet address field (#address) gets stored in a cookie (in the onblur function).

Now please, this is a bug tracker, not a user support forum.

OlMi1 commented 2 years ago

Okay, so summing up: The cookie "wa" contains the XMR address, and when /stats is called, it uses that cookie to give address data. Thank you for your help!