Skip to content

Commit 7c74bae

Browse files
chore: Update configuration, dependencies, and website features
- Updated package version to 1.2.11 and adjusted dependencies in package.json and package-lock.json. - Modified website configuration in config_example.json, including stats update intervals and historical retention. - Enhanced website functionality with language selection and improved UI elements in HTML and CSS files. - Refactored init.js to streamline error handling and process exit conditions. - Updated CircleCI and GitHub Actions workflows to run tests instead of starting the application directly. - Added new explorer URLs for coins in JSON configuration files. - Removed unused modernizr-custom.js file to clean up the project.
1 parent 1593afa commit 7c74bae

File tree

16 files changed

+741
-405
lines changed

16 files changed

+741
-405
lines changed

.circleci/config.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
steps:
99
- checkout
1010
- run:
11-
name: Install
11+
name: Run build
1212
command: npm install
1313
- run:
14-
name: Start
15-
command: npm start
14+
name: Run test
15+
command: npm run test
1616
- run:
17-
name: Verify
18-
command: echo "Build completed successfully!"
17+
name: Verify build and test
18+
command: echo "Build and test completed successfully!"
1919
test-v10:
2020
docker:
2121
- image: cimg/base:stable
@@ -24,14 +24,14 @@ jobs:
2424
- node/install:
2525
node-version: "10.24"
2626
- run:
27-
name: Install
27+
name: Run build
2828
command: npm install
2929
- run:
30-
name: Start
31-
command: npm start
30+
name: Run test
31+
command: npm run test
3232
- run:
33-
name: Verify
34-
command: echo "Build completed successfully!"
33+
name: Verify build and test
34+
command: echo "Build and test completed successfully!"
3535
test-v12:
3636
docker:
3737
- image: cimg/base:stable
@@ -40,14 +40,14 @@ jobs:
4040
- node/install:
4141
node-version: "12.22"
4242
- run:
43-
name: Install
43+
name: Run build
4444
command: npm install
4545
- run:
46-
name: Start
47-
command: npm start
46+
name: Run test
47+
command: npm run test
4848
- run:
49-
name: Verify
50-
command: echo "Build completed successfully!"
49+
name: Verify build and test
50+
command: echo "Build and test completed successfully!"
5151
test-v14:
5252
docker:
5353
- image: cimg/base:stable
@@ -56,14 +56,14 @@ jobs:
5656
- node/install:
5757
node-version: "14.21"
5858
- run:
59-
name: Install
59+
name: Run build
6060
command: npm install
6161
- run:
62-
name: Start
63-
command: npm start
62+
name: Run test
63+
command: npm run test
6464
- run:
65-
name: Verify
66-
command: echo "Build completed successfully!"
65+
name: Verify build and test
66+
command: echo "Build and test completed successfully!"
6767
test-v16:
6868
docker:
6969
- image: cimg/base:stable
@@ -72,14 +72,14 @@ jobs:
7272
- node/install:
7373
node-version: "16.20"
7474
- run:
75-
name: Install
75+
name: Run build
7676
command: npm install
7777
- run:
78-
name: Start
79-
command: npm start
78+
name: Run test
79+
command: npm run test
8080
- run:
81-
name: Verify
82-
command: echo "Build completed successfully!"
81+
name: Verify build and test
82+
command: echo "Build and test completed successfully!"
8383
test-v18:
8484
docker:
8585
- image: cimg/base:stable
@@ -88,14 +88,14 @@ jobs:
8888
- node/install:
8989
node-version: "18.20"
9090
- run:
91-
name: Install
91+
name: Run build
9292
command: npm install
9393
- run:
94-
name: Start
95-
command: npm start
94+
name: Run test
95+
command: npm run test
9696
- run:
97-
name: Verify
98-
command: echo "Build completed successfully!"
97+
name: Verify build and test
98+
command: echo "Build and test completed successfully!"
9999
test-v20:
100100
docker:
101101
- image: cimg/base:stable
@@ -104,30 +104,30 @@ jobs:
104104
- node/install:
105105
node-version: "20.18"
106106
- run:
107-
name: Install
107+
name: Run build
108108
command: npm install
109109
- run:
110-
name: Start
111-
command: npm start
110+
name: Run test
111+
command: npm run test
112112
- run:
113-
name: Verify
114-
command: echo "Build completed successfully!"
113+
name: Verify build and test
114+
command: echo "Build and test completed successfully!"
115115
test-v22:
116116
docker:
117117
- image: cimg/base:stable
118118
steps:
119119
- checkout
120120
- node/install:
121-
node-version: "22.11"
121+
node-version: "22.12"
122122
- run:
123-
name: Install
123+
name: Run build
124124
command: npm install
125125
- run:
126-
name: Start
127-
command: npm start
126+
name: Run test
127+
command: npm run test
128128
- run:
129-
name: Verify
130-
command: echo "Build completed successfully!"
129+
name: Verify build and test
130+
command: echo "Build and test completed successfully!"
131131
workflows:
132132
build_and_test:
133133
jobs:

.github/workflows/node.js.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Node.js CI
22

33
on:
44
push:
5-
branches: ["main", "dev"]
5+
branches: [ "main", "dev" ]
66
pull_request:
7-
branches: ["main", "dev"]
7+
branches: [ "main", "dev" ]
88

99
jobs:
1010
build:
@@ -14,17 +14,14 @@ jobs:
1414
node-version: [16.x, 18.x, 20.x, 22.x]
1515

1616
steps:
17-
- uses: actions/checkout@v4
18-
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: ${{ matrix.node-version }}
22-
23-
- name: Install
24-
run: npm install
25-
26-
- name: Start
27-
run: npm start
28-
29-
- name: Verify
30-
run: echo "Build completed successfully!"
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
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+
}

init.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ var algos = require('stratum-pool/lib/algoProperties.js');
1818

1919
JSON.minify = JSON.minify || require("node-json-minify");
2020

21-
try {
22-
if (!fs.existsSync('config.json')) {
23-
console.log('config.json file does not exist. Read the installation/setup instructions.');
24-
process.exit(0);
25-
}
26-
} catch (error) {
27-
console.error("An unexpected error occurred:", error);
28-
process.exit(1);
21+
if (!fs.existsSync('config.json')) {
22+
console.log('config.json file does not exist. Read the installation/setup instructions.');
23+
process.exit(0);
2924
}
3025

3126
var portalConfig = JSON.parse(JSON.minify(fs.readFileSync("config.json", { encoding: 'utf8' })));
@@ -230,7 +225,7 @@ var spawnPoolWorkers = function () {
230225

231226
if (Object.keys(poolConfigs).length === 0) {
232227
logger.warning('Master', 'PoolSpawner', 'No pool configs exists or are enabled in pool_configs folder. No pools spawned.');
233-
return;
228+
process.exit(0);
234229
}
235230

236231

0 commit comments

Comments
 (0)