Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet validators #343

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 4 additions & 2 deletions src/pages/validators/ValidatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion src/pages/validators/components/ValidatorDataChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -23,7 +25,7 @@ export default {
return {
chartOptions: {
title: {
text: 'Mainnet Validator CPU Performance',
text: `${isMainnet ? 'Mainnet' : 'Testnet'} Validator CPU Performance`,
},
credits: {
enabled: false,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/validators/components/ValidatorDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand Down
Loading