Skip to content

Commit cbd462e

Browse files
Merge pull request #58 from ROZ-MOFUMOFU-ME/dev
Dev
2 parents dbf56c0 + a9c2609 commit cbd462e

32 files changed

+614
-346
lines changed

.circleci/config.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
command: npm install
1313
- run:
1414
name: Run test
15-
command: npm start
15+
command: npm run test
1616
- run:
17-
name: Verify build
17+
name: Verify build and test
1818
command: echo "Build and test completed successfully!"
1919
test-v10:
2020
docker:
@@ -28,9 +28,9 @@ jobs:
2828
command: npm install
2929
- run:
3030
name: Run test
31-
command: npm start
31+
command: npm run test
3232
- run:
33-
name: Verify build
33+
name: Verify build and test
3434
command: echo "Build and test completed successfully!"
3535
test-v12:
3636
docker:
@@ -44,9 +44,9 @@ jobs:
4444
command: npm install
4545
- run:
4646
name: Run test
47-
command: npm start
47+
command: npm run test
4848
- run:
49-
name: Verify build
49+
name: Verify build and test
5050
command: echo "Build and test completed successfully!"
5151
test-v14:
5252
docker:
@@ -60,9 +60,9 @@ jobs:
6060
command: npm install
6161
- run:
6262
name: Run test
63-
command: npm start
63+
command: npm run test
6464
- run:
65-
name: Verify build
65+
name: Verify build and test
6666
command: echo "Build and test completed successfully!"
6767
test-v16:
6868
docker:
@@ -76,9 +76,9 @@ jobs:
7676
command: npm install
7777
- run:
7878
name: Run test
79-
command: npm start
79+
command: npm run test
8080
- run:
81-
name: Verify build
81+
name: Verify build and test
8282
command: echo "Build and test completed successfully!"
8383
test-v18:
8484
docker:
@@ -87,17 +87,14 @@ jobs:
8787
- checkout
8888
- node/install:
8989
node-version: "18.20"
90-
- run:
91-
name: update
92-
command: sudo apt update && sudo apt install -y libssl-dev
9390
- run:
9491
name: Run build
9592
command: npm install
9693
- run:
9794
name: Run test
98-
command: npm start
95+
command: npm run test
9996
- run:
100-
name: Verify build
97+
name: Verify build and test
10198
command: echo "Build and test completed successfully!"
10299
test-v20:
103100
docker:
@@ -111,30 +108,30 @@ jobs:
111108
command: npm install
112109
- run:
113110
name: Run test
114-
command: npm start
111+
command: npm run test
115112
- run:
116-
name: Verify build
113+
name: Verify build and test
117114
command: echo "Build and test completed successfully!"
118115
test-v22:
119116
docker:
120117
- image: cimg/base:stable
121118
steps:
122119
- checkout
123120
- node/install:
124-
node-version: "22.11"
121+
node-version: "22.12"
125122
- run:
126123
name: Run build
127124
command: npm install
128125
- run:
129126
name: Run test
130-
command: npm start
127+
command: npm run test
131128
- run:
132-
name: Verify build
129+
name: Verify build and test
133130
command: echo "Build and test completed successfully!"
134131
workflows:
135132
build_and_test:
136133
jobs:
137134
- test-v16
138135
- test-v18
139136
- test-v20
140-
- test-v22
137+
- test-v22

.github/workflows/node.js.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
1312
strategy:
1413
matrix:
@@ -20,9 +19,9 @@ jobs:
2019
uses: actions/setup-node@v4
2120
with:
2221
node-version: ${{ matrix.node-version }}
23-
- name: npm install
24-
run: npm test
25-
- name: npm start
26-
run: npm start
27-
- name: Verify build
28-
run: echo "Build and test completed successfully!"
22+
- name: Run build
23+
run: npm isntall
24+
- name: Run test
25+
run: npm run test
26+
- name: Verify build and test
27+
run: echo "Build and test completed successfully!"

coins/coins-examples-testnet/sugarchain.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"algorithm": "yespowerSUGAR",
55
"peerMagic": "9feb4b9d",
66
"peerMagicTestnet": "b0119070",
7+
"getInfo": false,
8+
"noNetworkInfo": false,
9+
"noGetnetworkhashps": true,
710
"testnet": {
811
"bech32": "tugar",
912
"bip32": {
@@ -12,5 +15,9 @@
1215
"pubKeyHash": "42",
1316
"scriptHash": "80"
1417
},
15-
"blockTime": 5
16-
}
18+
"blockTime": 5,
19+
"explorer": {
20+
"txURL": "https://sugarchain.org/esplora-testnet/tx/",
21+
"blockURL": "https://sugarchain.org/esplora-testnet/block/"
22+
}
23+
}

coins/coins-examples-testnet/susucoin.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
"algorithm": "sha256d",
55
"peerMagic": "f9beb9e9",
66
"peerMagicTestnet": "0c120807",
7-
"blockTime": 120
7+
"getInfo": false,
8+
"noNetworkInfo": false,
9+
"noGetnetworkhashps": true,
10+
"blockTime": 120,
11+
"version_mask": true
812
}

coins/coins-examples/susucoin.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"noNetworkInfo": false,
99
"noGetnetworkhashps": true,
1010
"blockTime": 120,
11+
"version_mask": true,
1112
"explorer": {
12-
"txURL": "https://explore.susukino.com/tx/",
13-
"blockURL": "https://explore.susukino.com/block/"
13+
"txURL": "https://explorer.susu.mofumofu.me/tx/",
14+
"blockURL": "https://explorer.susu.mofumofu.me/block/"
1415
}
15-
}
16+
}

config_example.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
{
22
"logLevel": "debug",
33
"logColors": true,
4-
54
"cliPort": 17117,
6-
75
"clustering": {
86
"enabled": true,
97
"forks": "auto"
108
},
11-
129
"defaultPoolConfigs": {
1310
"blockRefreshInterval": 500,
1411
"jobRebroadcastTimeout": 55,
@@ -29,33 +26,30 @@
2926
"password": ""
3027
}
3128
},
32-
3329
"website": {
3430
"enabled": true,
3531
"host": "0.0.0.0",
3632
"port": 8080,
3733
"stratumHost": "cryppit.com",
3834
"stats": {
39-
"updateInterval": 30,
40-
"historicalRetention": 14400,
41-
"hashrateWindow": 300
35+
"updateInterval": 300,
36+
"historicalRetention": 28800,
37+
"hashrateWindow": 600
4238
},
4339
"adminCenter": {
4440
"enabled": false,
4541
"password": "password"
4642
},
47-
"tlsOptions" : {
43+
"tlsOptions": {
4844
"enabled": false,
4945
"cert": "",
5046
"key": ""
5147
}
5248
},
53-
5449
"redis": {
5550
"host": "127.0.0.1",
5651
"port": 6379
5752
},
58-
5953
"switching": {
6054
"switch1": {
6155
"enabled": false,
@@ -106,7 +100,6 @@
106100
}
107101
}
108102
},
109-
110103
"profitSwitch": {
111104
"enabled": false,
112105
"updateInterval": 600,
@@ -116,4 +109,4 @@
116109
"useMintpal": true,
117110
"useBittrex": true
118111
}
119-
}
112+
}

libs/api.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
var redis = require('redis');
2-
var async = require('async');
3-
41
var stats = require('./stats.js');
52

63
module.exports = function(logger, portalConfig, poolConfigs){
@@ -55,7 +52,7 @@ module.exports = function(logger, portalConfig, poolConfigs){
5552
portalStats.getTotalSharesByAddress(address, function(shares) {
5653
var totalHash = parseFloat(0.0);
5754
var totalShares = shares;
58-
var networkSols = 0;
55+
var networkHash = 0;
5956
for (var h in portalStats.statHistory) {
6057
for(var pool in portalStats.statHistory[h].pools) {
6158
for(var w in portalStats.statHistory[h].pools[pool].workers){
@@ -85,11 +82,11 @@ module.exports = function(logger, portalConfig, poolConfigs){
8582
workers[w].balance = (workers[w].balance || 0);
8683
workers[w].paid = (workers[w].paid || 0);
8784
totalHash += portalStats.stats.pools[pool].workers[w].hashrate;
88-
networkSols = portalStats.stats.pools[pool].poolStats.networkSols;
85+
networkHash = portalStats.stats.pools[pool].poolStats.networkHash;
8986
}
9087
}
9188
}
92-
res.end(JSON.stringify({miner: address, totalHash: totalHash, totalShares: totalShares, networkSols: networkSols, immature: balances.totalImmature, balance: balances.totalHeld, paid: balances.totalPaid, workers: workers, history: history}));
89+
res.end(JSON.stringify({miner: address, totalHash: totalHash, totalShares: totalShares, networkHash: networkHash, immature: balances.totalImmature, balance: balances.totalHeld, paid: balances.totalPaid, workers: workers, history: history}));
9390
});
9491
});
9592
} else {

libs/apiCoinWarz.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var request = require('axios');
2-
var nonce = require('nonce');
2+
var crypto = require('crypto');
33

44
module.exports = function() {
55
'use strict';
@@ -9,10 +9,10 @@ module.exports = function() {
99
// Constants
1010
var version = '0.0.1',
1111
PUBLIC_API_URL = 'http://www.coinwarz.com/v1/api/profitability/?apikey=YOUR_API_KEY&algo=all',
12-
USER_AGENT = 'nomp/node-open-mining-portal'
12+
USER_AGENT = 'nomp/node-open-mining-portal';
1313

1414
// Constructor
15-
function Cryptsy(key, secret){
15+
function CoinWarz(key, secret){
1616
// Generate headers signed by this user's key and secret.
1717
// The secret is encapsulated and never exposed
1818
this._getPrivateHeaders = function(parameters){
@@ -37,7 +37,7 @@ module.exports = function() {
3737
}
3838

3939
// If a site uses non-trusted SSL certificates, set this value to false
40-
Cryptsy.STRICT_SSL = true;
40+
CoinWarz.STRICT_SSL = true;
4141

4242
// Helper methods
4343
function joinCurrencies(currencyA, currencyB){
@@ -107,9 +107,7 @@ module.exports = function() {
107107

108108
return this._public(parameters, callback);
109109
},
110+
};
110111

111-
112-
////
113-
114112
return CoinWarz;
115-
}();
113+
};

libs/logUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var PoolLogger = function (configuration) {
4545
subcat = realSubCat;
4646
}
4747

48-
var entryDesc = dateFormat(new Date(), 'yyyy-mm-dd HH:MM:ss') + ' [' + system + ']\t';
48+
var entryDesc = dateFormat(new Date(), 'yyyy/mm/dd HH:MM:ss') + ' [' + system + ']\t';
4949
if (logColors) {
5050
entryDesc = severityToColor(severity, entryDesc);
5151

libs/mposCompatibility.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var mysql = require('mysql');
2-
var cluster = require('cluster');
32
module.exports = function(logger, poolConfig){
43

54
var mposConfig = poolConfig.mposMode;

0 commit comments

Comments
 (0)