Skip to content

Commit

Permalink
Merge branch 'master' into issue-226-projectIdDerivation
Browse files Browse the repository at this point in the history
  • Loading branch information
nostrdev-com committed Dec 20, 2024
2 parents 6e1a37f + e5ff277 commit 7ca0c9e
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 98 deletions.
180 changes: 90 additions & 90 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,110 +239,110 @@ jobs:
- name: Build
run: npm run build
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MEMPOOL_CDN: 1
VERBOSE: 1

e2e:
if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
runs-on: "ubuntu-latest"
needs: frontend
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
name: E2E tests for ${{ matrix.module }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ matrix.module }}

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json

- name: Restore cached mining pool assets
continue-on-error: true
id: cache-mining-pool-restore
uses: actions/cache/restore@v4
with:
path: |
mining-pool-assets.zip
key: mining-pool-assets-cache

- name: Restore cached promo video assets
continue-on-error: true
id: cache-promo-video-restore
uses: actions/cache/restore@v4
with:
path: |
promo-video-assets.zip
key: promo-video-assets-cache

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: mining-pool-assets

- name: Unzip assets before building (src/resources)
run: unzip -o mining-pool-assets.zip -d ${{ matrix.module }}/frontend/src/resources/mining-pools

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: promo-video-assets

- name: Unzip assets before building (src/resources)
run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video

- name: Chrome browser tests (${{ matrix.module }})
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: ${{ matrix.spec }}
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 }}
# e2e:
# if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
# runs-on: "ubuntu-latest"
# needs: frontend
# 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
#
# name: E2E tests for ${{ matrix.module }}
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path: ${{ matrix.module }}
#
# - name: Setup node
# uses: actions/setup-node@v3
# with:
# node-version: 20
# cache: "npm"
# cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json
#
# - name: Restore cached mining pool assets
# continue-on-error: true
# id: cache-mining-pool-restore
# uses: actions/cache/restore@v4
# with:
# path: |
# mining-pool-assets.zip
# key: mining-pool-assets-cache
#
# - name: Restore cached promo video assets
# continue-on-error: true
# id: cache-promo-video-restore
# uses: actions/cache/restore@v4
# with:
# path: |
# promo-video-assets.zip
# key: promo-video-assets-cache
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: mining-pool-assets
#
# - name: Unzip assets before building (src/resources)
# run: unzip -o mining-pool-assets.zip -d ${{ matrix.module }}/frontend/src/resources/mining-pools
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: promo-video-assets
#
# - name: Unzip assets before building (src/resources)
# run: unzip -o promo-video-assets.zip -d ${{ matrix.module }}/frontend/src/resources/promo-video
#
# - name: Chrome browser tests (${{ matrix.module }})
# 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: ${{ matrix.spec }}
# 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 }}

validate_docker_json:
if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
runs-on: "ubuntu-latest"
name: Validate generated backend Docker JSON

steps:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: docker

- name: Install jq
run: sudo apt-get install jq -y

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ jobs:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Login to Docker for building
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
# - name: Login to Docker for building
# run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Login to Docker
run: |
docker login -u "sondreb" -p "${{secrets.DOCKER_KEY}}"
- name: Checkout project
uses: actions/checkout@v4
Expand Down Expand Up @@ -99,8 +103,8 @@ jobs:
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:latest \
--tag blockcore/mempool-${{ matrix.service }}:$TAG \
--tag blockcore/mempool-${{ matrix.service }}:latest \
--build-context rustgbt=./rust \
--build-context backend=./backend \
--output "type=registry" ./${{ matrix.service }}/ \
Expand Down
5 changes: 5 additions & 0 deletions backend/src/angor/tests/AngorTransactionDecoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ describe('AngorTransactionDecoder', () => {
addressOnFeeOutput,
transactionStatus
);

expect(updateInvestmentStatusSpy).toHaveBeenCalledWith(
addressOnFeeOutput,
transactionStatus
);
});
});

Expand Down
1 change: 1 addition & 0 deletions backend/src/api/bitcoin/bitcoin.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BitcoinRoutes {
.get(config.MEMPOOL.API_URL_PREFIX + 'init-data', this.getInitData)
.get(config.MEMPOOL.API_URL_PREFIX + 'validate-address/:address', this.validateAddress)
.get(config.MEMPOOL.API_URL_PREFIX + 'address/:address', this.getAddress)
.get(config.MEMPOOL.API_URL_PREFIX + 'address/:address/txs', this.getAddressTransactions)
.get(config.MEMPOOL.API_URL_PREFIX + 'block-height/:height', this.getBlockHeight)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/rbf', this.getRbfHistory)
.get(config.MEMPOOL.API_URL_PREFIX + 'tx/:txId/cached', this.getCachedTx)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/api/bitcoin/esplora-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class ElectrsApi implements AbstractBitcoinApi {
}

$getAddressTransactions(address: string, txId?: string): Promise<IEsploraApi.Transaction[]> {
throw new Error('Method getAddressTransactions not implemented.');
return this.failoverRouter.$get<IEsploraApi.Transaction[]>('/address/' + address + '/txs');
}

$getScriptHash(scripthash: string): Promise<IEsploraApi.ScriptHash> {
Expand Down
2 changes: 1 addition & 1 deletion docker-angor-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ services:
LETSENCRYPT_HOST: explorer.angor.io
LETSENCRYPT_EMAIL: admin@blockcore.net
ASPNETCORE_URLS: http://+:8080
image: mempool/frontend:latest
image: blockcore/mempool-frontend:latest
user: "0:1000"
restart: always
stop_grace_period: 1m
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
environment:
FRONTEND_HTTP_PORT: "8080"
BACKEND_MAINNET_HTTP_HOST: "api"
image: mempool/frontend:latest
image: blockcore/mempool-frontend:latest
user: "1000:1000"
restart: on-failure
stop_grace_period: 1m
Expand All @@ -25,7 +25,7 @@ services:
DATABASE_USERNAME: "mempool"
DATABASE_PASSWORD: "mempool"
STATISTICS_ENABLED: "true"
image: mempool/backend:latest
image: blockcore/mempool-backend:latest
user: "1000:1000"
restart: on-failure
stop_grace_period: 1m
Expand Down

0 comments on commit 7ca0c9e

Please sign in to comment.