diff --git a/.env.example b/.env.example index 8170d79b..baeecff7 100644 --- a/.env.example +++ b/.env.example @@ -14,33 +14,34 @@ HASURA_GRAPHQL_ACTION_BASE_URL=http://hapi:9090 # hapi HAPI_SERVER_PORT=9090 HAPI_SERVER_ADDRESS=hapi -HAPI_NETWORK_API=https://eos.api.eosnation.io -HAPI_NETWORK_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 +HAPI_NETWORK_API=https://jungle4.api.eosnation.io +HAPI_NETWORK_CHAIN_ID=73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d HAPI_NETWORK_BASE_ACCOUNT=accountname1 HAPI_NETWORK_BASE_PASSWORD=PW... HAPI_NETWORK_WALLET_URL=http://wallet:8888 HAPI_HASURA_URL=http://hasura:8080/v1/graphql HAPI_HASURA_ADMIN_SECRET=myadminsecretkey HAPI_EDEN_ELECTION_INTERVAL=7889400 -HAPI_EDEN_HISTORIC_ELECTION= [{"election": 0, "date_election": "2021-10-09"}, {"election": 1, "date_election": "2022-04-09"}, {"election": 2, "date_election": "2022-07-09"}, {"election": 3, "date_election": "2022-10-08"}] +HAPI_EDEN_HISTORIC_ELECTION= [{"election": 0, "date_election": "2022-09-18"}, {"election": 1, "date_election": "2022-09-22"}, {"election": 2, "date_election": "2022-09-23T13:00:00.000"}, {"election": 3, "date_election": "2022-09-23T20:00:00.000"}, {"election": 4, "date_election": "2022-09-27"}, {"election": 5, "date_election": "2022-09-30"}] HAPI_EDEN_CONTRACT=genesis.eden HAPI_RATE_HISTORY=https://api.coingecko.com/api/v3 HAPI_DFUSE_API_KEY= -HAPI_DFUSE_API=eos.dfuse.eosnation.io -HAPI_DFUSE_FIRST_BLOCK=209174091 +HAPI_DFUSE_API=jungle4.dfuse.eosnation.io +HAPI_DFUSE_FIRST_BLOCK=35955488 #webapp PORT=3000 REACT_APP_TAG=localdev -REACT_APP_NAME=local -REACT_APP_TITLE=Eden on EOS delegate spend explorer +REACT_APP_NAME=eden-spending +REACT_APP_TITLE=Eden on EOS Accounting Standard REACT_APP_LOGO=https://raw.githubusercontent.com/eoscostarica/design-assets/master/logos/eosCR/fullColor-vertiall-transparent-white.png REACT_APP_FOOTER_LINKS=[] -REACT_APP_UAL_APP_NAME=edenSpendingApp +REACT_APP_UAL_APP_NAME=EOS Reports REACT_APP_UAL_API_PROTOCOL=https -REACT_APP_UAL_API_HOST=eos.greymass.com +REACT_APP_UAL_API_HOST=jungle4.api.eosnation.io REACT_APP_UAL_API_PORT=443 -REACT_APP_UAL_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 +REACT_APP_UAL_CHAIN_ID=73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d REACT_APP_HASURA_URL=http://localhost:8080/v1/graphql REACT_APP_RATE_HISTORY=https://api.coingecko.com/api/v3 REACT_APP_EDEN_CONTRACT=genesis.eden +REACT_APP_URL_ENDPOINT=https://eden-api-dev.edenia.cloud diff --git a/.github/workflows/push-dev-environment.yaml b/.github/workflows/push-dev-environment.yaml index 746d8779..90823eea 100644 --- a/.github/workflows/push-dev-environment.yaml +++ b/.github/workflows/push-dev-environment.yaml @@ -45,6 +45,7 @@ jobs: REACT_APP_HASURA_URL: ${{ secrets.REACT_APP_HASURA_URL }} REACT_APP_RATE_HISTORY: ${{ secrets.REACT_APP_RATE_HISTORY }} REACT_APP_EDEN_CONTRACT: 'genesis.eden' + REACT_APP_URL_ENDPOINT: 'https://eden-api-dev.edenia.cloud' - name: Build kubernetes files id: build_kubernetes_files @@ -79,7 +80,7 @@ jobs: HAPI_EDEN_ELECTION_INTERVAL: 7889400 HAPI_EDEN_HISTORIC_ELECTION: ${{secrets.HAPI_EDEN_HISTORIC_ELECTION}} HAPI_EDEN_CONTRACT: genesis.eden - HAPI_DFUSE_API_KEY: + HAPI_DFUSE_API_KEY: ${{secrets.HAPI_DFUSE_API_KEY}} HAPI_DFUSE_API: jungle4.dfuse.eosnation.io HAPI_DFUSE_FIRST_BLOCK: ${{secrets.HAPI_DFUSE_FIRST_BLOCK}} # hasura @@ -96,4 +97,4 @@ jobs: NAMESPACE: eden-spending K8S_BUILD_DIR: build_k8s with: - args: version && make deploy-kubernetes \ No newline at end of file + args: version && make deploy-kubernetes diff --git a/.github/workflows/push-prod-environment.yaml b/.github/workflows/push-prod-environment.yaml index 962e46db..88546e12 100644 --- a/.github/workflows/push-prod-environment.yaml +++ b/.github/workflows/push-prod-environment.yaml @@ -46,6 +46,7 @@ jobs: REACT_APP_HASURA_URL: ${{ secrets.REACT_APP_HASURA_URL }} REACT_APP_RATE_HISTORY: ${{ secrets.REACT_APP_RATE_HISTORY }} REACT_APP_EDEN_CONTRACT: 'genesis.eden' + REACT_APP_URL_ENDPOINT: 'https://eden-api.edenia.cloud' - name: Build kubernetes files id: build_kubernetes_files diff --git a/docker-compose.yaml b/docker-compose.yaml index b0e3797c..ca1c6f2a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -98,5 +98,6 @@ services: REACT_APP_HASURA_URL: '${REACT_APP_HASURA_URL}' REACT_APP_RATE_HISTORY: '${REACT_APP_RATE_HISTORY}' REACT_APP_EDEN_CONTRACT: '${REACT_APP_EDEN_CONTRACT}' + REACT_APP_URL_ENDPOINT: '${REACT_APP_URL_ENDPOINT}' volumes: postgres_data: diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 67f7a763..a67528dc 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -13,6 +13,7 @@ ARG react_app_ual_chain_id ARG react_app_hasura_url ARG react_app_rate_history ARG react_app_eden_contract +ARG react_app_url_endpoint ENV REACT_APP_TAG $react_app_tag ENV REACT_APP_NAME $react_app_name @@ -27,6 +28,7 @@ ENV REACT_APP_UAL_CHAIN_ID $react_app_ual_chain_id ENV REACT_APP_HASURA_URL $react_app_hasura_url ENV REACT_APP_RATE_HISTORY $react_app_rate_history ENV REACT_APP_EDEN_CONTRACT $react_app_eden_contract +ENV REACT_APP_URL_ENDPOINT $react_app_url_endpoint WORKDIR /usr/src/app diff --git a/webapp/makefile b/webapp/makefile index 70866d5c..fb4abf09 100644 --- a/webapp/makefile +++ b/webapp/makefile @@ -35,6 +35,7 @@ build-docker: ./Dockerfile --build-arg react_app_hasura_url="$(REACT_APP_HASURA_URL)" \ --build-arg react_app_rate_history="$(REACT_APP_RATE_HISTORY)" \ --build-arg react_app_eden_contract="$(REACT_APP_EDEN_CONTRACT)" \ + --build-arg react_app_url_endpoint="$(REACT_APP_URL_ENDPOINT)" \ . pull-image: ##@devops Pull the latest image from registry for caching diff --git a/webapp/src/components/Sidebar/index.js b/webapp/src/components/Sidebar/index.js index d63a4ceb..85f5253e 100644 --- a/webapp/src/components/Sidebar/index.js +++ b/webapp/src/components/Sidebar/index.js @@ -15,6 +15,7 @@ import PropTypes from 'prop-types' import { useSharedState } from '../../context/state.context' import { GET_MEMBERS_DATA } from '../../gql' +import { mainConfig } from '../../config' import AuthButton from '../AuthButton' import styles from './styles' @@ -31,7 +32,7 @@ const SidebarComp = ({ routes, openComponent, onClose }) => { const [open, setOpen] = useState(false) const { pathname } = router const [userData, setUSerData] = useState() - const client = new GraphQLClient('https://eden-api.edenia.cloud/v1/graphql', { + const client = new GraphQLClient(`${mainConfig.urlEndpoint}/v1/graphql`, { headers: {} }) diff --git a/webapp/src/config/main.config.js b/webapp/src/config/main.config.js index 95cbaab0..d2747845 100644 --- a/webapp/src/config/main.config.js +++ b/webapp/src/config/main.config.js @@ -4,6 +4,7 @@ export const title = process.env.REACT_APP_TITLE export const logo = process.env.REACT_APP_LOGO export const eosRate = process.env.REACT_APP_RATE_HISTORY export const edenContract = process.env.REACT_APP_EDEN_CONTRACT +export const urlEndpoint = process.env.REACT_APP_URL_ENDPOINT export const footerLinks = JSON.parse( process.env.REACT_APP_FOOTER_LINKS || '[]' ) diff --git a/webapp/src/hooks/customHooks/useDelegateReportState.js b/webapp/src/hooks/customHooks/useDelegateReportState.js index 8fe9cb2c..6ab4cca6 100644 --- a/webapp/src/hooks/customHooks/useDelegateReportState.js +++ b/webapp/src/hooks/customHooks/useDelegateReportState.js @@ -1,6 +1,7 @@ import { useEffect, useReducer } from 'react' import { gql, GraphQLClient } from 'graphql-request' +import { mainConfig } from '../../config' import { GET_ELECTIONS_BY_YEAR, GET_MEMBERS_DATA, @@ -27,7 +28,7 @@ const INIT_REDUCER_DATA = { maxLevel: 0, searchValue: '' } -const client = new GraphQLClient('https://eden-api.edenia.cloud/v1/graphql', { +const client = new GraphQLClient(`${mainConfig.urlEndpoint}/v1/graphql`, { headers: {} })