From f4b9301f55b8c662d716a786c6dce554a3064299 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Tue, 26 Mar 2024 11:36:20 +0900 Subject: [PATCH 01/37] [enterprise] polish enterprise logo --- .../master-page/master-page.component.html | 33 +++++++++++++++---- .../master-page/master-page.component.scss | 19 +++++++++-- .../search-form/search-form.component.scss | 4 +-- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html index fd7319b01..d99f9d5fa 100644 --- a/frontend/src/app/components/master-page/master-page.component.html +++ b/frontend/src/app/components/master-page/master-page.component.html @@ -15,12 +15,31 @@
- - -
- -
-
+ +
+ +
+ +
+
+
+ + + +
+
Offline
+
Reconnecting...
+
+
+
+ + + +
+ +
+
+
@@ -78,7 +97,7 @@
- + diff --git a/frontend/src/app/components/master-page/master-page.component.scss b/frontend/src/app/components/master-page/master-page.component.scss index 743092f3f..9320e2b38 100644 --- a/frontend/src/app/components/master-page/master-page.component.scss +++ b/frontend/src/app/components/master-page/master-page.component.scss @@ -106,6 +106,8 @@ li.nav-item { .dropdown { .dropdown-toggle { width: 62px; + height: 36px; + margin-top: 5px; } } } @@ -181,19 +183,30 @@ nav { } .subdomain_logo { - max-height: 45px; + height: 35px; + overflow: clip; max-width: 140px; margin: auto; align-self: center; + .rounded { + border-radius: 5px; + } } .subdomain_container { - width: 140px; - margin-right: 15px; + max-width: 140px; text-align: center; align-self: center; } +.vertical-line { + border-left: 1px solid #444; + height: 30px; + margin-left: 20px; + margin-right: 20px; + margin-top: 3px; +} + .logo-holder { display: flex; flex-direction: row; diff --git a/frontend/src/app/components/search-form/search-form.component.scss b/frontend/src/app/components/search-form/search-form.component.scss index cec555a4f..b84754397 100644 --- a/frontend/src/app/components/search-form/search-form.component.scss +++ b/frontend/src/app/components/search-form/search-form.component.scss @@ -15,8 +15,6 @@ form { margin-top: 5px; @media (min-width: 564px) { - margin-top: 0px; - margin-left: 5px; margin-right: -5px; } @media (min-width: 992px) { @@ -39,7 +37,7 @@ form { position: relative; width: 100%; @media (min-width: 768px) { - min-width: 400px; + min-width: 300px; } @media (min-width: 992px) { min-width: 142px; From b8a48314c17dc0fc9f89b2b9578856ae9c353320 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:53:38 +0900 Subject: [PATCH 02/37] Fix api-docs anchor link vertical alignment --- frontend/src/app/app-routing.module.ts | 2 +- .../docs/api-docs/api-docs-nav.component.html | 2 +- .../docs/api-docs/api-docs-nav.component.scss | 1 + .../docs/api-docs/api-docs-nav.component.ts | 5 ++-- .../app/docs/api-docs/api-docs.component.html | 4 +-- .../app/docs/api-docs/api-docs.component.scss | 1 + .../app/docs/api-docs/api-docs.component.ts | 26 ++++++++----------- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 1fe196090..4bef1a76f 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -270,7 +270,7 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') { imports: [RouterModule.forRoot(routes, { initialNavigation: 'enabledBlocking', scrollPositionRestoration: 'enabled', - anchorScrolling: 'enabled', + anchorScrolling: 'disabled', preloadingStrategy: AppPreloadingStrategy })], }) diff --git a/frontend/src/app/docs/api-docs/api-docs-nav.component.html b/frontend/src/app/docs/api-docs/api-docs-nav.component.html index 7ec57714d..13b7cbe80 100644 --- a/frontend/src/app/docs/api-docs/api-docs-nav.component.html +++ b/frontend/src/app/docs/api-docs/api-docs-nav.component.html @@ -4,5 +4,5 @@

{{ item.title }}

- {{ item.title }} + {{ item.title }}
diff --git a/frontend/src/app/docs/api-docs/api-docs-nav.component.scss b/frontend/src/app/docs/api-docs/api-docs-nav.component.scss index 550d1c936..9db2f56e9 100644 --- a/frontend/src/app/docs/api-docs/api-docs-nav.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs-nav.component.scss @@ -10,6 +10,7 @@ a { text-decoration: none; display: block; margin: 5px 0; + cursor: pointer; } #enterprise-cta-desktop { diff --git a/frontend/src/app/docs/api-docs/api-docs-nav.component.ts b/frontend/src/app/docs/api-docs/api-docs-nav.component.ts index 6e804de46..1abc506e5 100644 --- a/frontend/src/app/docs/api-docs/api-docs-nav.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs-nav.component.ts @@ -33,8 +33,9 @@ export class ApiDocsNavComponent implements OnInit { } } - navLinkClick(event) { - this.navLinkClickEvent.emit(event); + navLinkClick(event, fragment) { + event.preventDefault(); + this.navLinkClickEvent.emit({event: event, fragment: fragment}); } } diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 89165c90e..aef36603e 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -19,7 +19,7 @@

{{ item.title }}

-
{{ item.title }}{{ item.category }}
+
{{ item.title }}{{ item.category }}
@@ -54,7 +54,7 @@

{{ item.title }}

- {{ item.title }} {{ item.category }} + {{ item.title }} {{ item.category }}
Endpoint
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index ed7b79636..a139288e7 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -204,6 +204,7 @@ h3 { margin: 20px 0 20px 0; font-size: 24px; position: relative; + cursor: pointer; } .endpoint-container .section-header:hover { text-decoration: none; diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index 3f5ce75e5..3198d80c6 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -56,7 +56,10 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { if( this.route.snapshot.fragment ) { this.openEndpointContainer( this.route.snapshot.fragment ); if (document.getElementById( this.route.snapshot.fragment )) { - document.getElementById( this.route.snapshot.fragment ).scrollIntoView(); + let vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; + window.scrollTo({ + top: document.getElementById( this.route.snapshot.fragment ).offsetTop - vOffset + }); } } window.addEventListener('scroll', that.onDocScroll, { passive: true }); @@ -124,20 +127,13 @@ export class ApiDocsComponent implements OnInit, AfterViewInit { this.desktopDocsNavPosition = ( window.pageYOffset > 115 ) ? "fixed" : "relative"; } - anchorLinkClick( event: any ) { - let targetId = ""; - if( event.target.nodeName === "A" ) { - targetId = event.target.hash.substring(1); - } else { - let element = event.target; - while( element.nodeName !== "A" ) { - element = element.parentElement; - } - targetId = element.hash.substring(1); - } - if( this.route.snapshot.fragment === targetId && document.getElementById( targetId )) { - document.getElementById( targetId ).scrollIntoView(); - } + anchorLinkClick( e ) { + let targetId = e.fragment; + let vOffset = ( window.innerWidth <= 992 ) ? 100 : 60; + window.scrollTo({ + top: document.getElementById( targetId ).offsetTop - vOffset + }); + window.history.pushState({}, null, document.location.href.split("#")[0] + "#" + targetId); this.openEndpointContainer( targetId ); } From 0a848f25a468441559e4ee7b702182ebffa027bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 06:07:47 +0000 Subject: [PATCH 03/37] Bump express from 4.18.2 to 4.19.2 in /frontend Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4beb4413a..5e2cbeada 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9860,9 +9860,9 @@ "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" }, "node_modules/express": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", - "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -25526,9 +25526,9 @@ "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" }, "express": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", - "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", From 37aee77eb4505b79ca6869e5c5441573421e8f80 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Tue, 2 Apr 2024 08:19:35 +0000 Subject: [PATCH 04/37] Add config for public acceleration data --- docker/frontend/entrypoint.sh | 2 ++ frontend/mempool-frontend-config.sample.json | 3 ++- frontend/src/app/components/block/block.component.ts | 3 ++- frontend/src/app/components/pool/pool.component.ts | 1 + frontend/src/app/services/state.service.ts | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/frontend/entrypoint.sh b/docker/frontend/entrypoint.sh index 20f05e53c..a57c599b4 100644 --- a/docker/frontend/entrypoint.sh +++ b/docker/frontend/entrypoint.sh @@ -37,6 +37,7 @@ __MAINNET_BLOCK_AUDIT_START_HEIGHT__=${MAINNET_BLOCK_AUDIT_START_HEIGHT:=0} __TESTNET_BLOCK_AUDIT_START_HEIGHT__=${TESTNET_BLOCK_AUDIT_START_HEIGHT:=0} __SIGNET_BLOCK_AUDIT_START_HEIGHT__=${SIGNET_BLOCK_AUDIT_START_HEIGHT:=0} __ACCELERATOR__=${ACCELERATOR:=false} +__PUBLIC_ACCELERATIONS__=${PUBLIC_ACCELERATIONS:=false} __HISTORICAL_PRICE__=${HISTORICAL_PRICE:=true} __ADDITIONAL_CURRENCIES__=${ADDITIONAL_CURRENCIES:=false} @@ -62,6 +63,7 @@ export __MAINNET_BLOCK_AUDIT_START_HEIGHT__ export __TESTNET_BLOCK_AUDIT_START_HEIGHT__ export __SIGNET_BLOCK_AUDIT_START_HEIGHT__ export __ACCELERATOR__ +export __PUBLIC_ACCELERATIONS__ export __HISTORICAL_PRICE__ export __ADDITIONAL_CURRENCIES__ diff --git a/frontend/mempool-frontend-config.sample.json b/frontend/mempool-frontend-config.sample.json index 31514a017..7f06c8fbc 100644 --- a/frontend/mempool-frontend-config.sample.json +++ b/frontend/mempool-frontend-config.sample.json @@ -21,5 +21,6 @@ "LIGHTNING": false, "HISTORICAL_PRICE": true, "ADDITIONAL_CURRENCIES": false, - "ACCELERATOR": false + "ACCELERATOR": false, + "PUBLIC_ACCELERATIONS": false } diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 9e6b74baf..1ef2513ca 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy, ViewChildren, QueryList, Inject, PLATFORM import { Location } from '@angular/common'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { ElectrsApiService } from '../../services/electrs-api.service'; -import { switchMap, tap, throttleTime, catchError, map, shareReplay, startWith } from 'rxjs/operators'; +import { switchMap, tap, throttleTime, catchError, map, shareReplay, startWith, filter } from 'rxjs/operators'; import { Transaction, Vout } from '../../interfaces/electrs.interface'; import { Observable, of, Subscription, asyncScheduler, EMPTY, combineLatest, forkJoin } from 'rxjs'; import { StateService } from '../../services/state.service'; @@ -484,6 +484,7 @@ export class BlockComponent implements OnInit, OnDestroy { }); this.oobSubscription = block$.pipe( + filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true), switchMap((block) => this.apiService.getAccelerationsByHeight$(block.height) .pipe( map(accelerations => { diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 8274bf441..bf3ce84e6 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -121,6 +121,7 @@ export class PoolComponent implements OnInit { ); this.oobFees$ = this.route.params.pipe(map((params) => params.slug)).pipe( + filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true), switchMap(slug => { return combineLatest([ this.apiService.getAccelerationTotals$(this.slug, '1w'), diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index ee03246f7..c5476fbfb 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -46,6 +46,7 @@ export interface Env { SIGNET_BLOCK_AUDIT_START_HEIGHT: number; HISTORICAL_PRICE: boolean; ACCELERATOR: boolean; + PUBLIC_ACCELERATIONS: boolean; ADDITIONAL_CURRENCIES: boolean; GIT_COMMIT_HASH_MEMPOOL_SPACE?: string; PACKAGE_JSON_VERSION_MEMPOOL_SPACE?: string; @@ -77,6 +78,7 @@ const defaultEnv: Env = { 'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0, 'HISTORICAL_PRICE': true, 'ACCELERATOR': false, + 'PUBLIC_ACCELERATIONS': false, 'ADDITIONAL_CURRENCIES': false, }; From b32cce1440d6409b05776ed72b84c796c3546b64 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Tue, 2 Apr 2024 08:23:38 +0000 Subject: [PATCH 05/37] Restrict public acceleration APIs to mainnet --- frontend/src/app/components/block/block.component.ts | 2 +- frontend/src/app/components/pool/pool.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 1ef2513ca..13b0ecd76 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -484,7 +484,7 @@ export class BlockComponent implements OnInit, OnDestroy { }); this.oobSubscription = block$.pipe( - filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true), + filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true && this.stateService.network === ''), switchMap((block) => this.apiService.getAccelerationsByHeight$(block.height) .pipe( map(accelerations => { diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index bf3ce84e6..8626c633a 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -121,7 +121,7 @@ export class PoolComponent implements OnInit { ); this.oobFees$ = this.route.params.pipe(map((params) => params.slug)).pipe( - filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true), + filter(() => this.stateService.env.PUBLIC_ACCELERATIONS === true && this.stateService.network === ''), switchMap(slug => { return combineLatest([ this.apiService.getAccelerationTotals$(this.slug, '1w'), From 3d900bdfe50f5e44f15b8a94c41f92cc1497cb76 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Tue, 2 Apr 2024 08:24:57 +0000 Subject: [PATCH 06/37] Enable PUBLIC_ACCELERATIONS in mainnet prod --- production/mempool-frontend-config.mainnet.json | 1 + 1 file changed, 1 insertion(+) diff --git a/production/mempool-frontend-config.mainnet.json b/production/mempool-frontend-config.mainnet.json index 144783a93..4e9087c34 100644 --- a/production/mempool-frontend-config.mainnet.json +++ b/production/mempool-frontend-config.mainnet.json @@ -12,5 +12,6 @@ "ITEMS_PER_PAGE": 25, "LIGHTNING": true, "ACCELERATOR": true, + "PUBLIC_ACCELERATIONS": true, "AUDIT": true } From e7f8bcf83bab0e3c154bd21ce0025f9698ed7872 Mon Sep 17 00:00:00 2001 From: wiz Date: Tue, 2 Apr 2024 22:22:05 +0900 Subject: [PATCH 07/37] ops: Update check script for elements electrs hash --- production/check | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/production/check b/production/check index 29adb0a67..e5fd0b63c 100755 --- a/production/check +++ b/production/check @@ -1,7 +1,7 @@ #!/usr/bin/env zsh #for j in fmt va1 fra tk7;do for i in 1 2 3 4 5 6;do echo -n 20$i.$j: ;curl -i -s https://node20$i.$j.mempool.space/api/v1/services/accelerator/accelerations|head -1;done;done check_mempoolspace_frontend_git_hash() { - echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/en-US/resources/config.js|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8) + echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/en-US/resources/config.js|grep GIT_COMMIT_HASH_MEMPOOL_SPACE|cut -d "'" -f2|cut -c1-8) } check_mempoolfoss_frontend_git_hash() { echo -n $(curl -s "https://node${1}.${2}.mempool.space/resources/config.js"|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8) @@ -13,7 +13,10 @@ check_mempoolfoss_frontend_md5_hash() { echo -n $(curl -s https://node${1}.${2}.mempool.space|md5|cut -c1-8) } check_mempool_electrs_git_hash() { - echo -n $(curl -s -i https://node${1}.${2}.mempool.space/api/mempool|grep -i x-powered-by|cut -d ' ' -f3) + echo -n $(curl -s -i https://node${1}.${2}.mempool.space/api/mempool|grep -i x-powered-by|cut -d ' ' -f3|cut -d '-' -f3|tr -d '\r'|tr -d '\n') +} +check_liquid_electrs_git_hash() { + echo -n $(curl -s -i --connect-to "::node${1}.${2}.mempool.space:443" https://liquid.network/api/mempool|grep -i x-powered-by|cut -d ' ' -f3|cut -d '-' -f3|tr -d '\r'|tr -d '\n') } for site in fmt va1 fra tk7;do echo "${site}" @@ -30,6 +33,8 @@ for site in fmt va1 fra tk7;do check_mempoolfoss_frontend_md5_hash $node $site echo -n " " check_mempool_electrs_git_hash $node $site + echo -n " " + check_liquid_electrs_git_hash $node $site echo done done From 4efd0dda836a736ffc770b7ab5b3b2fb8b3067c3 Mon Sep 17 00:00:00 2001 From: natsoni Date: Wed, 3 Apr 2024 11:28:25 +0900 Subject: [PATCH 08/37] Push footer down when content is less than window height --- .../src/app/components/master-page/master-page.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html index b245a0d33..6cca7e671 100644 --- a/frontend/src/app/components/master-page/master-page.component.html +++ b/frontend/src/app/components/master-page/master-page.component.html @@ -84,7 +84,7 @@
-
+
From c35c08b17a05a2f7d1aecb8a5662ebb7df18f835 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 12:31:17 +0900 Subject: [PATCH 09/37] Remove bisq references from the tests --- frontend/cypress/e2e/bisq/bisq.spec.ts | 164 ------------------------- frontend/cypress/support/commands.ts | 6 +- frontend/cypress/support/index.d.ts | 2 +- 3 files changed, 3 insertions(+), 169 deletions(-) delete mode 100644 frontend/cypress/e2e/bisq/bisq.spec.ts diff --git a/frontend/cypress/e2e/bisq/bisq.spec.ts b/frontend/cypress/e2e/bisq/bisq.spec.ts deleted file mode 100644 index ac3b747b2..000000000 --- a/frontend/cypress/e2e/bisq/bisq.spec.ts +++ /dev/null @@ -1,164 +0,0 @@ -describe('Bisq', () => { - const baseModule = Cypress.env('BASE_MODULE'); - const basePath = ''; - - beforeEach(() => { - cy.intercept('/sockjs-node/info*').as('socket'); - cy.intercept('/bisq/api/markets/hloc?market=btc_usd&interval=day').as('hloc'); - cy.intercept('/bisq/api/markets/ticker').as('ticker'); - cy.intercept('/bisq/api/markets/markets').as('markets'); - cy.intercept('/bisq/api/markets/volumes/7d').as('7d'); - cy.intercept('/bisq/api/markets/trades?market=all').as('trades'); - cy.intercept('/bisq/api/txs/*/*').as('txs'); - cy.intercept('/bisq/api/blocks/*/*').as('blocks'); - cy.intercept('/bisq/api/stats').as('stats'); - }); - - if (baseModule === 'bisq') { - it('loads the dashboard', () => { - cy.visit(`${basePath}`); - cy.waitForSkeletonGone(); - }); - - describe('transactions', () => { - it('loads the transactions screen', () => { - cy.visit(`${basePath}`); - cy.waitForSkeletonGone(); - cy.get('#btn-transactions').click().then(() => { - cy.get('.table > tr').should('have.length', 50); - }); - }); - - const filters = [ - 'Asset listing fee', 'Blind vote', 'Compensation request', - 'Genesis', 'Irregular', 'Lockup', 'Pay trade fee', 'Proof of burn', - 'Proposal', 'Reimbursement request', 'Transfer BSQ', 'Unlock', 'Vote reveal' - ]; - filters.forEach((filter) => { - it.only(`filters the transaction screen by ${filter}`, () => { - cy.visit(`${basePath}/transactions`); - cy.wait('@txs'); - cy.waitForSkeletonGone(); - cy.get('#filter').click(); - cy.contains(filter).find('input').click(); - cy.wait('@txs'); - cy.wait(500); - cy.get('td:nth-of-type(2)').each(($td) => { - expect($td.text().trim()).to.eq(filter); - }); - }); - }); - - it('filters using multiple criteria', () => { - const filters = ['Proposal', 'Lockup', 'Unlock']; - cy.visit(`${basePath}/transactions`); - cy.waitForSkeletonGone(); - cy.get('#filter').click(); - filters.forEach((filter) => { - cy.contains(filter).find('input').click(); - //TODO: change this waiter - cy.wait(1500); - }); - cy.get('td:nth-of-type(2)').each(($td) => { - const regex = new RegExp(`${filters.join('|')}`, 'g'); - expect($td.text().trim()).to.match(regex); - }); - }); - - const transactions = [ - { type: 'Asset listing fee', txid: '3548aa0c002b015ea700072b7d7d76d45d4f10a3573804d0d2f624c0bb255b6b' }, - { type: 'Blind vote', txid: 'f8fabb95efa1bb81325e4c961b9fc7e3508a9b9ecd4eddf1400e58867eff8d92' }, - { type: 'Compensation request', txid: 'a8cdc65fe6bb8730f5f89f99f779d0469b0a493e1ae570e20eb7afda696a18a9' }, - { type: 'Genesis', txid: '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5' }, - { type: 'Irregular', txid: '90b06684a517388fec2237e2362a29810dc82f0e13e019c84747ec27051e6c53' }, - { type: 'Lockup', txid: '365425b3b7487229e2ba598fb8f2a9e359e3351620383e5018548649a28b78c4' }, - { type: 'Pay trade fee', txid: 'a66b30e9777e16572ab36723539df8f45bd5d8130d810b2c3d75b8c02a191eaf' }, - { type: 'Proof of burn', txid: '8325ccb87065fb9243ed9ff1cbb431fc2ac5060a60433bcde474ccbd97b76dcb' }, - { type: 'Proposal', txid: '34e2a20f045c82fbcf7cb191b42dea6fba45641777e1751ffb29d3981c4bf413' }, - { type: 'Reimbursement request', txid: '04c16c79ca6b9ec9978880024b0d0ad3100020f33286b63c85ca7b1a319421ae' }, - { type: 'Transfer BSQ', txid: '64500bd9220675ad30d5ace27de95a341a498d7eda08162ee0ce7feb8c56cb14' }, - { type: 'Unlock', txid: '5a756841bbb11137d15b0082a3fcadbe102791f41a95d661d3bd0c5ad0b3b1a3' }, - { type: 'Vote reveal', txid: 'bd7daae1d4af8837db5e47d7bd9d8b9f83dcfd35d112f85e90728b9be45191f7' } - ]; - - transactions.forEach((transaction) => { - it(`loads a "${transaction.type}" transaction`, () => { - cy.visit(`${basePath}/tx/${transaction.txid}`); - cy.waitForSkeletonGone(); - }); - }); - }); - - describe('blocks', () => { - it('loads the blocks screen', () => { - cy.visit(`${basePath}`); - cy.waitForSkeletonGone(); - cy.get('#btn-blocks').click().then(() => { - cy.wait('@blocks'); - cy.get('tbody tr').should('have.length', 10); - }); - }); - - it('loads a specific block', () => { - cy.visit(`${basePath}/block/0000000000000000000137ef33faa63bc6e809ab30932cf77d454fb36d2bd83a`); - cy.waitForSkeletonGone(); - }); - - }); - - describe('markets', () => { - it('loads the markets screen', () => { - cy.visit(`${basePath}/markets`); - cy.waitForSkeletonGone(); - }); - - it('loads a specific market', () => { - cy.visit(`${basePath}/market/btc_eur`); - cy.waitForSkeletonGone(); - //Buy Offers - cy.get('.row > :nth-child(1) td').should('have.length.at.least', 1); - //Sell offers - cy.get('.row > :nth-child(1) td').should('have.length.at.least', 1); - //Trades - cy.get('app-bisq-trades > .table-container td').should('have.length.at.least', 1); - }); - }); - - it('loads the stats screen', () => { - cy.visit(`${basePath}`); - cy.waitForSkeletonGone(); - cy.get('#btn-stats').click().then(() => { - cy.wait('@stats'); - }); - }); - - it('loads the api screen', () => { - cy.visit(`${basePath}`); - cy.waitForSkeletonGone(); - cy.get('#btn-docs').click().then(() => { - cy.get('.section-header').should('have.length.at.least', 1); - cy.get('.endpoint-container').should('have.length.at.least', 1); - }); - }); - - it('shows blocks pagination with 5 pages (desktop)', () => { - cy.viewport(760, 800); - cy.visit(`${basePath}/blocks`); - cy.waitForSkeletonGone(); - cy.get('tbody tr').should('have.length', 10); - // 5 pages + 4 buttons = 9 buttons - cy.get('.pagination-container ul.pagination').first().children().should('have.length', 9); - }); - - it('shows blocks pagination with 3 pages (mobile)', () => { - cy.viewport(669, 800); - cy.visit(`${basePath}/blocks`); - cy.waitForSkeletonGone(); - cy.get('tbody tr').should('have.length', 10); - // 3 pages + 4 buttons = 7 buttons - cy.get('.pagination-container ul.pagination').first().children().should('have.length', 7); - }); - } else { - it.skip(`Tests cannot be run on the selected BASE_MODULE ${baseModule}`); - } -}); diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 3c32df517..23376e5b2 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -72,13 +72,11 @@ Cypress.Commands.add('mockMempoolSocket', () => { mockWebSocket(); }); -Cypress.Commands.add('changeNetwork', (network: "testnet" | "signet" | "liquid" | "bisq" | "mainnet") => { +Cypress.Commands.add('changeNetwork', (network: "testnet" | "signet" | "liquid" | "mainnet") => { cy.get('.dropdown-toggle').click().then(() => { cy.get(`a.${network}`).click().then(() => { cy.waitForPageIdle(); - if (network !== 'bisq') { - cy.waitForSkeletonGone(); - } + cy.waitForSkeletonGone(); }); }); }); diff --git a/frontend/cypress/support/index.d.ts b/frontend/cypress/support/index.d.ts index a6bef9f7c..3cc151b21 100644 --- a/frontend/cypress/support/index.d.ts +++ b/frontend/cypress/support/index.d.ts @@ -5,6 +5,6 @@ declare namespace Cypress { waitForSkeletonGone(): Chainable waitForPageIdle(): Chainable mockMempoolSocket(): Chainable - changeNetwork(network: "testnet"|"signet"|"liquid"|"bisq"|"mainnet"): Chainable + changeNetwork(network: "testnet"|"signet"|"liquid"|"mainnet"): Chainable } } \ No newline at end of file From d2f912d15cbdbcaf4a2eb0c9f63b401ba9238019 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 12:31:41 +0900 Subject: [PATCH 10/37] Remove leftover Bisq references from the GH workflow --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9419d40c3..62cd5666d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,6 @@ jobs: strategy: fail-fast: false matrix: - # module: ["mempool", "liquid", "bisq"] Disabling bisq support for now module: ["mempool", "liquid"] include: - module: "mempool" @@ -263,9 +262,6 @@ jobs: spec: | cypress/e2e/liquid/liquid.spec.ts cypress/e2e/liquidtestnet/liquidtestnet.spec.ts - # - module: "bisq" - # spec: | - # cypress/e2e/bisq/bisq.spec.ts name: E2E tests for ${{ matrix.module }} steps: From e9c40692a6c5bbc43e614873096d8d300ee9198f Mon Sep 17 00:00:00 2001 From: natsoni Date: Wed, 3 Apr 2024 16:09:30 +0900 Subject: [PATCH 11/37] Fix network switch mechanism --- frontend/src/app/services/state.service.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index ee03246f7..e94428412 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -262,22 +262,10 @@ export class StateService { // /^\/ starts with a forward slash... // (?:[a-z]{2}(?:-[A-Z]{2})?\/)? optional locale prefix (non-capturing) // (?:preview\/)? optional "preview" prefix (non-capturing) - // (testnet|liquidtestnet|liquid|signet)/ network string (captured as networkMatches[1]) + // (testnet|signet)/ network string (captured as networkMatches[1]) // ($|\/) network string must end or end with a slash - const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet|liquidtestnet|liquid|signet)($|\/)/); + const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet|signet)($|\/)/); switch (networkMatches && networkMatches[1]) { - case 'liquid': - if (this.network !== 'liquid') { - this.network = 'liquid'; - this.networkChanged$.next('liquid'); - } - return; - case 'liquidtestnet': - if (this.network !== 'liquidtestnet') { - this.network = 'liquidtestnet'; - this.networkChanged$.next('liquidtestnet'); - } - return; case 'signet': if (this.network !== 'signet') { this.network = 'signet'; @@ -285,7 +273,7 @@ export class StateService { } return; case 'testnet': - if (this.network !== 'testnet') { + if (this.network !== 'testnet' && this.network !== 'liquidtestnet') { if (this.env.BASE_MODULE === 'liquid') { this.network = 'liquidtestnet'; this.networkChanged$.next('liquidtestnet'); From 073578243cae6190f59df044d6fba51c08f0ee27 Mon Sep 17 00:00:00 2001 From: natsoni Date: Wed, 3 Apr 2024 16:32:38 +0900 Subject: [PATCH 12/37] Fix fiat selector sorting --- .../app/components/fiat-selector/fiat-selector.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/fiat-selector/fiat-selector.component.ts b/frontend/src/app/components/fiat-selector/fiat-selector.component.ts index f2538fec9..732c6e862 100644 --- a/frontend/src/app/components/fiat-selector/fiat-selector.component.ts +++ b/frontend/src/app/components/fiat-selector/fiat-selector.component.ts @@ -13,10 +13,10 @@ import { StateService } from '../../services/state.service'; export class FiatSelectorComponent implements OnInit { fiatForm: UntypedFormGroup; currencies = Object.entries(fiatCurrencies).sort((a: any, b: any) => { - if (a[1].name < b[1].name) { + if (a[1].code < b[1].code) { return -1; } - if (a[1].name > b[1].name) { + if (a[1].code > b[1].code) { return 1; } return 0; From 85a86d4b06d0e611e082f1bd88e75250242d23c9 Mon Sep 17 00:00:00 2001 From: wiz Date: Wed, 3 Apr 2024 17:28:58 +0900 Subject: [PATCH 13/37] ops: Add backend git hash check --- production/check | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/production/check b/production/check index e5fd0b63c..3f31e67ee 100755 --- a/production/check +++ b/production/check @@ -6,6 +6,9 @@ check_mempoolspace_frontend_git_hash() { check_mempoolfoss_frontend_git_hash() { echo -n $(curl -s "https://node${1}.${2}.mempool.space/resources/config.js"|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8) } +check_mempoolfoss_backend_git_hash() { + echo -n $(curl -s "https://node${1}.${2}.mempool.space/api/v1/backend-info"|jq -r .gitCommit 2>/dev/null|cut -c1-8) +} check_mempoolspace_frontend_md5_hash() { echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space|md5|cut -c1-8) } @@ -28,6 +31,8 @@ for site in fmt va1 fra tk7;do echo -n " " check_mempoolfoss_frontend_git_hash $node $site echo -n " " + check_mempoolfoss_backend_git_hash $node $site + echo -n " " check_mempoolspace_frontend_md5_hash $node $site echo -n " " check_mempoolfoss_frontend_md5_hash $node $site From 1a11b1813f566d77387866f0ad289260ad1dedca Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 18:11:58 +0900 Subject: [PATCH 14/37] Add more build contexts for the backend and rust-gbt --- .github/workflows/on-tag.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml index 55a5585cc..634a27ab9 100644 --- a/.github/workflows/on-tag.yml +++ b/.github/workflows/on-tag.yml @@ -101,5 +101,7 @@ jobs: --platform linux/amd64,linux/arm64 \ --tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \ --tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \ + --build-context rustgbt=./rust \ + --build-context backend=./backend \ --output "type=registry" ./${{ matrix.service }}/ \ --build-arg commitHash=$SHORT_SHA From 425d1587774c838e6281bc5d2799d4f478453e99 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 18:12:26 +0900 Subject: [PATCH 15/37] Update Dockerfile to work with the new Rust steps --- docker/backend/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index 7ab3d605c..d8eada208 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -11,10 +11,17 @@ RUN apt-get install -y build-essential python3 pkg-config curl ca-certificates # Install Rust via rustup RUN CPU_ARCH=$(uname -m); if [ "$CPU_ARCH" = "armv7l" ]; then c_rehash; fi -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable +#RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable +#Workaround to run on github actions from https://github.com/rust-lang/rustup/issues/2700#issuecomment-1367488985 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sed 's#/proc/self/exe#\/bin\/sh#g' | sh -s -- -y --default-toolchain stable ENV PATH="/root/.cargo/bin:$PATH" +COPY --from=backend . . +COPY --from=rustgbt . ../rust/ +ENV FD=/build/rust-gbt RUN npm install --omit=dev --omit=optional + +WORKDIR /build RUN npm run package FROM node:20.12.0-buster-slim From 4284038c4b2c75295f4ae9fdad63001f80dc1bb9 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 18:12:51 +0900 Subject: [PATCH 16/37] Fix error when deleting the missing @napi-rs folder --- backend/npm_package_rm_build_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/npm_package_rm_build_deps.sh b/backend/npm_package_rm_build_deps.sh index 692ba24eb..5d7af2457 100755 --- a/backend/npm_package_rm_build_deps.sh +++ b/backend/npm_package_rm_build_deps.sh @@ -3,7 +3,7 @@ set -e # Cleaning up inside the node_modules folder cd package/node_modules -rm -r \ +rm -rf \ typescript \ @typescript-eslint \ @napi-rs From 2cab2a78859755e79a6e811f3e2d8def86735f49 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Wed, 3 Apr 2024 18:13:14 +0900 Subject: [PATCH 17/37] Read FD from the environment variables --- rust/gbt/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/gbt/package.json b/rust/gbt/package.json index 90497fe9c..77ca25da6 100644 --- a/rust/gbt/package.json +++ b/rust/gbt/package.json @@ -11,7 +11,7 @@ "build-release": "npm run build -- --release --strip", "check-cargo-version": "VER=$(cat rust-toolchain) ; if ! cargo version | grep \"cargo $VER\" >/dev/null ; then echo -e \"\\033[1;35m[[[[WARNING]]]]: cargo version mismatch with ./rust-toolchain version ($VER)!!!\\033[0m\" >&2; fi", "clean": "rm -rf ./target/ ./node_modules/ *.node package-lock.json", - "to-backend": "FD=../../backend/rust-gbt/ ; rm -rf $FD && mkdir $FD && cp index.js index.d.ts package.json *.node $FD", + "to-backend": "FD=${FD:-../../backend/rust-gbt/} ; rm -rf $FD && mkdir $FD && cp index.js index.d.ts package.json *.node $FD", "prepublishOnly": "napi prepublish -t npm", "test": "cargo test" }, From 24366b929e82f3813bf44de0526e7d583af3c033 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 3 Apr 2024 18:13:42 +0900 Subject: [PATCH 18/37] i18n corrections and merging --- .../block-health-graph.component.ts | 2 +- .../block-overview-tooltip.component.html | 10 +- .../blocks-list/blocks-list.component.ts | 2 +- .../components/footer/footer.component.html | 2 +- .../liquid-master-page.component.html | 2 +- .../federation-utxos-list.component.html | 9 +- .../recent-pegs-stats.component.html | 4 +- .../reserves-ratio.component.ts | 2 +- .../app/components/menu/menu.component.html | 2 +- .../src/app/components/pool/pool.component.ts | 4 +- .../rbf-timeline-tooltip.component.html | 2 +- .../transaction/transaction.component.html | 8 +- .../app/dashboard/dashboard.component.html | 3 +- frontend/src/locale/messages.xlf | 365 +++++++----------- 14 files changed, 171 insertions(+), 246 deletions(-) diff --git a/frontend/src/app/components/block-health-graph/block-health-graph.component.ts b/frontend/src/app/components/block-health-graph/block-health-graph.component.ts index 1e105d5e7..8eef20d51 100644 --- a/frontend/src/app/components/block-health-graph/block-health-graph.component.ts +++ b/frontend/src/app/components/block-health-graph/block-health-graph.component.ts @@ -187,7 +187,7 @@ export class BlockHealthGraphComponent implements OnInit { series: data.length === 0 ? undefined : [ { zlevel: 0, - name: $localize`Health`, + name: $localize`:@@d2bcd3296d2850de762fb943060b7e086a893181:Health`, data: data.map(health => ({ value: health[2], block: health[1], diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html index 20b7fc8c4..505171f9d 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html @@ -29,7 +29,7 @@ - Confirmed + Confirmed @@ -68,15 +68,15 @@ Match - Removed + Removed Marginal fee rate High sigop count Recently broadcasted Recently CPFP'd - Added - Prioritized + Added + Prioritized Marginal fee rate - Conflicting + Conflict Accelerated diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.ts b/frontend/src/app/components/blocks-list/blocks-list.component.ts index 518fae25b..29b23e608 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.ts +++ b/frontend/src/app/components/blocks-list/blocks-list.component.ts @@ -65,7 +65,7 @@ export class BlocksList implements OnInit { if (!this.widget) { this.websocketService.want(['blocks']); - this.seoService.setTitle($localize`:@@meta.title.blocks-list:Blocks`); + this.seoService.setTitle($localize`:@@8a7b4bd44c0ac71b2e72de0398b303257f7d2f54:Blocks`); this.ogService.setManualOgImage('recent-blocks.jpg'); if( this.stateService.network==='liquid'||this.stateService.network==='liquidtestnet' ) { this.seoService.setDescription($localize`:@@meta.description.liquid.blocks:See the most recent Liquid${seoDescriptionNetwork(this.stateService.network)} blocks along with basic stats such as block height, block size, and more.`); diff --git a/frontend/src/app/components/footer/footer.component.html b/frontend/src/app/components/footer/footer.component.html index f89e780ff..a0967b7cb 100644 --- a/frontend/src/app/components/footer/footer.component.html +++ b/frontend/src/app/components/footer/footer.component.html @@ -2,7 +2,7 @@
- Incoming transactions  + Incoming Transactions   Backend is synchronizing ({{ mempoolLoadingStatus$ | async }}%) diff --git a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html index 7dfe746e7..d1d474074 100644 --- a/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html +++ b/frontend/src/app/components/liquid-master-page/liquid-master-page.component.html @@ -78,7 +78,7 @@