Height
Reward
+ Coinbase Tag
Merkle Branches
@@ -24,6 +25,9 @@
+
+ {{ row.job.tag }}
+
@for (cell of row.merkleCells; track $index) {
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
index da0e63967..6679f2257 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
@@ -6,9 +6,16 @@ td {
position: relative;
height: 2em;
- &.height, &.reward {
+ &.height, &.reward, &.tag {
padding: 0 5px;
}
+
+ &.tag {
+ max-width: 180px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
&.pool {
padding-left: 5px;
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
index af34fd091..1ab1a1c94 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
@@ -8,10 +8,14 @@ import { SinglePoolStats } from '../../../interfaces/node-api.interface';
type MerkleCellType = ' ' | '┬' | '├' | '└' | '│' | '─' | 'leaf';
+interface TaggedStratumJob extends StratumJob {
+ tag: string;
+}
+
interface MerkleCell {
hash: string;
type: MerkleCellType;
- job?: StratumJob;
+ job?: TaggedStratumJob;
}
interface MerkleTree {
@@ -22,10 +26,25 @@ interface MerkleTree {
}
interface PoolRow {
- job: StratumJob;
+ job: TaggedStratumJob;
merkleCells: MerkleCell[];
}
+function parseTag(scriptSig: string): string {
+ const hex = scriptSig.slice(8).replace(/6d6d.{64}/, '');
+ const bytes: number[] = [];
+ for (let i = 0; i < hex.length; i += 2) {
+ bytes.push(parseInt(hex.substr(i, 2), 16));
+ }
+ const ascii = new TextDecoder('utf8').decode(Uint8Array.from(bytes)).replace(/\uFFFD/g, '').replace(/\\0/g, '');
+ if (ascii.includes('/ViaBTC/')) {
+ return '/ViaBTC/';
+ } else if (ascii.includes('SpiderPool/')) {
+ return 'SpiderPool/';
+ }
+ return ascii.match(/\/.*\//)?.[0] || ascii;
+}
+
@Component({
selector: 'app-stratum-list',
templateUrl: './stratum-list.component.html',
@@ -60,7 +79,11 @@ export class StratumList implements OnInit, OnDestroy {
this.websocketService.startTrackStratum('all');
}
- processJobs(jobs: Record): PoolRow[] {
+ processJobs(rawJobs: Record): PoolRow[] {
+ const jobs: Record = {};
+ for (const [id, job] of Object.entries(rawJobs)) {
+ jobs[id] = { ...job, tag: parseTag(job.scriptsig) };
+ }
if (Object.keys(jobs).length === 0) {
return [];
}
From d6283c54eef688fdfdf610327b7630d4d9b941fe Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Fri, 25 Oct 2024 07:40:54 +0000
Subject: [PATCH 34/60] fix stratum config
---
backend/mempool-config.sample.json | 4 ++++
backend/src/__fixtures__/mempool-config.template.json | 2 +-
backend/src/__tests__/config.test.ts | 2 +-
backend/src/config.ts | 2 +-
docker/backend/mempool-config.json | 4 ++++
docker/backend/start.sh | 8 ++++++++
6 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json
index 7ad25dff0..c2715153b 100644
--- a/backend/mempool-config.sample.json
+++ b/backend/mempool-config.sample.json
@@ -155,6 +155,10 @@
"API": "https://mempool.space/api/v1/services",
"ACCELERATIONS": false
},
+ "STRATUM": {
+ "ENABLED": false,
+ "API": "http://localhost:1234"
+ },
"FIAT_PRICE": {
"ENABLED": true,
"PAID": false,
diff --git a/backend/src/__fixtures__/mempool-config.template.json b/backend/src/__fixtures__/mempool-config.template.json
index d3380a2ee..0ca5654a5 100644
--- a/backend/src/__fixtures__/mempool-config.template.json
+++ b/backend/src/__fixtures__/mempool-config.template.json
@@ -154,6 +154,6 @@
},
"STRATUM": {
"ENABLED": false,
- "API": "http://127.0.0.1:1234"
+ "API": "http://localhost:1234"
}
}
diff --git a/backend/src/__tests__/config.test.ts b/backend/src/__tests__/config.test.ts
index e76d22545..e0437941f 100644
--- a/backend/src/__tests__/config.test.ts
+++ b/backend/src/__tests__/config.test.ts
@@ -162,7 +162,7 @@ describe('Mempool Backend Config', () => {
expect(config.STRATUM).toStrictEqual({
ENABLED: false,
- API: 'http://127.0.0.1:1234',
+ API: 'http://localhost:1234',
});
});
});
diff --git a/backend/src/config.ts b/backend/src/config.ts
index 0f1f44369..a1050a7d5 100644
--- a/backend/src/config.ts
+++ b/backend/src/config.ts
@@ -338,7 +338,7 @@ const defaults: IConfig = {
},
'STRATUM': {
'ENABLED': false,
- 'API': 'http://127.0.0.1:1234',
+ 'API': 'http://localhost:1234',
}
};
diff --git a/docker/backend/mempool-config.json b/docker/backend/mempool-config.json
index c7ade9b7b..ee8e329a6 100644
--- a/docker/backend/mempool-config.json
+++ b/docker/backend/mempool-config.json
@@ -148,6 +148,10 @@
"API": "__MEMPOOL_SERVICES_API__",
"ACCELERATIONS": __MEMPOOL_SERVICES_ACCELERATIONS__
},
+ "STRATUM": {
+ "ENABLED": __STRATUM_ENABLED__,
+ "API": "__STRATUM_API__"
+ },
"REDIS": {
"ENABLED": __REDIS_ENABLED__,
"UNIX_SOCKET_PATH": "__REDIS_UNIX_SOCKET_PATH__",
diff --git a/docker/backend/start.sh b/docker/backend/start.sh
index d4765972e..8adb631da 100755
--- a/docker/backend/start.sh
+++ b/docker/backend/start.sh
@@ -149,6 +149,10 @@ __REPLICATION_SERVERS__=${REPLICATION_SERVERS:=[]}
__MEMPOOL_SERVICES_API__=${MEMPOOL_SERVICES_API:="https://mempool.space/api/v1/services"}
__MEMPOOL_SERVICES_ACCELERATIONS__=${MEMPOOL_SERVICES_ACCELERATIONS:=false}
+# STRATUM
+__STRATUM_ENABLED__=${STRATUM_ENABLED:=false}
+__STRATUM_API__=${STRATUM_API:="http://localhost:1234"}
+
# REDIS
__REDIS_ENABLED__=${REDIS_ENABLED:=false}
__REDIS_UNIX_SOCKET_PATH__=${REDIS_UNIX_SOCKET_PATH:=""}
@@ -300,6 +304,10 @@ sed -i "s!__REPLICATION_SERVERS__!${__REPLICATION_SERVERS__}!g" mempool-config.j
sed -i "s!__MEMPOOL_SERVICES_API__!${__MEMPOOL_SERVICES_API__}!g" mempool-config.json
sed -i "s!__MEMPOOL_SERVICES_ACCELERATIONS__!${__MEMPOOL_SERVICES_ACCELERATIONS__}!g" mempool-config.json
+# STRATUM
+sed -i "s!__STRATUM_ENABLED__!${__STRATUM_ENABLED__}!g" mempool-config.json
+sed -i "s!__STRATUM_API__!${__STRATUM_API__}!g" mempool-config.json
+
# REDIS
sed -i "s!__REDIS_ENABLED__!${__REDIS_ENABLED__}!g" mempool-config.json
sed -i "s!__REDIS_UNIX_SOCKET_PATH__!${__REDIS_UNIX_SOCKET_PATH__}!g" mempool-config.json
From b254be2f49b7491086743cb5ddeb6b880ea2a813 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Fri, 6 Sep 2024 17:46:12 +0000
Subject: [PATCH 35/60] add stratum job to pool page
---
.../app/components/pool/pool.component.html | 114 ++++++++-
.../app/components/pool/pool.component.scss | 232 +++++++++++-------
.../src/app/components/pool/pool.component.ts | 36 ++-
.../stratum-list/stratum-list.component.ts | 5 +-
4 files changed, 292 insertions(+), 95 deletions(-)
diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html
index b3c6430a8..faa0003c4 100644
--- a/frontend/src/app/components/pool/pool.component.html
+++ b/frontend/src/app/components/pool/pool.component.html
@@ -10,7 +10,7 @@
{{ poolStats.pool.name }}
-
+
+
+
+ Next block
+
+
+
+
+
+
+
+
+
+
+ Height
+ Expected
+ Reward
+ Timestamp
+
+
+
+
+
+ {{ job.height }}
+
+
+
+
+
+ ~
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Coinbase tag
+ Clean
+ Prevhash
+ Job Received
+
+
+
+
+
+ {{ job.scriptsig | hex2ascii }}
+
+
+ @if (job.cleanJobs) {
+
+ } @else {
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Merkle Branches
+
+
+
+
+
+
+
+
+ @for (branch of job.merkleBranches; track $index) {
+
+ }
+ @for (_ of [].constructor(Math.max(0, 12 - job.merkleBranches.length)); track $index) {
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
Blocks
diff --git a/frontend/src/app/components/pool/pool.component.scss b/frontend/src/app/components/pool/pool.component.scss
index 5c2fedd26..31d12474f 100644
--- a/frontend/src/app/components/pool/pool.component.scss
+++ b/frontend/src/app/components/pool/pool.component.scss
@@ -49,111 +49,110 @@ div.scrollable {
max-height: 75px;
}
-.box {
- padding-bottom: 5px;
+.pool-details {
@media (min-width: 767.98px) {
min-height: 187px;
}
-}
-.label {
- width: 25%;
- @media (min-width: 767.98px) {
- vertical-align: middle;
+ .label {
+ width: 25%;
+ @media (min-width: 767.98px) {
+ vertical-align: middle;
+ }
+ @media (max-width: 767.98px) {
+ font-weight: bold;
+ }
}
- @media (max-width: 767.98px) {
- font-weight: bold;
+ .label.addresses {
+ vertical-align: top;
+ padding-top: 25px;
+ }
+ .addresses-data {
+ vertical-align: top;
+ font-family: monospace;
+ font-size: 14px;
}
-}
-.label.addresses {
- vertical-align: top;
- padding-top: 25px;
-}
-.addresses-data {
- vertical-align: top;
- font-family: monospace;
- font-size: 14px;
-}
-.data {
- text-align: right;
- padding-left: 5%;
- @media (max-width: 992px) {
- text-align: left;
- padding-left: 12px;
- }
- @media (max-width: 450px) {
+ .data {
text-align: right;
+ padding-left: 5%;
+ @media (max-width: 992px) {
+ text-align: left;
+ padding-left: 12px;
+ }
+ @media (max-width: 450px) {
+ text-align: right;
+ }
}
-}
-.progress {
- background-color: var(--secondary);
-}
+ .progress {
+ background-color: var(--secondary);
+ }
-.coinbase {
- width: 20%;
- @media (max-width: 875px) {
- display: none;
- }
-}
-
-.height {
- width: 10%;
-}
-
-.timestamp {
- @media (max-width: 875px) {
- padding-left: 50px;
- }
- @media (max-width: 685px) {
- display: none;
- }
-}
-
-.mined {
- width: 13%;
- @media (max-width: 1100px) {
- display: none;
- }
-}
-
-.txs {
- padding-right: 40px;
- @media (max-width: 1100px) {
- padding-right: 10px;
- }
- @media (max-width: 875px) {
- padding-right: 20px;
- }
- @media (max-width: 567px) {
- padding-right: 10px;
- }
-}
-
-.size {
- width: 12%;
- @media (max-width: 1000px) {
- width: 15%;
- }
- @media (max-width: 875px) {
+ .coinbase {
width: 20%;
+ @media (max-width: 875px) {
+ display: none;
+ }
}
- @media (max-width: 650px) {
- width: 20%;
- }
- @media (max-width: 450px) {
- display: none;
- }
-}
-.scriptmessage {
- overflow: hidden;
- display: inline-block;
- text-overflow: ellipsis;
- vertical-align: middle;
- width: auto;
- text-align: left;
+ .height {
+ width: 10%;
+ }
+
+ .timestamp {
+ @media (max-width: 875px) {
+ padding-left: 50px;
+ }
+ @media (max-width: 685px) {
+ display: none;
+ }
+ }
+
+ .mined {
+ width: 13%;
+ @media (max-width: 1100px) {
+ display: none;
+ }
+ }
+
+ .txs {
+ padding-right: 40px;
+ @media (max-width: 1100px) {
+ padding-right: 10px;
+ }
+ @media (max-width: 875px) {
+ padding-right: 20px;
+ }
+ @media (max-width: 567px) {
+ padding-right: 10px;
+ }
+ }
+
+ .size {
+ width: 12%;
+ @media (max-width: 1000px) {
+ width: 15%;
+ }
+ @media (max-width: 875px) {
+ width: 20%;
+ }
+ @media (max-width: 650px) {
+ width: 20%;
+ }
+ @media (max-width: 450px) {
+ display: none;
+ }
+ }
+
+ .scriptmessage {
+ overflow: hidden;
+ display: inline-block;
+ text-overflow: ellipsis;
+ vertical-align: middle;
+ width: auto;
+ text-align: left;
+ }
}
.skeleton-loader {
@@ -214,4 +213,55 @@ div.scrollable {
.taller-row {
height: 75px;
+}
+
+.stratum-table {
+ width: 100%;
+
+ .merkle {
+ width: 100px;
+ }
+
+ .empty-branch {
+ outline: solid 1px white;
+ outline-offset: -1px;
+
+ &::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ background: linear-gradient(to top left, transparent, transparent 48%, white 49%, white 51%, transparent 52%, transparent);
+ }
+ }
+
+ td {
+ position: relative;
+ height: 2em;
+ }
+}
+
+.job-table {
+ td, th {
+ width: 25%;
+ max-width: 25%;
+ min-width: 25%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding: 0.1rem 0.2rem;
+ }
+
+ @media (max-width: 767.98px) {
+ .expected, .timestamp, .clean, .job-received {
+ display: none;
+ }
+ }
+}
+
+.title-link, .title-link:hover, .title-link:focus, .title-link:active {
+ display: block;
+ text-decoration: none;
+ color: inherit;
}
\ No newline at end of file
diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts
index 1893f0a48..23b795613 100644
--- a/frontend/src/app/components/pool/pool.component.ts
+++ b/frontend/src/app/components/pool/pool.component.ts
@@ -10,6 +10,9 @@ import { selectPowerOfTen } from '@app/bitcoin.utils';
import { formatNumber } from '@angular/common';
import { SeoService } from '@app/services/seo.service';
import { HttpErrorResponse } from '@angular/common/http';
+import { StratumJob } from '../../interfaces/websocket.interface';
+import { WebsocketService } from '../../services/websocket.service';
+import { MiningService } from '../../services/mining.service';
interface AccelerationTotal {
cost: number,
@@ -27,12 +30,16 @@ export class PoolComponent implements OnInit {
@Input() left: number | string = 75;
gfg = true;
+ stratumEnabled = this.stateService.env.STRATUM_ENABLED;
formatNumber = formatNumber;
+ Math = Math;
slugSubscription: Subscription;
poolStats$: Observable;
blocks$: Observable;
oobFees$: Observable;
+ job$: Observable;
+ expectedBlockTime$: Observable;
isLoading = true;
error: HttpErrorResponse | null = null;
@@ -53,6 +60,8 @@ export class PoolComponent implements OnInit {
private apiService: ApiService,
private route: ActivatedRoute,
public stateService: StateService,
+ private websocketService: WebsocketService,
+ private miningService: MiningService,
private seoService: SeoService,
) {
this.auditAvailable = this.stateService.env.AUDIT;
@@ -62,7 +71,7 @@ export class PoolComponent implements OnInit {
this.slugSubscription = this.route.params.pipe(map((params) => params.slug)).subscribe((slug) => {
this.isLoading = true;
this.blocks = [];
- this.chartOptions = {};
+ this.chartOptions = {};
this.slug = slug;
this.initializeObservables();
});
@@ -129,6 +138,31 @@ export class PoolComponent implements OnInit {
}),
filter(oob => oob.length === 3 && oob[2].count > 0)
);
+
+ if (this.stratumEnabled) {
+ this.job$ = combineLatest([
+ this.poolStats$.pipe(
+ tap((poolStats) => {
+ this.websocketService.startTrackStratum(poolStats.pool.unique_id);
+ })
+ ),
+ this.stateService.stratumJobs$
+ ]).pipe(
+ map(([poolStats, jobs]) => {
+ return jobs[poolStats.pool.unique_id];
+ })
+ );
+
+ this.expectedBlockTime$ = combineLatest([
+ this.miningService.getMiningStats('1w'),
+ this.poolStats$,
+ this.stateService.difficultyAdjustment$
+ ]).pipe(
+ map(([miningStats, poolStat, da]) => {
+ return (da.timeAvg / ((poolStat.estimatedHashrate || 0) / (miningStats.lastEstimatedHashrate * 1_000_000_000_000_000_000))) + Date.now() + da.timeOffset;
+ })
+ );
+ }
}
prepareChartOptions(hashrate, share) {
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
index 1ab1a1c94..0af9f0976 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
@@ -36,13 +36,14 @@ function parseTag(scriptSig: string): string {
for (let i = 0; i < hex.length; i += 2) {
bytes.push(parseInt(hex.substr(i, 2), 16));
}
- const ascii = new TextDecoder('utf8').decode(Uint8Array.from(bytes)).replace(/\uFFFD/g, '').replace(/\\0/g, '');
+ // eslint-disable-next-line no-control-regex
+ const ascii = new TextDecoder('utf8').decode(Uint8Array.from(bytes)).replace(/\uFFFD/g, '').replace(/\\0/g, '').replace(/[\x00-\x1F\x7F-\x9F]/g, '');
if (ascii.includes('/ViaBTC/')) {
return '/ViaBTC/';
} else if (ascii.includes('SpiderPool/')) {
return 'SpiderPool/';
}
- return ascii.match(/\/.*\//)?.[0] || ascii;
+ return (ascii.match(/\/.*\//)?.[0] || ascii).trim();
}
@Component({
From caa2d83247fcd245cbe0aabb1a106ca17da5d2d6 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com>
Date: Sun, 19 Jan 2025 02:34:05 -0800
Subject: [PATCH 36/60] Update staging hosts
---
frontend/proxy.conf.staging.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js
index e24662038..e6f33698b 100644
--- a/frontend/proxy.conf.staging.js
+++ b/frontend/proxy.conf.staging.js
@@ -3,8 +3,8 @@ const fs = require('fs');
let PROXY_CONFIG = require('./proxy.conf');
PROXY_CONFIG.forEach(entry => {
- entry.target = entry.target.replace("mempool.space", "mempool-staging.fra.mempool.space");
- entry.target = entry.target.replace("liquid.network", "liquid-staging.fra.mempool.space");
+ entry.target = entry.target.replace("mempool.space", "node201.fmt.mempool.space");
+ entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space");
});
module.exports = PROXY_CONFIG;
From 671b5ea2f2eb3ce9515a233702c5b784093f77c1 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 12:24:26 -0800
Subject: [PATCH 37/60] Reroute testnet4 tests to a different server
---
.github/workflows/ci.yml | 1 +
frontend/proxy.conf.staging.js | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8a29e9184..767cf2694 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -327,6 +327,7 @@ jobs:
browser: "chrome"
ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
env:
+ CYPRESS_REROUTE_TESTNET: ${{ matrix.spec == 'cypress/e2e/testnet4/*.spec.ts' }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js
index e6f33698b..eda7d2b9d 100644
--- a/frontend/proxy.conf.staging.js
+++ b/frontend/proxy.conf.staging.js
@@ -3,7 +3,8 @@ const fs = require('fs');
let PROXY_CONFIG = require('./proxy.conf');
PROXY_CONFIG.forEach(entry => {
- entry.target = entry.target.replace("mempool.space", "node201.fmt.mempool.space");
+ const hostname = process.env.CYPRESS_REROUTE_TESTNET ? 'node201.fmt.mempool.space' : 'mempool-staging.fra.mempool.space';
+ entry.target = entry.target.replace("mempool.space", hostname);
entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space");
});
From 34099e386112b781d7b70ca886f35cab8d23d969 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 12:32:37 -0800
Subject: [PATCH 38/60] Stop switching to testnet4 until we can check for the
proxied server
---
frontend/cypress/e2e/mainnet/mainnet.spec.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts
index a1082b769..7e17c09cd 100644
--- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts
+++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts
@@ -344,7 +344,9 @@ describe('Mainnet', () => {
cy.visit('/');
cy.waitForSkeletonGone();
- cy.changeNetwork('testnet4');
+ //TODO(knorrium): add a check for the proxied server
+ // cy.changeNetwork('testnet4');
+
cy.changeNetwork('signet');
cy.changeNetwork('mainnet');
});
From 7e766cc28db6e67386aab486a5d2e4e35eb3fda1 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 12:36:20 -0800
Subject: [PATCH 39/60] Change spec test
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 767cf2694..af05a2448 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -327,7 +327,7 @@ jobs:
browser: "chrome"
ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
env:
- CYPRESS_REROUTE_TESTNET: ${{ matrix.spec == 'cypress/e2e/testnet4/*.spec.ts' }}
+ CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet') }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
From 517a30d2b0e76c6a88e25b0e0d4c4dfc61597038 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 13:25:29 -0800
Subject: [PATCH 40/60] Split module and spec matrix
---
.github/workflows/ci.yml | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index af05a2448..594df2a9f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -252,16 +252,23 @@ jobs:
fail-fast: false
matrix:
module: ["mempool", "liquid"]
+ spec:
+ - "cypress/e2e/mainnet/*.spec.ts"
+ - "cypress/e2e/signet/*.spec.ts"
+ - "cypress/e2e/testnet4/*.spec.ts"
+ - "cypress/e2e/liquid/liquid.spec.ts"
+ - "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts"
include:
- module: "mempool"
- spec: |
- cypress/e2e/mainnet/*.spec.ts
- cypress/e2e/signet/*.spec.ts
- cypress/e2e/testnet4/*.spec.ts
+ spec: "cypress/e2e/mainnet/*.spec.ts"
+ - module: "mempool"
+ spec: "cypress/e2e/signet/*.spec.ts"
+ - module: "mempool"
+ spec: "cypress/e2e/testnet4/*.spec.ts"
- module: "liquid"
- spec: |
- cypress/e2e/liquid/liquid.spec.ts
- cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+ spec: "cypress/e2e/liquid/liquid.spec.ts"
+ - module: "liquid"
+ spec: "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts"
name: E2E tests for ${{ matrix.module }}
steps:
From e9e8b0c758c476e705a5696268808838a7c3ff58 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 13:38:06 -0800
Subject: [PATCH 41/60] Use testnet as a matrix config instead
---
.github/workflows/ci.yml | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 594df2a9f..7cff27841 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -251,24 +251,19 @@ jobs:
strategy:
fail-fast: false
matrix:
- module: ["mempool", "liquid"]
- spec:
- - "cypress/e2e/mainnet/*.spec.ts"
- - "cypress/e2e/signet/*.spec.ts"
- - "cypress/e2e/testnet4/*.spec.ts"
- - "cypress/e2e/liquid/liquid.spec.ts"
- - "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts"
+ module: ["mempool", "liquid", "testnet4"]
include:
- module: "mempool"
- spec: "cypress/e2e/mainnet/*.spec.ts"
- - module: "mempool"
- spec: "cypress/e2e/signet/*.spec.ts"
- - module: "mempool"
- spec: "cypress/e2e/testnet4/*.spec.ts"
+ spec: |
+ cypress/e2e/mainnet/*.spec.ts
+ cypress/e2e/signet/*.spec.ts
+ - module: "testnet4"
+ spec: |
+ cypress/e2e/testnet4/*.spec.ts
- module: "liquid"
- spec: "cypress/e2e/liquid/liquid.spec.ts"
- - module: "liquid"
- spec: "cypress/e2e/liquidtestnet/liquidtestnet.spec.ts"
+ spec: |
+ cypress/e2e/liquid/liquid.spec.ts
+ cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
name: E2E tests for ${{ matrix.module }}
steps:
@@ -334,7 +329,7 @@ jobs:
browser: "chrome"
ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
env:
- CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet') }}
+ CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet4') }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
From 7f6399093eafa5aeb74aa81ab2b136502c76bd6e Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 13:56:16 -0800
Subject: [PATCH 42/60] Fix YAML
---
.github/workflows/ci.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7cff27841..784a02afc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -258,8 +258,8 @@ jobs:
cypress/e2e/mainnet/*.spec.ts
cypress/e2e/signet/*.spec.ts
- module: "testnet4"
- spec: |
- cypress/e2e/testnet4/*.spec.ts
+ spec: |
+ cypress/e2e/testnet4/*.spec.ts
- module: "liquid"
spec: |
cypress/e2e/liquid/liquid.spec.ts
From f59e95fcc8419426550be6bad69c6507e87179c4 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 14:11:41 -0800
Subject: [PATCH 43/60] Run the default mempool config if we are running
testnet4 tests
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 784a02afc..146372f40 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -318,7 +318,7 @@ jobs:
with:
tag: ${{ github.event_name }}
working-directory: ${{ matrix.module }}/frontend
- build: npm run config:defaults:${{ matrix.module }}
+ build: ${{ matrix.module == 'testnet4' && 'npm run config:defaults:mempool' || 'npm run config:defaults:${{ matrix.module }}' }}
start: npm run start:local-staging
wait-on: "http://localhost:4200"
wait-on-timeout: 120
From 1098d2fe3c44b83624d3e17cda2ea73643d3dcf8 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 14:21:23 -0800
Subject: [PATCH 44/60] Change build step to shell script
---
.github/workflows/ci.yml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 146372f40..ac5326323 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -318,7 +318,12 @@ jobs:
with:
tag: ${{ github.event_name }}
working-directory: ${{ matrix.module }}/frontend
- build: ${{ matrix.module == 'testnet4' && 'npm run config:defaults:mempool' || 'npm run config:defaults:${{ matrix.module }}' }}
+ build: |
+ if [[ "${{ matrix.module }}" == "testnet4" ]]; then
+ npm run config:defaults:mempool
+ else
+ npm run config:defaults:${{ matrix.module }}
+ fi
start: npm run start:local-staging
wait-on: "http://localhost:4200"
wait-on-timeout: 120
From 3d1aacbd66e69f830a6b0034577fa284696dd2ff Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 19:21:02 -0800
Subject: [PATCH 45/60] Copypasta matrix for tests
---
.github/workflows/ci.yml | 80 +++++++++++++++++++++++++++++-----------
1 file changed, 58 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ac5326323..6d2fc387f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -252,18 +252,6 @@ jobs:
fail-fast: false
matrix:
module: ["mempool", "liquid", "testnet4"]
- include:
- - module: "mempool"
- spec: |
- cypress/e2e/mainnet/*.spec.ts
- cypress/e2e/signet/*.spec.ts
- - module: "testnet4"
- spec: |
- cypress/e2e/testnet4/*.spec.ts
- - module: "liquid"
- spec: |
- cypress/e2e/liquid/liquid.spec.ts
- cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
name: E2E tests for ${{ matrix.module }}
steps:
@@ -312,29 +300,77 @@ jobs:
- name: Unzip assets before building (src/resources)
run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video
-
+
+ # mempool
- name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'mempool' }}
uses: cypress-io/github-action@v5
with:
tag: ${{ github.event_name }}
working-directory: ${{ matrix.module }}/frontend
- build: |
- if [[ "${{ matrix.module }}" == "testnet4" ]]; then
- npm run config:defaults:mempool
- else
- npm run config:defaults:${{ matrix.module }}
- fi
+ build: npm run config:defaults:${{ matrix.module }}
start: npm run start:local-staging
wait-on: "http://localhost:4200"
wait-on-timeout: 120
record: true
parallel: true
- spec: ${{ matrix.spec }}
+ spec: |
+ cypress/e2e/mainnet/*.spec.ts
+ cypress/e2e/signet/*.spec.ts
group: Tests on Chrome (${{ matrix.module }})
browser: "chrome"
ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
env:
- CYPRESS_REROUTE_TESTNET: ${{ contains(matrix.spec, 'testnet4') }}
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
+
+ # liquid
+ - name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'liquid' }}
+ uses: cypress-io/github-action@v5
+ with:
+ tag: ${{ github.event_name }}
+ working-directory: ${{ matrix.module }}/frontend
+ build: npm run config:defaults:${{ matrix.module }}
+ start: npm run start:local-staging
+ wait-on: "http://localhost:4200"
+ wait-on-timeout: 120
+ record: true
+ parallel: true
+ spec: |
+ cypress/e2e/liquid/liquid.spec.ts
+ cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+ group: Tests on Chrome (${{ matrix.module }})
+ browser: "chrome"
+ ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
+ env:
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
+
+ # testnet
+ - name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'testnet4' }}
+ uses: cypress-io/github-action@v5
+ with:
+ tag: ${{ github.event_name }}
+ working-directory: ${{ matrix.module }}/frontend
+ build: npm run config:defaults:mempool
+ start: npm run start:local-staging
+ wait-on: "http://localhost:4200"
+ wait-on-timeout: 120
+ record: true
+ parallel: true
+ spec: |
+ cypress/e2e/testnet4/*.spec.ts
+ group: Tests on Chrome (${{ matrix.module }})
+ browser: "chrome"
+ ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
+ env:
+ CYPRESS_REROUTE_TESTNET: true
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -367,4 +403,4 @@ jobs:
- name: Validate JSON syntax
run: |
cat mempool-config.json | jq
- working-directory: docker/docker/backend
+ working-directory: docker/docker/backend
\ No newline at end of file
From 227d99e9909d1401867f3cb6258e2c4c4b05ead9 Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 19:35:08 -0800
Subject: [PATCH 46/60] Fix reroute logic
---
frontend/proxy.conf.staging.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js
index eda7d2b9d..260b222c0 100644
--- a/frontend/proxy.conf.staging.js
+++ b/frontend/proxy.conf.staging.js
@@ -3,7 +3,8 @@ const fs = require('fs');
let PROXY_CONFIG = require('./proxy.conf');
PROXY_CONFIG.forEach(entry => {
- const hostname = process.env.CYPRESS_REROUTE_TESTNET ? 'node201.fmt.mempool.space' : 'mempool-staging.fra.mempool.space';
+ const hostname = process.env.CYPRESS_REROUTE_TESTNET === 'true' ? 'mempool-staging.fra.mempool.space' : 'node201.fmt.mempool.space';
+ console.log(`e2e tests running against ${hostname}`);
entry.target = entry.target.replace("mempool.space", hostname);
entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space");
});
From 003956fd16caed93a243c37095cae48c667b544a Mon Sep 17 00:00:00 2001
From: Felipe Knorr Kuhn
Date: Sun, 19 Jan 2025 19:48:12 -0800
Subject: [PATCH 47/60] Update staging hosts
Add rerouting logic for testnet4 tests
Split CI e2e workflow matrix into mempool, liquid and testnet4
---
.github/workflows/ci.yml | 72 ++++++++++++++++----
frontend/cypress/e2e/mainnet/mainnet.spec.ts | 4 +-
frontend/proxy.conf.staging.js | 6 +-
3 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8a29e9184..6d2fc387f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -251,17 +251,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- module: ["mempool", "liquid"]
- include:
- - module: "mempool"
- spec: |
- cypress/e2e/mainnet/*.spec.ts
- cypress/e2e/signet/*.spec.ts
- cypress/e2e/testnet4/*.spec.ts
- - module: "liquid"
- spec: |
- cypress/e2e/liquid/liquid.spec.ts
- cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+ module: ["mempool", "liquid", "testnet4"]
name: E2E tests for ${{ matrix.module }}
steps:
@@ -310,8 +300,10 @@ jobs:
- name: Unzip assets before building (src/resources)
run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video
-
+
+ # mempool
- name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'mempool' }}
uses: cypress-io/github-action@v5
with:
tag: ${{ github.event_name }}
@@ -322,7 +314,9 @@ jobs:
wait-on-timeout: 120
record: true
parallel: true
- spec: ${{ matrix.spec }}
+ spec: |
+ cypress/e2e/mainnet/*.spec.ts
+ cypress/e2e/signet/*.spec.ts
group: Tests on Chrome (${{ matrix.module }})
browser: "chrome"
ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
@@ -332,6 +326,56 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
+ # liquid
+ - name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'liquid' }}
+ uses: cypress-io/github-action@v5
+ with:
+ tag: ${{ github.event_name }}
+ working-directory: ${{ matrix.module }}/frontend
+ build: npm run config:defaults:${{ matrix.module }}
+ start: npm run start:local-staging
+ wait-on: "http://localhost:4200"
+ wait-on-timeout: 120
+ record: true
+ parallel: true
+ spec: |
+ cypress/e2e/liquid/liquid.spec.ts
+ cypress/e2e/liquidtestnet/liquidtestnet.spec.ts
+ group: Tests on Chrome (${{ matrix.module }})
+ browser: "chrome"
+ ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
+ env:
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
+
+ # testnet
+ - name: Chrome browser tests (${{ matrix.module }})
+ if: ${{ matrix.module == 'testnet4' }}
+ uses: cypress-io/github-action@v5
+ with:
+ tag: ${{ github.event_name }}
+ working-directory: ${{ matrix.module }}/frontend
+ build: npm run config:defaults:mempool
+ start: npm run start:local-staging
+ wait-on: "http://localhost:4200"
+ wait-on-timeout: 120
+ record: true
+ parallel: true
+ spec: |
+ cypress/e2e/testnet4/*.spec.ts
+ group: Tests on Chrome (${{ matrix.module }})
+ browser: "chrome"
+ ci-build-id: "${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}"
+ env:
+ CYPRESS_REROUTE_TESTNET: true
+ COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
+ CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
+
validate_docker_json:
if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
runs-on: "ubuntu-latest"
@@ -359,4 +403,4 @@ jobs:
- name: Validate JSON syntax
run: |
cat mempool-config.json | jq
- working-directory: docker/docker/backend
+ working-directory: docker/docker/backend
\ No newline at end of file
diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts
index a1082b769..7e17c09cd 100644
--- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts
+++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts
@@ -344,7 +344,9 @@ describe('Mainnet', () => {
cy.visit('/');
cy.waitForSkeletonGone();
- cy.changeNetwork('testnet4');
+ //TODO(knorrium): add a check for the proxied server
+ // cy.changeNetwork('testnet4');
+
cy.changeNetwork('signet');
cy.changeNetwork('mainnet');
});
diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js
index e24662038..260b222c0 100644
--- a/frontend/proxy.conf.staging.js
+++ b/frontend/proxy.conf.staging.js
@@ -3,8 +3,10 @@ const fs = require('fs');
let PROXY_CONFIG = require('./proxy.conf');
PROXY_CONFIG.forEach(entry => {
- entry.target = entry.target.replace("mempool.space", "mempool-staging.fra.mempool.space");
- entry.target = entry.target.replace("liquid.network", "liquid-staging.fra.mempool.space");
+ const hostname = process.env.CYPRESS_REROUTE_TESTNET === 'true' ? 'mempool-staging.fra.mempool.space' : 'node201.fmt.mempool.space';
+ console.log(`e2e tests running against ${hostname}`);
+ entry.target = entry.target.replace("mempool.space", hostname);
+ entry.target = entry.target.replace("liquid.network", "liquid-staging.fmt.mempool.space");
});
module.exports = PROXY_CONFIG;
From 390bbf1097ca2cc65bc2b5d6cb45c54fa7a5ef44 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Mon, 20 Jan 2025 15:20:29 +0900
Subject: [PATCH 48/60] add new fa icon
---
frontend/src/app/shared/shared.module.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 1d4f5fd99..283f9eb54 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -7,7 +7,7 @@ import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, fa
faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload, faQrcode, faArrowRightArrowLeft, faArrowsRotate, faCircleLeft,
faFastForward, faWallet, faUserClock, faWrench, faUserFriends, faQuestionCircle, faHistory, faSignOutAlt, faKey, faSuitcase, faIdCardAlt, faNetworkWired, faUserCheck,
faCircleCheck, faUserCircle, faCheck, faRocket, faScaleBalanced, faHourglassStart, faHourglassHalf, faHourglassEnd, faWandMagicSparkles, faFaucetDrip, faTimeline,
- faCircleXmark, faCalendarCheck, faMoneyBillTrendUp, faRobot } from '@fortawesome/free-solid-svg-icons';
+ faCircleXmark, faCalendarCheck, faMoneyBillTrendUp, faRobot, faShareNodes } from '@fortawesome/free-solid-svg-icons';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { MenuComponent } from '@components/menu/menu.component';
import { PreviewTitleComponent } from '@components/master-page-preview/preview-title.component';
@@ -459,5 +459,6 @@ export class SharedModule {
library.addIcons(faCalendarCheck);
library.addIcons(faMoneyBillTrendUp);
library.addIcons(faRobot);
+ library.addIcons(faShareNodes);
}
}
From 4e735cc8b03d87f850286461474d8f110580e444 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Mon, 20 Jan 2025 07:30:27 +0000
Subject: [PATCH 49/60] fix stratum tree rendering with different branch
lengths
---
.../stratum-list/stratum-list.component.ts | 28 ++++++++++++++-----
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
index 0af9f0976..6f252babe 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
@@ -8,8 +8,10 @@ import { SinglePoolStats } from '../../../interfaces/node-api.interface';
type MerkleCellType = ' ' | '┬' | '├' | '└' | '│' | '─' | 'leaf';
+
interface TaggedStratumJob extends StratumJob {
tag: string;
+ merkleBranchIds: string[];
}
interface MerkleCell {
@@ -46,6 +48,18 @@ function parseTag(scriptSig: string): string {
return (ascii.match(/\/.*\//)?.[0] || ascii).trim();
}
+function getMerkleBranchIds(merkleBranches: string[], numBranches: number): string[] {
+ let lastHash = '';
+ const ids: string[] = [];
+ for (let i = 0; i < numBranches; i++) {
+ if (merkleBranches[i]) {
+ lastHash = merkleBranches[i];
+ }
+ ids.push(`${i}-${lastHash}`);
+ }
+ return ids;
+}
+
@Component({
selector: 'app-stratum-list',
templateUrl: './stratum-list.component.html',
@@ -81,16 +95,15 @@ export class StratumList implements OnInit, OnDestroy {
}
processJobs(rawJobs: Record): PoolRow[] {
+ const numBranches = Math.max(...Object.values(rawJobs).map(job => job.merkleBranches.length));
const jobs: Record = {};
for (const [id, job] of Object.entries(rawJobs)) {
- jobs[id] = { ...job, tag: parseTag(job.scriptsig) };
+ jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches) };
}
if (Object.keys(jobs).length === 0) {
return [];
}
- const numBranches = Math.max(...Object.values(jobs).map(job => job.merkleBranches.length));
-
let trees: MerkleTree[] = Object.keys(jobs).map(job => ({
job,
size: 1,
@@ -100,12 +113,13 @@ export class StratumList implements OnInit, OnDestroy {
for (let col = numBranches - 1; col >= 0; col--) {
const groups: Record = {};
for (const tree of trees) {
- const hash = jobs[tree.job].merkleBranches[col];
- if (!groups[hash]) {
- groups[hash] = [];
+ const branchId = jobs[tree.job].merkleBranchIds[col];
+ if (!groups[branchId]) {
+ groups[branchId] = [];
}
- groups[hash].push(tree);
+ groups[branchId].push(tree);
}
+
trees = Object.values(groups).map(group => ({
hash: jobs[group[0].job].merkleBranches[col],
job: group[0].job,
From 36b691e25b4bfebac53e1b389228f6fb56f696b2 Mon Sep 17 00:00:00 2001
From: wiz
Date: Mon, 20 Jan 2025 17:20:23 +0900
Subject: [PATCH 50/60] ops: Enable stratum in prod config via localhost nginx
proxy
---
production/mempool-config.mainnet.json | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/production/mempool-config.mainnet.json b/production/mempool-config.mainnet.json
index 39d82d8d1..5c164340e 100644
--- a/production/mempool-config.mainnet.json
+++ b/production/mempool-config.mainnet.json
@@ -154,5 +154,9 @@
"WALLETS": {
"ENABLED": true,
"WALLETS": ["BITB", "3350"]
+ },
+ "STRATUM": {
+ "ENABLED": true,
+ "API": "http://127.0.0.1:81"
}
}
From e53e810a5563c3a70be8ec33c880a8e68220a14d Mon Sep 17 00:00:00 2001
From: wiz
Date: Mon, 20 Jan 2025 17:34:19 +0900
Subject: [PATCH 51/60] ops: Fix stratum server URL path in prod config
---
production/mempool-config.mainnet.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/production/mempool-config.mainnet.json b/production/mempool-config.mainnet.json
index 5c164340e..758887407 100644
--- a/production/mempool-config.mainnet.json
+++ b/production/mempool-config.mainnet.json
@@ -157,6 +157,6 @@
},
"STRATUM": {
"ENABLED": true,
- "API": "http://127.0.0.1:81"
+ "API": "http://127.0.0.1:81/api/v1/stratum/ws"
}
}
From 5aeaa6825989139f18703ed027673f967591e8f5 Mon Sep 17 00:00:00 2001
From: wiz
Date: Mon, 20 Jan 2025 17:56:38 +0900
Subject: [PATCH 52/60] ops: Enable stratum in FOSS prod frontend config
---
production/mempool-frontend-config.mainnet.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/production/mempool-frontend-config.mainnet.json b/production/mempool-frontend-config.mainnet.json
index 79acaecc5..e0cdbf030 100644
--- a/production/mempool-frontend-config.mainnet.json
+++ b/production/mempool-frontend-config.mainnet.json
@@ -4,8 +4,7 @@
"TESTNET4_ENABLED": true,
"LIQUID_ENABLED": false,
"LIQUID_TESTNET_ENABLED": false,
- "BISQ_ENABLED": true,
- "BISQ_SEPARATE_BACKEND": true,
+ "STRATUM_ENABLED": true,
"SIGNET_ENABLED": true,
"MEMPOOL_WEBSITE_URL": "https://mempool.space",
"LIQUID_WEBSITE_URL": "https://liquid.network",
From b454fa09d2d8288e2d96ea4f88aae683b71197ac Mon Sep 17 00:00:00 2001
From: softsimon
Date: Tue, 21 Jan 2025 13:49:12 +0700
Subject: [PATCH 53/60] Remove babel backend dep
---
backend/jest.config.ts | 2 +-
backend/package-lock.json | 3 ---
backend/package.json | 3 ---
3 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/backend/jest.config.ts b/backend/jest.config.ts
index 14f932f98..43246c518 100644
--- a/backend/jest.config.ts
+++ b/backend/jest.config.ts
@@ -7,7 +7,7 @@ const config: Config.InitialOptions = {
automock: false,
collectCoverage: true,
collectCoverageFrom: ["./src/**/**.ts"],
- coverageProvider: "babel",
+ coverageProvider: "v8",
coverageThreshold: {
global: {
lines: 1
diff --git a/backend/package-lock.json b/backend/package-lock.json
index e0d28bfc9..08ebf0619 100644
--- a/backend/package-lock.json
+++ b/backend/package-lock.json
@@ -10,7 +10,6 @@
"hasInstallScript": true,
"license": "GNU Affero General Public License v3.0",
"dependencies": {
- "@babel/core": "^7.25.2",
"@mempool/electrum-client": "1.1.9",
"@types/node": "^18.15.3",
"axios": "1.7.2",
@@ -26,8 +25,6 @@
"ws": "~8.18.0"
},
"devDependencies": {
- "@babel/code-frame": "^7.18.6",
- "@babel/core": "^7.25.2",
"@types/compression": "^1.7.2",
"@types/crypto-js": "^4.1.1",
"@types/express": "^4.17.17",
diff --git a/backend/package.json b/backend/package.json
index 9ac3f9199..b1145cb13 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -39,7 +39,6 @@
"prettier": "./node_modules/.bin/prettier --write \"src/**/*.{js,ts}\""
},
"dependencies": {
- "@babel/core": "^7.25.2",
"@mempool/electrum-client": "1.1.9",
"@types/node": "^18.15.3",
"axios": "1.7.2",
@@ -55,8 +54,6 @@
"ws": "~8.18.0"
},
"devDependencies": {
- "@babel/code-frame": "^7.18.6",
- "@babel/core": "^7.25.2",
"@types/compression": "^1.7.2",
"@types/crypto-js": "^4.1.1",
"@types/express": "^4.17.17",
From b42431f14a7bd6730ce89bd03933e50d5dc08852 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Tue, 21 Jan 2025 17:39:50 +0900
Subject: [PATCH 54/60] [auth] add login/signup with github support
---
.../components/faucet/faucet.component.html | 10 +++-----
.../github-login.component.html | 6 +++++
.../github-login.component.ts | 25 +++++++++++++++++++
frontend/src/app/shared/shared.module.ts | 3 +++
4 files changed, 38 insertions(+), 6 deletions(-)
create mode 100644 frontend/src/app/components/github-login.component/github-login.component.html
create mode 100644 frontend/src/app/components/github-login.component/github-login.component.ts
diff --git a/frontend/src/app/components/faucet/faucet.component.html b/frontend/src/app/components/faucet/faucet.component.html
index 3165ae9a7..19d76d9dd 100644
--- a/frontend/src/app/components/faucet/faucet.component.html
+++ b/frontend/src/app/components/faucet/faucet.component.html
@@ -21,10 +21,8 @@
To use the faucet, please
-
login
-
or
-
+
}
@else if (user && user.status === 'pending' && !user.email && user.snsId) {
@@ -36,18 +34,18 @@
}
@else if (error === 'not_available') {
-
+
To use the faucet, please
-
+
}
@else if (error === 'account_limited') {
- Your Twitter account does not allow you to access the faucet
+ Your account does not allow you to access the faucet
}
diff --git a/frontend/src/app/components/github-login.component/github-login.component.html b/frontend/src/app/components/github-login.component/github-login.component.html
new file mode 100644
index 000000000..de9c743b5
--- /dev/null
+++ b/frontend/src/app/components/github-login.component/github-login.component.html
@@ -0,0 +1,6 @@
+
+
+
+
+ {{ buttonString }}
+
\ No newline at end of file
diff --git a/frontend/src/app/components/github-login.component/github-login.component.ts b/frontend/src/app/components/github-login.component/github-login.component.ts
new file mode 100644
index 000000000..52f2584b9
--- /dev/null
+++ b/frontend/src/app/components/github-login.component/github-login.component.ts
@@ -0,0 +1,25 @@
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+@Component({
+ selector: 'app-github-login',
+ templateUrl: './github-login.component.html',
+})
+export class GithubLogin {
+ @Input() width: string | null = null;
+ @Input() customClass: string | null = null;
+ @Input() buttonString: string= 'unset';
+ @Input() redirectTo: string | null = null;
+ @Output() clicked = new EventEmitter();
+ @Input() disabled: boolean = false;
+
+ constructor() {}
+
+ githubLogin() {
+ this.clicked.emit(true);
+ if (this.redirectTo) {
+ location.replace(`/api/v1/services/auth/login/github?redirectTo=${encodeURIComponent(this.redirectTo)}`);
+ } else {
+ location.replace(`/api/v1/services/auth/login/github?redirectTo=${location.href}`);
+ }
+ return false;
+ }
+}
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 283f9eb54..d63b54632 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -125,6 +125,7 @@ import { TwitterLogin } from '@components/twitter-login/twitter-login.component'
import { BitcoinInvoiceComponent } from '@components/bitcoin-invoice/bitcoin-invoice.component';
import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/weight-directives/weight-directives';
+import { GithubLogin } from '../components/github-login.component/github-login.component';
@NgModule({
declarations: [
@@ -242,6 +243,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/
TwitterWidgetComponent,
FaucetComponent,
TwitterLogin,
+ GithubLogin,
BitcoinInvoiceComponent,
],
imports: [
@@ -376,6 +378,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from '@app/shared/components/
HttpErrorComponent,
TwitterWidgetComponent,
TwitterLogin,
+ GithubLogin,
BitcoinInvoiceComponent,
BitcoinsatoshisPipe,
From 665a12a040b5fcb743b5ffa5e1d54a1dce56b77c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 21 Jan 2025 15:57:18 +0000
Subject: [PATCH 55/60] Bump mysql2 from 3.11.0 to 3.12.0 in /backend
Bumps [mysql2](https://github.com/sidorares/node-mysql2) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/sidorares/node-mysql2/releases)
- [Changelog](https://github.com/sidorares/node-mysql2/blob/master/Changelog.md)
- [Commits](https://github.com/sidorares/node-mysql2/compare/v3.11.0...v3.12.0)
---
updated-dependencies:
- dependency-name: mysql2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
backend/package-lock.json | 52 ++++++++++++++++++++++-----------------
backend/package.json | 2 +-
2 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/backend/package-lock.json b/backend/package-lock.json
index 08ebf0619..3f66fa25b 100644
--- a/backend/package-lock.json
+++ b/backend/package-lock.json
@@ -17,7 +17,7 @@
"crypto-js": "~4.2.0",
"express": "~4.21.1",
"maxmind": "~4.3.11",
- "mysql2": "~3.11.0",
+ "mysql2": "~3.12.0",
"redis": "^4.7.0",
"rust-gbt": "file:./rust-gbt",
"socks-proxy-agent": "~7.0.0",
@@ -5997,6 +5997,21 @@
"yallist": "^3.0.2"
}
},
+ "node_modules/lru.min": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz",
+ "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==",
+ "license": "MIT",
+ "engines": {
+ "bun": ">=1.0.0",
+ "deno": ">=1.30.0",
+ "node": ">=8.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wellwelwel"
+ }
+ },
"node_modules/make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -6158,16 +6173,17 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/mysql2": {
- "version": "3.11.0",
- "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.0.tgz",
- "integrity": "sha512-J9phbsXGvTOcRVPR95YedzVSxJecpW5A5+cQ57rhHIFXteTP10HCs+VBjS7DHIKfEaI1zQ5tlVrquCd64A6YvA==",
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz",
+ "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==",
+ "license": "MIT",
"dependencies": {
"aws-ssl-profiles": "^1.1.1",
"denque": "^2.1.0",
"generate-function": "^2.3.1",
"iconv-lite": "^0.6.3",
"long": "^5.2.1",
- "lru-cache": "^8.0.0",
+ "lru.min": "^1.0.0",
"named-placeholders": "^1.1.3",
"seq-queue": "^0.0.5",
"sqlstring": "^2.3.2"
@@ -6187,14 +6203,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/mysql2/node_modules/lru-cache": {
- "version": "8.0.5",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
- "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==",
- "engines": {
- "node": ">=16.14"
- }
- },
"node_modules/named-placeholders": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz",
@@ -12210,6 +12218,11 @@
"yallist": "^3.0.2"
}
},
+ "lru.min": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz",
+ "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q=="
+ },
"make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -12324,16 +12337,16 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"mysql2": {
- "version": "3.11.0",
- "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.0.tgz",
- "integrity": "sha512-J9phbsXGvTOcRVPR95YedzVSxJecpW5A5+cQ57rhHIFXteTP10HCs+VBjS7DHIKfEaI1zQ5tlVrquCd64A6YvA==",
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz",
+ "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==",
"requires": {
"aws-ssl-profiles": "^1.1.1",
"denque": "^2.1.0",
"generate-function": "^2.3.1",
"iconv-lite": "^0.6.3",
"long": "^5.2.1",
- "lru-cache": "^8.0.0",
+ "lru.min": "^1.0.0",
"named-placeholders": "^1.1.3",
"seq-queue": "^0.0.5",
"sqlstring": "^2.3.2"
@@ -12346,11 +12359,6 @@
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
- },
- "lru-cache": {
- "version": "8.0.5",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
- "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA=="
}
}
},
diff --git a/backend/package.json b/backend/package.json
index b1145cb13..ee5944f93 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -46,7 +46,7 @@
"crypto-js": "~4.2.0",
"express": "~4.21.1",
"maxmind": "~4.3.11",
- "mysql2": "~3.11.0",
+ "mysql2": "~3.12.0",
"rust-gbt": "file:./rust-gbt",
"redis": "^4.7.0",
"socks-proxy-agent": "~7.0.0",
From 23713a11c25504ca216a39ea3000cf961c165dac Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Wed, 22 Jan 2025 05:06:02 +0000
Subject: [PATCH 56/60] link to merkle branch first tx
---
frontend/src/app/components/pool/pool.component.html | 6 +++++-
frontend/src/app/components/pool/pool.component.scss | 1 +
frontend/src/app/components/pool/pool.component.ts | 4 ++++
.../stratum/stratum-list/stratum-list.component.html | 8 +++++++-
.../stratum/stratum-list/stratum-list.component.scss | 10 ++++++++++
.../stratum/stratum-list/stratum-list.component.ts | 4 ++++
6 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/components/pool/pool.component.html b/frontend/src/app/components/pool/pool.component.html
index faa0003c4..f98794b68 100644
--- a/frontend/src/app/components/pool/pool.component.html
+++ b/frontend/src/app/components/pool/pool.component.html
@@ -267,7 +267,11 @@
@for (branch of job.merkleBranches; track $index) {
-
+ @if ($index === 0 && branch) {
+
+ } @else {
+
+ }
}
@for (_ of [].constructor(Math.max(0, 12 - job.merkleBranches.length)); track $index) {
diff --git a/frontend/src/app/components/pool/pool.component.scss b/frontend/src/app/components/pool/pool.component.scss
index 31d12474f..fa94227bd 100644
--- a/frontend/src/app/components/pool/pool.component.scss
+++ b/frontend/src/app/components/pool/pool.component.scss
@@ -220,6 +220,7 @@ div.scrollable {
.merkle {
width: 100px;
+ text-align: center;
}
.empty-branch {
diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts
index 23b795613..4b4b643a2 100644
--- a/frontend/src/app/components/pool/pool.component.ts
+++ b/frontend/src/app/components/pool/pool.component.ts
@@ -361,6 +361,10 @@ export class PoolComponent implements OnInit {
return block.height;
}
+ reverseHash(hash: string) {
+ return hash.match(/../g).reverse().join('');
+ }
+
ngOnDestroy(): void {
this.slugSubscription.unsubscribe();
}
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
index 08d7fb0ef..41707e37f 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
@@ -30,7 +30,13 @@
@for (cell of row.merkleCells; track $index) {
-
+ @if ($index === 0 && cell.hash) {
+
+
+
+ } @else {
+
+ }
}
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
index 6679f2257..15ee074c2 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
@@ -92,6 +92,16 @@ td {
}
}
}
+
+ .cell-link {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ color: inherit;
+ text-decoration: none;
+ }
}
.badge {
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
index 6f252babe..b28f4ff11 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
@@ -196,6 +196,10 @@ export class StratumList implements OnInit, OnDestroy {
}[type];
}
+ reverseHash(hash: string) {
+ return hash.match(/../g).reverse().join('');
+ }
+
ngOnDestroy(): void {
this.websocketService.stopTrackStratum();
}
From cac62765a18d25dddd1be3e090b4c57fdf2115ad Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Wed, 22 Jan 2025 09:10:22 +0000
Subject: [PATCH 57/60] fix stratum tree branch level
---
.../stratum/stratum-list/stratum-list.component.ts | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
index b28f4ff11..481447b07 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.ts
@@ -48,14 +48,16 @@ function parseTag(scriptSig: string): string {
return (ascii.match(/\/.*\//)?.[0] || ascii).trim();
}
-function getMerkleBranchIds(merkleBranches: string[], numBranches: number): string[] {
+function getMerkleBranchIds(merkleBranches: string[], numBranches: number, poolId: number): string[] {
let lastHash = '';
const ids: string[] = [];
for (let i = 0; i < numBranches; i++) {
if (merkleBranches[i]) {
lastHash = merkleBranches[i];
+ ids.push(`${i}-${lastHash}`);
+ } else {
+ ids.push(`${i}-${lastHash}-${poolId}`);
}
- ids.push(`${i}-${lastHash}`);
}
return ids;
}
@@ -98,7 +100,7 @@ export class StratumList implements OnInit, OnDestroy {
const numBranches = Math.max(...Object.values(rawJobs).map(job => job.merkleBranches.length));
const jobs: Record = {};
for (const [id, job] of Object.entries(rawJobs)) {
- jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches) };
+ jobs[id] = { ...job, tag: parseTag(job.scriptsig), merkleBranchIds: getMerkleBranchIds(job.merkleBranches, numBranches, job.pool) };
}
if (Object.keys(jobs).length === 0) {
return [];
From 2e44ea3f012bf599f468f06849a8d5c2513e4152 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Wed, 22 Jan 2025 09:13:44 +0000
Subject: [PATCH 58/60] reorder stratum job table
---
.../stratum-list/stratum-list.component.html | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
index 41707e37f..24801cf2c 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.html
@@ -7,27 +7,18 @@
- Height
- Reward
- Coinbase Tag
Merkle Branches
Pool
+ Coinbase Tag
+ Reward
+ Height
@for (row of rows; track row.job.pool) {
-
- {{ row.job.height }}
-
-
-
-
-
- {{ row.job.tag }}
-
@for (cell of row.merkleCells; track $index) {
@if ($index === 0 && cell.hash) {
@@ -47,6 +38,15 @@
}
+
+ {{ row.job.tag }}
+
+
+
+
+
+ {{ row.job.height }}
+
}
From 363fa3d8779e07cc9d048234b31cf9d51f60b639 Mon Sep 17 00:00:00 2001
From: Mononaut
Date: Wed, 22 Jan 2025 09:16:25 +0000
Subject: [PATCH 59/60] improve stratum table layout on mobile
---
.../stratum-list/stratum-list.component.scss | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
index 15ee074c2..3d274ef2a 100644
--- a/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
+++ b/frontend/src/app/components/stratum/stratum-list/stratum-list.component.scss
@@ -104,6 +104,26 @@ td {
}
}
+@media (max-width: 800px) {
+ .stratum-table {
+ td {
+ &.tag {
+ display: none;
+ }
+ }
+ }
+}
+
+@media (max-width: 650px) {
+ .stratum-table {
+ td {
+ &.reward {
+ display: none;
+ }
+ }
+ }
+}
+
.badge {
position: relative;
color: #FFF;
From 3b91a1437aa72d7e0b8c8866fd13c7f0fe839eb4 Mon Sep 17 00:00:00 2001
From: nymkappa <1612910616@pm.me>
Date: Wed, 22 Jan 2025 18:58:17 +0900
Subject: [PATCH 60/60] [accelerator] differentiate failed/canceled
accelerations
---
.../accelerations-list/accelerations-list.component.html | 3 ++-
frontend/src/app/interfaces/node-api.interface.ts | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html
index 225bf1955..6756b23e4 100644
--- a/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html
+++ b/frontend/src/app/components/acceleration/accelerations-list/accelerations-list.component.html
@@ -64,7 +64,8 @@
Pending
Completed ⌛
Mined ⌛
- Canceled ⌛
+ Canceled ⌛
+ Failed ⌛
diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts
index 4d85a938d..05f0855a9 100644
--- a/frontend/src/app/interfaces/node-api.interface.ts
+++ b/frontend/src/app/interfaces/node-api.interface.ts
@@ -412,13 +412,13 @@ export interface Acceleration {
feeDelta: number;
blockHash: string;
blockHeight: number;
-
acceleratedFeeRate?: number;
boost?: number;
bidBoost?: number;
boostCost?: number;
boostRate?: number;
minedByPoolUniqueId?: number;
+ canceled?: number;
}
export interface AccelerationHistoryParams {