From a6e28fbf9bac0080587e0fc3c02834a0221033ce Mon Sep 17 00:00:00 2001 From: Ayaz Date: Thu, 27 Feb 2025 05:21:05 +0500 Subject: [PATCH 1/5] Switch cosmos-sdk to support v0.52.x --- chains/mainnet/ssv.json | 22 ++++++++++++++++++++++ src/modules/[chain]/block/[height].vue | 14 +++++++------- src/modules/[chain]/block/block.ts | 2 +- src/stores/useBaseStore.ts | 20 ++++++++++---------- src/types/base.ts | 2 +- 5 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 chains/mainnet/ssv.json diff --git a/chains/mainnet/ssv.json b/chains/mainnet/ssv.json new file mode 100644 index 0000000000..9f28123d73 --- /dev/null +++ b/chains/mainnet/ssv.json @@ -0,0 +1,22 @@ +{ + "chain_name": "ssv", + "registry_name": "ssvchain", + "api": [ + {"provider": "localhost", "address": "http://localhost:8080"} + ], + "rpc": [ + {"provider": "localhost", "address": "http://localhost:26657"} + ], + "sdk_version": "0.50.11", + "coin_type": "118", + "min_tx_fee": "800", + "addr_prefix": "ssv", + "logo": "https://ssv.network/wp-content/uploads/2024/09/Symbol.png", + "assets": [{ + "base": "ssv", + "symbol": "SSV", + "exponent": "6", + "coingecko_id": "ssv-network", + "logo": "https://ssv.network/wp-content/uploads/2024/09/Symbol.png" + }] +} diff --git a/src/modules/[chain]/block/[height].vue b/src/modules/[chain]/block/[height].vue index 295580ef88..badbeacdb3 100644 --- a/src/modules/[chain]/block/[height].vue +++ b/src/modules/[chain]/block/[height].vue @@ -17,12 +17,12 @@ const current = ref({} as Block) const target = ref(Number(props.height || 0)) const height = computed(() => { - return Number(current.value.block?.header?.height || props.height || 0); + return Number(current.value.sdk_block?.header?.height || props.height || 0); }); const isFutureBlock = computed({ get: () => { - const latest = store.latest?.block?.header.height + const latest = store.latest?.sdk_block?.header.height const isFuture = latest ? target.value > Number(latest) : true if (!isFuture && !current.value.block_id) store.fetchBlock(target.value).then(x => current.value = x) return isFuture @@ -33,7 +33,7 @@ const isFutureBlock = computed({ }) const remainingBlocks = computed(() => { - const latest = store.latest?.block?.header.height + const latest = store.latest?.sdk_block?.header.height return latest ? Number(target.value) - Number(latest) : 0 }) @@ -107,7 +107,7 @@ onBeforeRouteUpdate(async (to, from, next) => {

-

#{{ current.block?.header?.height }}

+

#{{ current.sdk_block?.header?.height }}

@@ -126,17 +126,17 @@ onBeforeRouteUpdate(async (to, from, next) => {

{{ $t('block.block_header') }}

- +

{{ $t('account.transactions') }}

- +

{{ $t('block.last_commit') }}

- +

diff --git a/src/modules/[chain]/block/block.ts b/src/modules/[chain]/block/block.ts index ead62cb3e3..0c332b953f 100644 --- a/src/modules/[chain]/block/block.ts +++ b/src/modules/[chain]/block/block.ts @@ -23,7 +23,7 @@ export const useBlockModule = defineStore('blockModule', { txsInRecents() { const txs = [] as { hash: string; tx: DecodedTxRaw }[]; this.recents.forEach((x) => - x.block?.data?.txs.forEach((tx: Uint8Array) => { + x.sdk_block?.data?.txs.forEach((tx: Uint8Array) => { if (tx) { try { txs.push({ diff --git a/src/stores/useBaseStore.ts b/src/stores/useBaseStore.ts index 48109eb443..1a63a23fb5 100644 --- a/src/stores/useBaseStore.ts +++ b/src/stores/useBaseStore.ts @@ -23,13 +23,13 @@ export const useBaseStore = defineStore('baseStore', { blocktime(): number { if (this.earlest && this.latest) { if ( - this.latest.block?.header?.height !== - this.earlest.block?.header?.height + this.latest.sdk_block?.header?.height !== + this.earlest.sdk_block?.header?.height ) { - const diff = dayjs(this.latest.block?.header?.time).diff( - this.earlest.block?.header?.time + const diff = dayjs(this.latest.sdk_block?.header?.time).diff( + this.earlest.sdk_block?.header?.time ); - const blocks = Number(this.latest.block.header.height) - Number(this.earlest.block.header.height) + const blocks = Number(this.latest.sdk_block.header.height) - Number(this.earlest.sdk_block.header.height) return diff / (blocks); } } @@ -39,7 +39,7 @@ export const useBaseStore = defineStore('baseStore', { return useBlockchain(); }, currentChainId(): string { - return this.latest.block?.header.chain_id || ''; + return this.latest.sdk_block?.header.chain_id || ''; }, txsInRecents() { const txs = [] as { @@ -48,12 +48,12 @@ export const useBaseStore = defineStore('baseStore', { tx: DecodedTxRaw; }[]; this.recents.forEach((b) => - b.block?.data?.txs.forEach((tx: string) => { + b.sdk_block?.data?.txs.forEach((tx: string) => { if (tx) { const raw = fromBase64(tx); try { txs.push({ - height: b.block.header.height, + height: b.sdk_block.header.height, hash: hashTx(raw), tx: decodeTxRaw(raw), }); @@ -82,8 +82,8 @@ export const useBaseStore = defineStore('baseStore', { } if ( !this.earlest || - this.earlest?.block?.header?.chain_id != - this.latest?.block?.header?.chain_id + this.earlest?.sdk_block?.header?.chain_id != + this.latest?.sdk_block?.header?.chain_id ) { //reset earlest and recents this.earlest = this.latest; diff --git a/src/types/base.ts b/src/types/base.ts index 4c59b2ff78..d78c674619 100644 --- a/src/types/base.ts +++ b/src/types/base.ts @@ -53,7 +53,7 @@ export interface Signature export interface Block { block_id: BlockId, - block: { + sdk_block: { header: { version: { block: string, From f2e5e1d0af6217a77597ae32c38eae44b99ca0b4 Mon Sep 17 00:00:00 2001 From: Ayaz Date: Thu, 27 Feb 2025 16:53:31 +0500 Subject: [PATCH 2/5] Fix rest port --- chains/mainnet/ssv.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chains/mainnet/ssv.json b/chains/mainnet/ssv.json index 9f28123d73..329fdd26bb 100644 --- a/chains/mainnet/ssv.json +++ b/chains/mainnet/ssv.json @@ -2,7 +2,7 @@ "chain_name": "ssv", "registry_name": "ssvchain", "api": [ - {"provider": "localhost", "address": "http://localhost:8080"} + {"provider": "localhost", "address": "http://localhost:1317"} ], "rpc": [ {"provider": "localhost", "address": "http://localhost:26657"} From 57517617212ea96d374c24d98f04fbdc295caa10 Mon Sep 17 00:00:00 2001 From: Vaclav R Date: Thu, 27 Feb 2025 15:54:39 +0100 Subject: [PATCH 3/5] Dockerfile --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..1a1dd836ff --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Use an official Node.js runtime as the base image +FROM node:23-alpine + +# Set the working directory inside the container +WORKDIR /app + +# Copy only the dependency files first (for efficient caching) +COPY package.json yarn.lock ./ + +# Install dependencies +RUN yarn install + +# Copy the rest of the application code +COPY . . + +# Expose the port (optional, depends on your app configuration) +EXPOSE 5173 + +# Run the development server +CMD ["yarn", "start"] + From de61e91c61b9b071d13d223c3d1071f239cae2ab Mon Sep 17 00:00:00 2001 From: Vaclav R Date: Thu, 27 Feb 2025 15:55:42 +0100 Subject: [PATCH 4/5] Dockerfile --- .github/workflows/docker.yaml | 51 ------------------- .../workflows/mainnet-deploy.yaml.disabled | 28 ---------- .github/workflows/testnet-deploy.yaml | 27 ---------- 3 files changed, 106 deletions(-) delete mode 100644 .github/workflows/docker.yaml delete mode 100644 .github/workflows/mainnet-deploy.yaml.disabled delete mode 100644 .github/workflows/testnet-deploy.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index ce1e3034b7..0000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: docker - -on: - push: - branches: - - 'master-backup' - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 -# - -# name: Set up QEMU -# uses: docker/setup-qemu-action@v1 -# - -# name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v1 - - name: Install - run: yarn install - - name: Build - run: yarn run vue-cli-service build - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker meta - id: meta - uses: docker/metadata-action@v3 - with: - # list of Docker images to use as base name for tags - images: | - yaoling/wallet - # generate Docker tags based on the following events/attributes - tags: | - type=sha - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/mainnet-deploy.yaml.disabled b/.github/workflows/mainnet-deploy.yaml.disabled deleted file mode 100644 index 0b69f65c88..0000000000 --- a/.github/workflows/mainnet-deploy.yaml.disabled +++ /dev/null @@ -1,28 +0,0 @@ - -name: Deploy to ping.pub - -on: - push: - branches: [ master2 ] - # pull_request: - # branches: [ master ] - -jobs: - deploy: - name: Ping deploy - runs-on: mainnet - steps: - - name: Environment - run: export NODE_OPTIONS="--max_old_space_size=4096" - - - name: Git Checkout Latest - uses: actions/checkout@v3 - - - name: Install - run: yarn install --ignore-engines - - - name: Build - run: yarn build - - - name: Deploy - run: cp -rf ./dist/* /var/www/html/ \ No newline at end of file diff --git a/.github/workflows/testnet-deploy.yaml b/.github/workflows/testnet-deploy.yaml deleted file mode 100644 index 55391d0122..0000000000 --- a/.github/workflows/testnet-deploy.yaml +++ /dev/null @@ -1,27 +0,0 @@ - -name: Testnet Deploy - -on: - push: - branches: [ testnet ] - pull_request: - branches: [ testnet ] - -jobs: - deploy: - name: Ping deploy - runs-on: testnet - steps: - - name: print - run: echo ${GITHUB_REF#refs/heads/} - - name: Git Checkout Latest - uses: actions/checkout@v2 - - - name: Install - run: yarn install - - - name: Build - run: yarn run vue-cli-service build - - - name: Deploy - run: cp -rf ./dist/* /var/www/html/ \ No newline at end of file From 2da1b68a92ed9b15b4691ef48b5cf00d2b715796 Mon Sep 17 00:00:00 2001 From: "stoyan.peev" Date: Fri, 28 Feb 2025 12:36:24 +0200 Subject: [PATCH 5/5] Test deployment --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1a1dd836ff..52c1610a64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,3 @@ EXPOSE 5173 # Run the development server CMD ["yarn", "start"] -