MarcoCiaramella / cpu-web-miner

CPU web miner
https://www.npmjs.com/package/@marco_ciaramella/cpu-web-miner
MIT License
1 stars 4 forks source link

Custom options from the client side #17

Open williamarmenta54 opened 5 days ago

williamarmenta54 commented 5 days ago

It's good to see that this project is adding more features and growing. However the project is very restrictive from the client/or the visitor of the site that is being monetized.

Sometimes a visitor knows enough to set up their own VPS and deploy your web miner but has CPU's with different specifications or Cores. So it becomes very crucial that your web miner does not exhaust all the CPU cores when the website is being visited, therefore it would be very useful that the visitor be able to set the number of CPU cores used even though they don't have have root access to the VPS where the miner is installed.

A person visiting the website should be able to set number of threads used by the miner for his different CPU's/Computers, It should not only be up to the VPS owner who can only set high CPU cores even for visitors with low spec CPU's/Computers.

Sometimes someone own a great number of spare computers but does not want to use Xmrig or SRBMiner, he/she only wants to use your nodejs app. One configuration that uses all of CPU cores/threads from the server will not be feasible for all of his/her CPU's, thereby satisfying the need for you to implement a way that a website visitor be able to set variables according to his needs without having to change values on the VPS where the nodejs app is installed.

When your CPU web Miner is installed, should not only hardcode one algorithm per VPS, consider a way where all supported algorithms are installed/enabled by default, maybe if the website visitor did not set any custom values (such as algo, pool, no. of cores), then randomly mine an algo that points to the hardcoded website owner's wallet .

A good example is this website: https://webminer.pages.dev

A user sets a pool, algo number of cores, etc, but uses the owner's server where the code runs.

If I go to https://webminer.pages.dev?algorithm=minotaurx&host=fastpool.xyz&port=6000&worker=solo%3AMBqp1j1SARjzcy5ukYdAuriCaFX2hDpNgK%40%24Test&password=x&workers=4

The code will solo mine Maza coin at fastpool using 4 cores/threads without having to install anything, and without owning any VPS.

The use has control to set custom values, can you tweak your app so the user/visitor can set custom values too?

MarcoCiaramella commented 5 days ago

hello @williamarmenta54 not sure I got your question.

First of all https://webminer.pages.dev/ is a web miner that uses my lib cpu-web-miner but the owner lost the project and is not updated.

About your question, I don't get why you talk about nodejs app. All the algos and logics are in this js module. This js module is a WHOLE miner which runs algo in wasm. When you call start() function in your website code this base64 string is ran on a Web Worker. You can set the number of Web Workers (threads) by passing a value for n. thread parameter.

There is no hardcoded algo and if you want to leave a user set parameters you have to implement an interface for it.

The main purposes of this js library are two. Monetize website, in this case the web developer installs the miner on his website and uses his own stratum config, or provide a web miner to users. In this case you explicitly create a page with an inteface where user adds his own stratum config like the website you mentioned.