Skip to content

Commit

Permalink
Merge pull request #1270 from edenia/fix/env-variable-evm-endpoints-1269
Browse files Browse the repository at this point in the history
Fix/env variable evm endpoints 1269
  • Loading branch information
xavier506 authored Aug 29, 2023
2 parents b1512e5 + 0c65321 commit 55cae9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-telos-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
REACT_APP_PUBLIC_RE_CAPTCHA_KEY: ${{ secrets.REACT_APP_PUBLIC_RE_CAPTCHA_KEY }}
REACT_APP_EVM_ENDPOINT: 'https://testnet.telos.net/evm'
REACT_APP_EVM_BLOCK_EXPLORER_URL: 'https://testnet.teloscan.io/block/(block)'
REACT_APP_EVM_ENDPOINTS: '[\"https://testnet.telos.net/evm\"]'
REACT_APP_EVM_ENDPOINTS: '["https://testnet.telos.net/evm"]'

- name: Build and deploy kubernetes files
id: build_kubernetes_files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-telos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
REACT_APP_PUBLIC_RE_CAPTCHA_KEY: ${{ secrets.REACT_APP_PUBLIC_RE_CAPTCHA_KEY }}
REACT_APP_EVM_ENDPOINT: 'https://mainnet.telos.net/evm'
REACT_APP_EVM_BLOCK_EXPLORER_URL: 'https://www.teloscan.io/block/(block)'
REACT_APP_EVM_ENDPOINTS: '[\"https://rpc1.eu.telos.net/evm\",\"https://api.kainosbp.com/evm\",\"https://mainnet.telos.net/evm\",\"https://rpc1.us.telos.net/evm\",\"https://rpc2.eu.telos.net/evm\",\"https://rpc2.us.telos.net/evm\",\"https://evm.teloskorea.com/evm\",\"https://rpc2.teloskorea.com/evm\",\"https://rpc01.us.telosunlimited.io/evm\"]'
REACT_APP_EVM_ENDPOINTS: '["https://rpc1.eu.telos.net/evm","https://api.kainosbp.com/evm","https://mainnet.telos.net/evm","https://rpc1.us.telos.net/evm","https://rpc2.eu.telos.net/evm","https://rpc2.us.telos.net/evm","https://evm.teloskorea.com/evm","https://rpc2.teloskorea.com/evm","https://rpc01.us.telosunlimited.io/evm"]'

- name: Build and deploy kubernetes files
id: build_kubernetes_files
Expand Down
10 changes: 9 additions & 1 deletion webapp/src/config/evm.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { eosConfig } from 'config'

let _avgBlockTime = 'N/A'
let _endpoints

switch (eosConfig.networkName) {
case 'telos-testnet':
Expand All @@ -15,9 +16,16 @@ switch (eosConfig.networkName) {
break
}

try {
_endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || []
} catch (error) {
console.error(error)
_endpoints = []
}

export const avgBlockTime = _avgBlockTime
export const maxTPSDataSize = 30 / _avgBlockTime || 0
export const account = 'eosio.evm'
export const endpoint = process.env.REACT_APP_EVM_ENDPOINT
export const blockExplorerUrl = process.env.REACT_APP_EVM_BLOCK_EXPLORER_URL
export const endpoints = JSON.parse(process.env.REACT_APP_EVM_ENDPOINTS || '[]') || []
export const endpoints = _endpoints

0 comments on commit 55cae9e

Please sign in to comment.