From fc245a8aa269a592adfbb9e1d45dd9010f8ddfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viterbo=20Rodr=C3=ADguez?= Date: Thu, 11 Apr 2024 08:01:19 -0300 Subject: [PATCH 1/2] adding Testnet validators --- env.js | 60 +++++++++---------- src/pages/validators/ValidatorData.vue | 6 +- .../components/ValidatorDataChart.vue | 4 +- .../components/ValidatorDataTable.vue | 3 +- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/env.js b/env.js index febd83e0..cf7f9240 100644 --- a/env.js +++ b/env.js @@ -3,45 +3,45 @@ The environment variables are set based on the single variable `MAINNET=true` (or absence thereof) in the root `.env` file. The following env vars are then assigned in `quasar.config.js`. */ -require("dotenv").config(); +require('dotenv').config(); const sharedEnv = { - NETWORK_PROTOCOL: "https", - NETWORK_PORT: 443, - TELOS_ORIGIN: "http://localhost:3030", - TOKENMANAGER_CONTRACT: "tokenmanager", - GOOGLE_ANALYTICS: "UA-154600181-2", - IMGUR_CLIENT_ID: "b6f46df9d1da9d9", - WEBSERVICES_API_KEY: "XXX", - NETWORK_ENV: "shared", + NETWORK_PROTOCOL: 'https', + NETWORK_PORT: 443, + TELOS_ORIGIN: 'http://localhost:3030', + TOKENMANAGER_CONTRACT: 'tokenmanager', + GOOGLE_ANALYTICS: 'UA-154600181-2', + IMGUR_CLIENT_ID: 'b6f46df9d1da9d9', + WEBSERVICES_API_KEY: 'XXX', + NETWORK_ENV: 'shared', }; const TESTNET = { - ...sharedEnv, - APP_NAME: "Telos App (test net)", - NETWORK_HOST: "testnet.telos.net", - NETWORK_CHAIN_ID: - "1eaa0824707c8c16bd25145493bf062aecddfeb56c736f6ba6397f3195f33c9f", - WEBSERVICES_URL: "https://api-dev.telos.net", - HYPERION_URL: "https://testnet.telos.net", - BLOCKCHAIN_EXPLORER: "https://explorer-test.telos.net", - NETWORK_ENV: "testnet", - ARB_CONTRACT: 'testtelosarb', + ...sharedEnv, + APP_NAME: 'Telos App (test net)', + NETWORK_HOST: 'testnet.telos.net', + NETWORK_CHAIN_ID: + '1eaa0824707c8c16bd25145493bf062aecddfeb56c736f6ba6397f3195f33c9f', + WEBSERVICES_URL: 'https://api-dev.telos.net', + HYPERION_URL: 'https://testnet.telos.net', + BLOCKCHAIN_EXPLORER: 'https://explorer-test.telos.net', + NETWORK_ENV: 'testnet', + ARB_CONTRACT: 'testtelosarb', }; const MAINNET = { - ...sharedEnv, - APP_NAME: "Telos App", - NETWORK_HOST: "mainnet.telos.net", - NETWORK_CHAIN_ID: - "4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11", - WEBSERVICES_URL: "https://api.telos.net", - HYPERION_URL: "https://mainnet.telos.net", - BLOCKCHAIN_EXPLORER: "https://explorer.telos.net", - NETWORK_ENV: "mainnet", - ARB_CONTRACT: 'arbitration', + ...sharedEnv, + APP_NAME: 'Telos App', + NETWORK_HOST: 'mainnet.telos.net', + NETWORK_CHAIN_ID: + '4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11', + WEBSERVICES_URL: 'https://api.telos.net', + HYPERION_URL: 'https://mainnet.telos.net', + BLOCKCHAIN_EXPLORER: 'https://explorer.telos.net', + NETWORK_ENV: 'mainnet', + ARB_CONTRACT: 'arbitration', }; -const env = process.env.NETWORK === "mainnet" ? MAINNET : TESTNET; +const env = process.env.NETWORK === 'mainnet' ? MAINNET : TESTNET; module.exports = env; diff --git a/src/pages/validators/ValidatorData.vue b/src/pages/validators/ValidatorData.vue index 0b5612ce..8321e1e3 100644 --- a/src/pages/validators/ValidatorData.vue +++ b/src/pages/validators/ValidatorData.vue @@ -23,8 +23,10 @@ import { mapGetters } from 'vuex'; import ValidatorDataChart from './components/ValidatorDataChart.vue'; import ValidatorDataTable from './components/ValidatorDataTable.vue'; -const BUCKET_URL = 'https://telos-producer-validation.s3.amazonaws.com'; - +const MAINNET_BUCKET_URL = 'https://telos-producer-validation.s3.amazonaws.com'; +const TESTNET_BUCKET_URL = 'https://telos-testnet-producer-validation.s3.amazonaws.com'; +const isMainnet = process.env.NETWORK_ENV === 'mainnet'; +const BUCKET_URL = isMainnet ? MAINNET_BUCKET_URL : TESTNET_BUCKET_URL; export default { // eslint-disable-next-line vue/multi-word-component-names name: 'Validator', diff --git a/src/pages/validators/components/ValidatorDataChart.vue b/src/pages/validators/components/ValidatorDataChart.vue index e1be84c3..78404a01 100644 --- a/src/pages/validators/components/ValidatorDataChart.vue +++ b/src/pages/validators/components/ValidatorDataChart.vue @@ -14,6 +14,8 @@ import { Chart } from 'highcharts-vue'; import { mapActions, mapState } from 'vuex'; +const isMainnet = process.env.NETWORK_ENV === 'mainnet'; + export default { name: 'ValidatorDataChart', components: { @@ -23,7 +25,7 @@ export default { return { chartOptions: { title: { - text: 'Mainnet Validator CPU Performance', + text: `${isMainnet ? 'Mainnet' : 'Testnet'} Validator CPU Performance`, }, credits: { enabled: false, diff --git a/src/pages/validators/components/ValidatorDataTable.vue b/src/pages/validators/components/ValidatorDataTable.vue index 0a30531a..1f1f9889 100644 --- a/src/pages/validators/components/ValidatorDataTable.vue +++ b/src/pages/validators/components/ValidatorDataTable.vue @@ -127,6 +127,7 @@ import { mapGetters } from 'vuex'; import moment from 'moment'; const MAX_VOTE_PRODUCERS = 30; +const isMainnet = process.env.NETWORK_ENV === 'mainnet'; export default { name: 'ValidatorDataTable', @@ -285,7 +286,7 @@ export default { .utc(this.lastUpdated) .local() .format('YYYY-MM-DD HH:mm'); - return `Mainnet Validators (${localTime})`; + return `${isMainnet ? 'Mainnet' : 'Testnet'} Validators (${localTime})`;; }, maxSelected() { return this.currentVote.length === MAX_VOTE_PRODUCERS; From 045c10688414fd3200b900631387c55196026665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viterbo=20Rodr=C3=ADguez?= Date: Thu, 11 Apr 2024 08:13:16 -0300 Subject: [PATCH 2/2] fixing lint --- src/pages/validators/components/ValidatorDataTable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/validators/components/ValidatorDataTable.vue b/src/pages/validators/components/ValidatorDataTable.vue index 1f1f9889..657936f3 100644 --- a/src/pages/validators/components/ValidatorDataTable.vue +++ b/src/pages/validators/components/ValidatorDataTable.vue @@ -286,7 +286,7 @@ export default { .utc(this.lastUpdated) .local() .format('YYYY-MM-DD HH:mm'); - return `${isMainnet ? 'Mainnet' : 'Testnet'} Validators (${localTime})`;; + return `${isMainnet ? 'Mainnet' : 'Testnet'} Validators (${localTime})`; }, maxSelected() { return this.currentVote.length === MAX_VOTE_PRODUCERS;