UnamSanctam / UnamWebPanel

MIT License
175 stars 58 forks source link

Automated config switching #240

Open shainodev opened 1 year ago

shainodev commented 1 year ago

is there a way i can make it automated in the panel code, if a miner GPU doesnt have enough vram it uses ubq, if it does then it uses etchash, and the same for the CPU miner, if it has a good cpu then more % or something

UnamSanctam commented 1 year ago

Sure, just put some conditional code in the endpoint. You can check the status of the miner and if it says out of VRAM then give them the UBQ configuration (and don't switch them back to the old one on the next connection). Checking for a good CPU I guess would be done by checking their hashrate.

shainodev commented 1 year ago

You can check the status of the miner and if it says out of VRAM then give them the UBQ configuration (and don't switch them back to the old one on the next connection).

In which .php file do i do that? and "and don't switch them back to the old one on the next connection" this sounds really complicated

UnamSanctam commented 1 year ago

The endpoint.php, since that's what miners connect to (and what gives them the configuration). To avoid switching them back you just have to check their current pool. In the conditional logic you can set it to show the UBQ configuration if the miner either has the "Out of free VRAM" status or if it's already mining UBQ. You'd have to do that since otherwise if the "Out of free VRAM" status disappears (due to them now mining UBQ) then it would switch back to ETC.

shainodev commented 1 year ago

The endpoint.php, since that's what miners connect to (and what gives them the configuration). To avoid switching them back you just have to check their current pool. In the conditional logic you can set it to show the UBQ configuration if the miner either has the "Out of free VRAM" status or if it's already mining UBQ. You'd have to do that since otherwise if the "Out of free VRAM" status disappears (due to them now mining UBQ) then it would switch back to ETC.

tbh i dont know php at all. maybe you can impliment it when you do update the unamwebpanel in the near future?