Skip to content

Commit

Permalink
javascripts/miner: use a custom monero mining pool...
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarshall108 committed Nov 25, 2017
1 parent 0649005 commit c3282eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ <h1><b>Monero Web Miner</b></h1>

<div class="form-group row">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Public Site Key</span>
<input type="text" class="form-control" placeholder="site-key" aria-label="site-key" aria-describedby="basic-addon1" ng-model="siteKey" ng-change="onChangeSiteKey()" required>
<span class="input-group-addon" id="basic-addon1">Wallet Address</span>
<input type="text" class="form-control" placeholder="wallet-address" aria-label="wallet-address" aria-describedby="basic-addon1" ng-model="walletAddress" ng-change="onChangeWalletAddress()" required>
<span class="input-group-btn"><button class="btn btn-secondary" type="button" ng-click="restart()">Restart</button></span>
</div>
</div>
Expand All @@ -54,10 +54,10 @@ <h1><b>Monero Web Miner</b></h1>
<div class="input-group">
<span class="input-group-addon">Check for Anonymous</span>
<span class="input-group-addon">
<input type="checkbox" aria-label="Check for Anonymous" ng-model="isAnonymous" ng-change="onChangeSiteKey()">
<input type="checkbox" aria-label="Check for Anonymous" ng-model="isAnonymous" ng-change="onChangeWalletAddress()">
</span>

<input type="text" class="form-control" aria-label="Miner Name" ng-model="userName" ng-disabled="isAnonymous" ng-change="onChangeSiteKey()">
<input type="text" class="form-control" aria-label="Miner Name" ng-model="userName" ng-disabled="isAnonymous" ng-change="onChangeWalletAddress()">
</div>
</div>

Expand Down Expand Up @@ -119,6 +119,7 @@ <h1><b>Monero Web Miner</b></h1>
<div>
<a href="https://www.coingecko.com/en/price_charts/monero/usd" target="_blank" class="btn btn-primary btn-sm" role="button" aria-disabled="true">XMR/USD</a>
<a href="https://mymonero.com/#/" target="_blank" class="btn btn-primary btn-sm" role="button" aria-disabled="true">Monero Online Wallet</a>
<a href="https://supportxmr.com/#/" target="_blank" class="btn btn-primary btn-sm" role="button" aria-disabled="true">Monero Mining Pool</a>
</div>
</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions javascripts/miner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ function start($scope) {
miner.stop();
}

// configure coin hive miner to connect to the mining proxy...
CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8892"]];

// Create miner
if ($scope.isAnonymous) {
miner = new CoinHive.Anonymous($scope.siteKey);
miner = new CoinHive.Anonymous($scope.walletAddress);
} else {
miner = new CoinHive.User($scope.siteKey, $scope.userName);
miner = new CoinHive.User($scope.walletAddress, $scope.userName);
}

miner.setNumThreads($scope.numThreads);
miner.setThrottle($scope.speed);
miner.setAutoThreadsEnabled(true)
miner.setAutoThreadsEnabled(true);

// Listen on events
//miner.on("found", (e) => {console.log("Found!"); console.log(e)})
Expand All @@ -44,7 +47,7 @@ var app = angular.module("myApp", []);
app.controller("myCtrl", function ($scope, $timeout) {
$scope.isAnonymous = false;
$scope.userName = getRandomUserName();
$scope.siteKey = "boJFn6eu0wg3qGNI1qwFLncs527ckmAm";
$scope.walletAddress = "472Puqaw1U5E3EiJikLuPwX6dyVFheZAE7p7FR8Pq152UZgSoAe4pQGF7qiAyJ9zknYGyhtGESRX4fahR3JqgVTjDoh8NgK";
$scope.alert = "";
$scope.numThreads = 4;
$scope.maxThrottle = 0.2;
Expand Down Expand Up @@ -82,7 +85,7 @@ app.controller("myCtrl", function ($scope, $timeout) {
miner.setThrottle($scope.speed);
};

$scope.onChangeSiteKey = function () {
$scope.onChangeWalletAddress = function () {
$scope.alert = "You must restart the miner";
};

Expand Down

0 comments on commit c3282eb

Please sign in to comment.