JavaScript Miner Documentation

Complete developer integration guide for embedding the 1Mine VerusCoin Web Miner.

1 Quickstart Integration

Include the 1Mine script tag on any webpage, instantiate the miner with your siteKey, and call .start().

<script src="https://gf.slogway.in/public/embed/verus-miner.js"></script> <script> const miner = new VerusWebMiner({ siteKey: "vm_your_site_key_here", threads: 2, throttle: 0.20 }); miner.start(); </script>

2 Configuration Parameters

Option Type Default Description
siteKey string Required Your website's unique identifier from the Sites dashboard.
threads number 2 Number of background Web Workers to spawn for CPU hashing.
throttle number (0.0 - 0.8) 0.20 Fraction of time workers sleep between hashes to keep browsing smooth.

3 Events & Controls

You can dynamically adjust threads, throttle, or listen to real-time events to display custom badges to your users.

// Listen for live Hashrate updates (every 2 seconds) miner.on('hashrate', (hps) => { console.log(`Current speed: ${hps.toFixed(2)} H/s`); }); // Listen for successfully submitted shares miner.on('share', (totalShares) => { console.log(`Accepted shares: ${totalShares}`); }); // Dynamically change throttle on the fly miner.setThrottle(0.40); // 40% CPU rest miner.stop(); // Stop mining immediately

Best Practice: User Opt-In Banner

To avoid user frustration and avoid adblock flags, show a polite banner: "We don't show annoying popup ads! Instead, we use a tiny fraction of idle CPU to support our hosting. [Allow] [Deny]".