From 37e8e4ccc145a3995b7e1756097e1186a21ac708 Mon Sep 17 00:00:00 2001 From: Andres Gomez Date: Thu, 15 Apr 2021 21:38:50 +0000 Subject: [PATCH 01/21] avoid statefulsets update errors on actions runs refs #535. (#536) --- .github/workflows/push-master-environment.yaml | 8 +++++--- .github/workflows/push-staging-environment.yaml | 13 +++++-------- makefile | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index 0bae43a9..8812c036 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -80,12 +80,14 @@ jobs: # pgweb DATABASE_URL: ${{ secrets.DATABASE_URL }} - - name: Deploy kubernetes files - uses: Consensys/kubernetes-action@master + - name: Setup and deploy kubernetes environment + uses: steebchen/kubectl@master env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + NAMESPACE: mainnet-eosrate + K8S_BUILD_DIR: build_k8s with: - args: apply -f build_k8s -n mainnet-eosrate + args: version && make deploy-kubernetes - name: Create Release id: create_release diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index f8487705..3091def5 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -80,14 +80,11 @@ jobs: # pgweb DATABASE_URL: ${{ secrets.DATABASE_URL }} - - name: Deploy kubernetes files - uses: Consensys/kubernetes-action@master + - name: Setup and deploy kubernetes environment + uses: steebchen/kubectl@master env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + NAMESPACE: jungle-eosrate + K8S_BUILD_DIR: build_k8s with: - args: apply -f build_k8s -n jungle-eosrate - -# - name: Verify deployment -# id: verify_deployment -# run: | -# kubectl rollout status deployment/hapi + args: version && make deploy-kubernetes diff --git a/makefile b/makefile index a324b508..78ee7997 100644 --- a/makefile +++ b/makefile @@ -54,7 +54,7 @@ deploy-kubernetes: $(K8S_BUILD_DIR) -n $(NAMESPACE) || echo "SSL cert already configured."; @echo "Applying kubernetes files..." @for file in $(shell find $(K8S_BUILD_DIR) -name '*.yaml' | sed 's:$(K8S_BUILD_DIR)/::g'); do \ - kubectl apply -f $(K8S_BUILD_DIR)/$$file -n $(NAMESPACE); \ + kubectl apply -f $(K8S_BUILD_DIR)/$$file -n $(NAMESPACE) || echo "${file} Cannot be updated."; \ done build-docker-images: ##@devops Build docker images From 961213f61d9d467ad476404ece7619538aa0b587 Mon Sep 17 00:00:00 2001 From: Andres Gomez Date: Mon, 19 Apr 2021 19:46:10 -0600 Subject: [PATCH 02/21] deprecate demux service. refs #538 (#540) --- kubernetes/demux-deployment.yaml | 44 -------------------------------- kubernetes/demux-service.yaml | 13 ---------- 2 files changed, 57 deletions(-) delete mode 100644 kubernetes/demux-deployment.yaml delete mode 100644 kubernetes/demux-service.yaml diff --git a/kubernetes/demux-deployment.yaml b/kubernetes/demux-deployment.yaml deleted file mode 100644 index 6a27ac0f..00000000 --- a/kubernetes/demux-deployment.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: demux - name: demux -spec: - replicas: 1 - selector: - matchLabels: - app: demux - strategy: - type: Recreate - template: - metadata: - labels: - app: demux - spec: - containers: - - env: - - name: DB_HOST - value: postgres - - name: DB_NAME - value: eosrate - - name: DB_PASSWORD - value: pass - - name: DB_PORT - value: "5432" - - name: DB_SCHEMA - value: public - - name: DB_USER - value: user - - name: EOS_API_ENDPOINT - value: https://bp.cryptolions.io - - name: WAIT_HOSTS - value: postgres:5432, hasura:8080 - - name: WAIT_HOSTS_TIMEOUT - value: "60" - image: eoscostarica506/demux - imagePullPolicy: "Always" - name: eosrate-demux - ports: - - containerPort: 3030 - restartPolicy: Always diff --git a/kubernetes/demux-service.yaml b/kubernetes/demux-service.yaml deleted file mode 100644 index d8824c11..00000000 --- a/kubernetes/demux-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: demux - name: demux -spec: - ports: - - name: "3030" - port: 3030 - targetPort: 3030 - selector: - app: demux From f56b55983831b40aa058b38daf3a681ae5d20013 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Tue, 20 Apr 2021 12:00:44 -0600 Subject: [PATCH 03/21] add handler url from env var & other minor bug fixes (#542) --- .../workflows/push-master-environment.yaml | 1 + .../workflows/push-staging-environment.yaml | 3 +- docker-compose.staging.yml | 9 +- docker-compose.yml | 4 +- services/frontend/.env | 4 +- services/frontend/.env.staging | 4 +- services/frontend/src/services/graphql.js | 8 +- services/hasura/migrations/.env | 1 + services/hasura/migrations/metadata.yaml | 242 +++++++++--------- 9 files changed, 138 insertions(+), 138 deletions(-) create mode 100644 services/hasura/migrations/.env diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index 8812c036..45a96451 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -77,6 +77,7 @@ jobs: HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }} HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${{ secrets.HASURA_GRAPHQL_UNAUTHORIZED_ROLE }} + HASURA_GRAPHQL_ACTION_BASE_URL: ${{secrets.HASURA_GRAPHQL_ACTION_BASE_URL}} # pgweb DATABASE_URL: ${{ secrets.DATABASE_URL }} diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index 3091def5..0f136465 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -77,6 +77,7 @@ jobs: HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }} HASURA_GRAPHQL_UNAUTHORIZED_ROLE: ${{ secrets.HASURA_GRAPHQL_UNAUTHORIZED_ROLE }} + HASURA_GRAPHQL_ACTION_BASE_URL: ${{secrets.HASURA_GRAPHQL_ACTION_BASE_URL}} # pgweb DATABASE_URL: ${{ secrets.DATABASE_URL }} @@ -87,4 +88,4 @@ jobs: NAMESPACE: jungle-eosrate K8S_BUILD_DIR: build_k8s with: - args: version && make deploy-kubernetes + args: version && make deploy-kubernetes \ No newline at end of file diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 2d191b96..a00bc736 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -33,10 +33,10 @@ services: context: ./services/hapi dockerfile: Dockerfile volumes: - - ./services/hapi:/opt/application - - /opt/application/node_modules + - ./services/hapi:/opt/application + - /opt/application/node_modules ports: - - '3005:3005' + - "3005:3005" environment: VIRTUAL_HOST: 0.0.0.0 VIRTUAL_PORT: 3005 @@ -49,7 +49,7 @@ services: EOS_API_ENDPOINT: "https://jungle.eosio.cr" depends_on: - - postgres + - postgres demux: container_name: eosrate_demux @@ -91,6 +91,7 @@ services: HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations VIRTUAL_HOST: staging.eosrate.io VIRTUAL_PORT: 8088 + HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090 volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder command: diff --git a/docker-compose.yml b/docker-compose.yml index fdf64c9d..b11a9bd8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -92,8 +92,8 @@ services: environment: HASURA_GRAPHQL_DATABASE_URL: postgres://user:pass@postgres:5432/eosrate?sslmode=disable HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations - HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}" - HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}" + HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090 + volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder command: diff --git a/services/frontend/.env b/services/frontend/.env index 9e0e9413..0c586aa5 100644 --- a/services/frontend/.env +++ b/services/frontend/.env @@ -1,6 +1,6 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1alpha1/graphql +REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8088/v1/graphql REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql +REACT_APP_GRAPHQL_WS_URL=wss://localhost:8088/v1/graphql REACT_APP_EOS_API_URL=https://jungle.eosio.cr REACT_APP_EOS_API_HOST=jungle.eosio.cr REACT_APP_EOS_API_PORT=443 diff --git a/services/frontend/.env.staging b/services/frontend/.env.staging index 9e0e9413..2b2a98a6 100644 --- a/services/frontend/.env.staging +++ b/services/frontend/.env.staging @@ -1,6 +1,6 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1alpha1/graphql +REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1/graphql REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql +REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1/graphql REACT_APP_EOS_API_URL=https://jungle.eosio.cr REACT_APP_EOS_API_HOST=jungle.eosio.cr REACT_APP_EOS_API_PORT=443 diff --git a/services/frontend/src/services/graphql.js b/services/frontend/src/services/graphql.js index 129a6c44..8984deda 100644 --- a/services/frontend/src/services/graphql.js +++ b/services/frontend/src/services/graphql.js @@ -7,17 +7,13 @@ import { InMemoryCache } from 'apollo-cache-inmemory' // Create an http link: const httpLink = new HttpLink({ - uri: - process.env.REACT_APP_GRAPHQL_HTTP_URL || - 'http://localhost:8088/v1alpha1/graphql', + uri: process.env.REACT_APP_GRAPHQL_HTTP_URL, credentials: 'same-origin' }) // Create a WebSocket link: const wsLink = new WebSocketLink({ - uri: - process.env.REACT_APP_GRAPHQL_WS_URL || - 'ws://localhost:8088/v1alpha1/graphql', + uri: process.env.REACT_APP_GRAPHQL_WS_URL, options: { reconnect: true } diff --git a/services/hasura/migrations/.env b/services/hasura/migrations/.env new file mode 100644 index 00000000..b7125be9 --- /dev/null +++ b/services/hasura/migrations/.env @@ -0,0 +1 @@ +HASURA_GRAPHQL_ACTION_BASE_URL=http://hapi:9090 \ No newline at end of file diff --git a/services/hasura/migrations/metadata.yaml b/services/hasura/migrations/metadata.yaml index 9d71b229..7407f974 100644 --- a/services/hasura/migrations/metadata.yaml +++ b/services/hasura/migrations/metadata.yaml @@ -1,127 +1,127 @@ version: 2 tables: -- table: - schema: public - name: producers - select_permissions: - - role: anonymous - permission: - columns: - - bpjson - - general_info - - owner - - system - filter: {} -- table: - schema: public - name: producers_list - select_permissions: - - role: anonymous - permission: - columns: - - owner - - bpjson - - system - - candidate_name - - total_votes - - average - - transparency - - infrastructure - - trustiness - - community - - development - - ratings_cntr - - general_info - filter: {} -- table: - schema: public - name: proxies - select_permissions: - - role: anonymous - permission: - columns: - - owner - - name - - website - - slogan - - philosophy - - background - - logo_256 - - telegram - - steemit - - twitter - - wechat - - voter_info - filter: {} -- table: - schema: public - name: ratings_stats - select_permissions: - - role: anonymous - permission: - columns: - - bp - - ratings_cntr - - average - - transparency - - infrastructure - - trustiness - - community - - development - - created_at - - updated_at - filter: {} -- table: - schema: public - name: user_ratings - select_permissions: - - role: anonymous - permission: - columns: - - ratings - - tx_data - - bp - - uniq_rating - - user - filter: {} - delete_permissions: - - role: anonymous - permission: - filter: {} + - table: + schema: public + name: producers + select_permissions: + - role: anonymous + permission: + columns: + - bpjson + - general_info + - owner + - system + filter: {} + - table: + schema: public + name: producers_list + select_permissions: + - role: anonymous + permission: + columns: + - owner + - bpjson + - system + - candidate_name + - total_votes + - average + - transparency + - infrastructure + - trustiness + - community + - development + - ratings_cntr + - general_info + filter: {} + - table: + schema: public + name: proxies + select_permissions: + - role: anonymous + permission: + columns: + - owner + - name + - website + - slogan + - philosophy + - background + - logo_256 + - telegram + - steemit + - twitter + - wechat + - voter_info + filter: {} + - table: + schema: public + name: ratings_stats + select_permissions: + - role: anonymous + permission: + columns: + - bp + - ratings_cntr + - average + - transparency + - infrastructure + - trustiness + - community + - development + - created_at + - updated_at + filter: {} + - table: + schema: public + name: user_ratings + select_permissions: + - role: anonymous + permission: + columns: + - ratings + - tx_data + - bp + - uniq_rating + - user + filter: {} + delete_permissions: + - role: anonymous + permission: + filter: {} actions: -- name: rateProducer - definition: - handler: http://hapi:3005/ratebp - output_type: RatingOutput - arguments: - - name: ratingInput - type: RatingInput! - type: mutation - kind: synchronous - permissions: - - role: anonymous + - name: rateProducer + definition: + handler: "{{HASURA_GRAPHQL_ACTION_BASE_URL}}/ratebp" + output_type: RatingOutput + arguments: + - name: ratingInput + type: RatingInput! + type: mutation + kind: synchronous + permissions: + - role: anonymous custom_types: input_objects: - - name: RatingInput - fields: - - name: user - type: String! - - name: producer - type: String! + - name: RatingInput + fields: + - name: user + type: String! + - name: producer + type: String! objects: - - name: RatingOutput - fields: - - name: message - type: String! - - name: uniq_rating - type: String - - name: user - type: String - - name: bp - type: String - - name: ratings - type: jsonb - - name: deleteUserRateOutput - fields: - - name: message - type: String! + - name: RatingOutput + fields: + - name: message + type: String! + - name: uniq_rating + type: String + - name: user + type: String + - name: bp + type: String + - name: ratings + type: jsonb + - name: deleteUserRateOutput + fields: + - name: message + type: String! From 54aa2b578ec027cf6126d657f28fef92df2ffc86 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Tue, 20 Apr 2021 19:53:47 -0600 Subject: [PATCH 04/21] Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars --- .../workflows/push-master-environment.yaml | 2 +- .../workflows/push-staging-environment.yaml | 2 +- docker-compose.staging.yml | 4 +- docker-compose.yml | 4 +- kubernetes/configmaps.yaml | 1 + kubernetes/cronjob.yaml | 50 +++++++++---------- .../models/BlockProducer/blockProducers.js | 3 ++ .../block-producers/block-producer-rate.js | 1 + services/hapi/src/index.js | 2 +- 9 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index 45a96451..c93de1b4 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -71,7 +71,7 @@ jobs: DB_SCHEMA: ${{ secrets.DB_SCHEMA }} EOS_API_ENDPOINT: https://bp.cryptolions.io VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: "3005" + VIRTUAL_PORT: "9090" # hasura HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }} HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index 0f136465..ef707a55 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -71,7 +71,7 @@ jobs: DB_SCHEMA: ${{ secrets.DB_SCHEMA }} EOS_API_ENDPOINT: https://jungle3.cryptolions.io VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: "3005" + VIRTUAL_PORT: "9090" # hasura HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }} HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index a00bc736..7fa3e69a 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -36,10 +36,10 @@ services: - ./services/hapi:/opt/application - /opt/application/node_modules ports: - - "3005:3005" + - "3005:9090" environment: VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: 3005 + VIRTUAL_PORT: 9090 DB_USER: user DB_PASSWORD: pass DB_PORT: 5432 diff --git a/docker-compose.yml b/docker-compose.yml index b11a9bd8..3d23c4ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,10 +36,10 @@ services: - ./services/hapi:/opt/application - /opt/application/node_modules # prevents host/container conflicts ports: - - "3005:3005" + - "3005:9090" environment: VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: 3005 + VIRTUAL_PORT: 9090 DB_USER: user DB_PASSWORD: pass DB_PORT: 5432 diff --git a/kubernetes/configmaps.yaml b/kubernetes/configmaps.yaml index 813ae412..d53bf111 100644 --- a/kubernetes/configmaps.yaml +++ b/kubernetes/configmaps.yaml @@ -38,6 +38,7 @@ data: HASURA_GRAPHQL_MIGRATIONS_DIR: "${HASURA_GRAPHQL_MIGRATIONS_DIR}" HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}" HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}" + HASURA_GRAPHQL_ACTION_BASE_URL: "${HASURA_GRAPHQL_ACTION_BASE_URL}" --- apiVersion: v1 kind: ConfigMap diff --git a/kubernetes/cronjob.yaml b/kubernetes/cronjob.yaml index 5dac17e4..14c6c7b1 100644 --- a/kubernetes/cronjob.yaml +++ b/kubernetes/cronjob.yaml @@ -9,29 +9,29 @@ spec: template: spec: containers: - - name: hapi-cronjob - image: ${DOCKER_REGISTRY}/${IMAGE_NAME_HAPI}:${VERSION} - args: - - /bin/sh - - -c - - /usr/bin/node /opt/application/src/libs/sync-bps.js; /usr/bin/node /opt/application/src/libs/sync-proxies.js - env: - - name: DB_HOST - value: postgres - - name: DB_NAME - value: eosrate - - name: DB_PASSWORD - value: pass - - name: DB_PORT - value: "5432" - - name: DB_SCHEMA - value: public - - name: DB_USER - value: user - - name: EOS_API_ENDPOINT - value: https://bp.cryptolions.io - - name: VIRTUAL_HOST - value: 0.0.0.0 - - name: VIRTUAL_PORT - value: "3005" + - name: hapi-cronjob + image: ${DOCKER_REGISTRY}/${IMAGE_NAME_HAPI}:${VERSION} + args: + - /bin/sh + - -c + - /usr/bin/node /opt/application/src/libs/sync-bps.js; /usr/bin/node /opt/application/src/libs/sync-proxies.js + env: + - name: DB_HOST + value: postgres + - name: DB_NAME + value: eosrate + - name: DB_PASSWORD + value: pass + - name: DB_PORT + value: "5432" + - name: DB_SCHEMA + value: public + - name: DB_USER + value: user + - name: EOS_API_ENDPOINT + value: https://bp.cryptolions.io + - name: VIRTUAL_HOST + value: 0.0.0.0 + - name: VIRTUAL_PORT + value: "9090" restartPolicy: Never diff --git a/services/frontend/src/models/BlockProducer/blockProducers.js b/services/frontend/src/models/BlockProducer/blockProducers.js index b7838206..b07a8eff 100644 --- a/services/frontend/src/models/BlockProducer/blockProducers.js +++ b/services/frontend/src/models/BlockProducer/blockProducers.js @@ -184,6 +184,7 @@ const Proxies = { try { dispatch.isLoading.storeIsContentLoading(true) + console.log(bp) const { data: { rateProducer } } = await apolloClient.mutate({ @@ -193,6 +194,7 @@ const Proxies = { mutation: MUTATION_UPDATE_RATING }) + console.log('after mutation') const rpc = getRpc(ual) const { rows: rateStat } = await rpc.get_table_rows({ @@ -247,6 +249,7 @@ const Proxies = { }) dispatch.isLoading.storeIsContentLoading(false) } catch (error) { + console.log('||||||||||||||||||||||||||||||||') console.error('mutationInsertUserRating', error) dispatch.isLoading.storeIsContentLoading(false) } diff --git a/services/frontend/src/routes/block-producers/block-producer-rate.js b/services/frontend/src/routes/block-producers/block-producer-rate.js index c8686cc2..b1539754 100644 --- a/services/frontend/src/routes/block-producers/block-producer-rate.js +++ b/services/frontend/src/routes/block-producers/block-producer-rate.js @@ -186,6 +186,7 @@ const BlockProducerRate = ({ account, ual }) => { broadcast: true }) + console.log('before mutation') await dispatch.blockProducers.mutationInsertUserRating({ ual, user: accountName, diff --git a/services/hapi/src/index.js b/services/hapi/src/index.js index a1fed60f..422ee614 100644 --- a/services/hapi/src/index.js +++ b/services/hapi/src/index.js @@ -9,7 +9,7 @@ const Hapi = require('@hapi/hapi') const init = async () => { const server = Hapi.server({ - port: VIRTUAL_PORT || 3005, + port: VIRTUAL_PORT || 9090, host: VIRTUAL_HOST || '0.0.0.0' }) From dd7578ddb52babfffc8419ea96193d4dbca29383 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Tue, 20 Apr 2021 20:10:08 -0600 Subject: [PATCH 05/21] fix: update some env vars --- services/frontend/src/models/BlockProducer/blockProducers.js | 3 --- .../frontend/src/routes/block-producers/block-producer-rate.js | 1 - 2 files changed, 4 deletions(-) diff --git a/services/frontend/src/models/BlockProducer/blockProducers.js b/services/frontend/src/models/BlockProducer/blockProducers.js index b07a8eff..b7838206 100644 --- a/services/frontend/src/models/BlockProducer/blockProducers.js +++ b/services/frontend/src/models/BlockProducer/blockProducers.js @@ -184,7 +184,6 @@ const Proxies = { try { dispatch.isLoading.storeIsContentLoading(true) - console.log(bp) const { data: { rateProducer } } = await apolloClient.mutate({ @@ -194,7 +193,6 @@ const Proxies = { mutation: MUTATION_UPDATE_RATING }) - console.log('after mutation') const rpc = getRpc(ual) const { rows: rateStat } = await rpc.get_table_rows({ @@ -249,7 +247,6 @@ const Proxies = { }) dispatch.isLoading.storeIsContentLoading(false) } catch (error) { - console.log('||||||||||||||||||||||||||||||||') console.error('mutationInsertUserRating', error) dispatch.isLoading.storeIsContentLoading(false) } diff --git a/services/frontend/src/routes/block-producers/block-producer-rate.js b/services/frontend/src/routes/block-producers/block-producer-rate.js index b1539754..c8686cc2 100644 --- a/services/frontend/src/routes/block-producers/block-producer-rate.js +++ b/services/frontend/src/routes/block-producers/block-producer-rate.js @@ -186,7 +186,6 @@ const BlockProducerRate = ({ account, ual }) => { broadcast: true }) - console.log('before mutation') await dispatch.blockProducers.mutationInsertUserRating({ ual, user: accountName, From 3ce333770bdc8bbd73ec97cc7a00bd6722266738 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 21 Apr 2021 09:33:02 -0600 Subject: [PATCH 06/21] fix: replace .env values with the previous ones --- services/frontend/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/frontend/.env b/services/frontend/.env index 0c586aa5..e099e17c 100644 --- a/services/frontend/.env +++ b/services/frontend/.env @@ -1,6 +1,6 @@ -REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8088/v1/graphql +REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1/graphql REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://localhost:8088/v1/graphql +REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql REACT_APP_EOS_API_URL=https://jungle.eosio.cr REACT_APP_EOS_API_HOST=jungle.eosio.cr REACT_APP_EOS_API_PORT=443 From ddc8ec36dfcc5cb9cabb2d593a3203218751dd39 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Sun, 25 Apr 2021 18:33:58 -0600 Subject: [PATCH 07/21] Feat/add tx link (#545) * feat: add tx link * feat: remove secrets --- scripts/fresh.sh | 3 +- services/frontend/.env | 3 +- services/frontend/src/config/index.js | 3 +- .../block-producers/block-producer-rate.js | 95 +++++++++++-------- .../src/routes/block-producers/styles.js | 19 +++- 5 files changed, 78 insertions(+), 45 deletions(-) diff --git a/scripts/fresh.sh b/scripts/fresh.sh index 0ca3e77d..e1eb681a 100755 --- a/scripts/fresh.sh +++ b/scripts/fresh.sh @@ -1,6 +1,7 @@ #!/bin/bash echo "Seeding Database and Syncing with Blockchain Tables" -cd ../services/hapi/src/libs/ +cd services/hapi/src/libs/ +pwd node sync-bps.js node sync-proxies.js node sync-ratings.js diff --git a/services/frontend/.env b/services/frontend/.env index e099e17c..a68d2899 100644 --- a/services/frontend/.env +++ b/services/frontend/.env @@ -5,4 +5,5 @@ REACT_APP_EOS_API_URL=https://jungle.eosio.cr REACT_APP_EOS_API_HOST=jungle.eosio.cr REACT_APP_EOS_API_PORT=443 REACT_APP_EOS_API_PROTOCOL=https -REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 \ No newline at end of file +REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 +REACT_APP_BLOCK_EXPLORER=https://jungle3.bloks.io \ No newline at end of file diff --git a/services/frontend/src/config/index.js b/services/frontend/src/config/index.js index 93be0477..d75d360f 100644 --- a/services/frontend/src/config/index.js +++ b/services/frontend/src/config/index.js @@ -5,7 +5,8 @@ const config = { eosApiPort: process.env.REACT_APP_EOS_API_PORT, eosApiProtocol: process.env.REACT_APP_EOS_API_PROTOCOL, eosApiUri: `${process.env.REACT_APP_EOS_API_PROTOCOL}://${process.env.REACT_APP_EOS_API_HOST}:${process.env.REACT_APP_EOS_API_PORT}`, - eosChainId: process.env.REACT_APP_EOS_CHAIN_ID + eosChainId: process.env.REACT_APP_EOS_CHAIN_ID, + blockExplorer: process.env.REACT_APP_BLOCK_EXPLORER } export default config diff --git a/services/frontend/src/routes/block-producers/block-producer-rate.js b/services/frontend/src/routes/block-producers/block-producer-rate.js index c8686cc2..aefdca7a 100644 --- a/services/frontend/src/routes/block-producers/block-producer-rate.js +++ b/services/frontend/src/routes/block-producers/block-producer-rate.js @@ -7,19 +7,21 @@ import { Link } from '@reach/router' import { Avatar, Button, + IconButton, Chip, Grid, Paper, CircularProgress, - Typography + Typography, + Link as MLink } from '@material-ui/core' import AccountCircle from '@material-ui/icons/AccountCircle' -import CheckCircle from '@material-ui/icons/CheckCircle' +import Close from '@material-ui/icons/Close' import Error from '@material-ui/icons/Error' import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft' import _get from 'lodash.get' import classNames from 'classnames' -import Alert from '@material-ui/lab/Alert' +import { Alert } from '@material-ui/lab' import { makeStyles } from '@material-ui/core/styles' import TitlePage from 'components/title-page' @@ -59,6 +61,7 @@ const BlockProducerRate = ({ account, ual }) => { const classes = useStyles() const accountName = _get(ual, 'activeUser.accountName', null) const bpData = _get(producer, 'data', {}) + const [lastTransactionId, setLastTransactionId] = useState(undefined) const handleStateChange = (parameter) => (event, value) => { setRatingState({ ...ratingState, [parameter]: value }) @@ -186,6 +189,8 @@ const BlockProducerRate = ({ account, ual }) => { broadcast: true }) + setLastTransactionId(result.transactionId) + await dispatch.blockProducers.mutationInsertUserRating({ ual, user: accountName, @@ -199,13 +204,6 @@ const BlockProducerRate = ({ account, ual }) => { processing: false, txSuccess: true }) - - setTimeout(() => { - setRatingState({ - ...ratingState, - txSuccess: false - }) - }, 2000) } catch (err) { setRatingState({ ...ratingState, @@ -332,21 +330,6 @@ const BlockProducerRate = ({ account, ual }) => { variant='outlined' /> )} - {ratingState.txSuccess && ( - - - - } - color='secondary' - label='Success!' - variant='outlined' - /> - )} - {ratingState.processing && ( - - )} + + + + + )} {showAlert && ( - - {t('infoMessage')} - + + + {t('infoMessage')} + + )} diff --git a/services/frontend/src/routes/block-producers/styles.js b/services/frontend/src/routes/block-producers/styles.js index 49f61486..ed1d93f4 100644 --- a/services/frontend/src/routes/block-producers/styles.js +++ b/services/frontend/src/routes/block-producers/styles.js @@ -138,7 +138,24 @@ export default (theme) => ({ }, alert: { width: '100%', - marginTop: theme.spacing(1) + marginTop: theme.spacing(1), + '& > div.MuiAlert-message': { + width: '100%' + } + }, + alertBody: { + width: '100%' + }, + alertActionsContainer: { + maxWidth: '60%' + }, + closeIconButton: { + padding: 0, + verticalAlign: 'middle', + color: 'red' + }, + detailsIconButton: { + padding: '0 10px' }, // bp profile bpAccountCircle: { From 4ac665c1d16b48806fd1bf36f194d63a827e2505 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 5 May 2021 11:45:28 -0600 Subject: [PATCH 08/21] setup env workflow (#546) * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal --- .../workflows/push-master-environment.yaml | 2 +- .../workflows/push-staging-environment.yaml | 4 +- .gitignore | 5 +- docker-compose.staging.yml | 26 ++++---- docker-compose.yml | 54 +++++++-------- makefile | 66 +++++++++++++++---- scripts/develop.sh | 13 ---- scripts/flush.sh | 3 - scripts/hasura.sh | 4 -- scripts/start.sh | 3 - scripts/stop.sh | 5 -- services/frontend/.env.production | 8 --- services/frontend/.env.staging | 8 --- services/frontend/Dockerfile | 16 +++++ services/frontend/makefile | 13 +++- services/frontend/package.json | 7 +- services/frontend/src/services/api.js | 8 ++- services/hapi/makefile | 6 +- services/hapi/src/index.js | 4 +- services/hasura/Dockerfile | 4 +- 20 files changed, 140 insertions(+), 119 deletions(-) delete mode 100755 scripts/develop.sh delete mode 100755 scripts/flush.sh delete mode 100755 scripts/hasura.sh delete mode 100755 scripts/start.sh delete mode 100755 scripts/stop.sh delete mode 100644 services/frontend/.env.production delete mode 100644 services/frontend/.env.staging diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index c93de1b4..e9c9fa09 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -71,7 +71,7 @@ jobs: DB_SCHEMA: ${{ secrets.DB_SCHEMA }} EOS_API_ENDPOINT: https://bp.cryptolions.io VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: "9090" + VIRTUAL_PORT: 9090 # hasura HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }} HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index ef707a55..a3e50725 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -71,7 +71,7 @@ jobs: DB_SCHEMA: ${{ secrets.DB_SCHEMA }} EOS_API_ENDPOINT: https://jungle3.cryptolions.io VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: "9090" + VIRTUAL_PORT: 9090 # hasura HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }} HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations @@ -88,4 +88,4 @@ jobs: NAMESPACE: jungle-eosrate 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/.gitignore b/.gitignore index 12d57bd9..b2c773f1 100644 --- a/.gitignore +++ b/.gitignore @@ -23,11 +23,14 @@ temp .eslintcache # database data -.dbdata/ +db_data # wallet keys keys +# env files +.env* + # netlify cli .netlify/ diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 7fa3e69a..bfb48358 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -38,15 +38,15 @@ services: ports: - "3005:9090" environment: - VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: 9090 - DB_USER: user - DB_PASSWORD: pass - DB_PORT: 5432 - DB_NAME: eosrate + VIRTUAL_HOST: "${VIRTUAL_HOST}" + VIRTUAL_PORT: "${VIRTUAL_PORT}" + DB_USER: "${DB_USER}" + DB_PASSWORD: "${DB_PASSWORD}" + DB_PORT: "${DB_PORT}" + DB_NAME: "${DB_NAME}" DB_HOST: postgres DB_SCHEMA: public - EOS_API_ENDPOINT: "https://jungle.eosio.cr" + EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}" depends_on: - postgres @@ -64,14 +64,14 @@ services: - postgres - hasura environment: - DB_USER: user - DB_PASSWORD: pass - DB_PORT: 5432 - DB_NAME: eosrate + DB_USER: "${DB_USER}" + DB_PASSWORD: "${DB_PASSWORD}" + DB_PORT: "${DB_PORT}" + DB_NAME: "${DB_NAME}" DB_HOST: postgres DB_SCHEMA: public - EOS_API_ENDPOINT: "https://jungle.eosio.cr" - WAIT_HOSTS: postgres:5432, hasura:8080 + EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}" + WAIT_HOSTS: postgres:"${DB_PORT}" , hasura:8080 WAIT_HOSTS_TIMEOUT: 60 ports: - "3030:3030" diff --git a/docker-compose.yml b/docker-compose.yml index 3d23c4ef..902ccdc0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: container_name: eosrate_postgres image: postgres:10.4 volumes: - - eosrate-postgres:/var/lib/postgresql/data + - ${POSTGRES_DATA}:/var/lib/postgresql/data ports: - "5432:5432" environment: @@ -36,17 +36,17 @@ services: - ./services/hapi:/opt/application - /opt/application/node_modules # prevents host/container conflicts ports: - - "3005:9090" + - "9090:9090" environment: - VIRTUAL_HOST: 0.0.0.0 - VIRTUAL_PORT: 9090 - DB_USER: user - DB_PASSWORD: pass - DB_PORT: 5432 - DB_NAME: eosrate + VIRTUAL_HOST: "${VIRTUAL_HOST}" + VIRTUAL_PORT: "${VIRTUAL_PORT}" + DB_USER: "${DB_USER}" + DB_PASSWORD: "${DB_PASSWORD}" + DB_PORT: "${DB_PORT}" + DB_NAME: "${DB_NAME}" DB_HOST: postgres DB_SCHEMA: public - EOS_API_ENDPOINT: "https://jungle.eosio.cr" + EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}" depends_on: - postgres @@ -64,14 +64,14 @@ services: - postgres - hasura environment: - DB_USER: user - DB_PASSWORD: pass - DB_PORT: 5432 - DB_NAME: eosrate + DB_USER: "${DB_USER}" + DB_PASSWORD: "${DB_PASSWORD}" + DB_PORT: "${DB_PORT}" + DB_NAME: "${DB_NAME}" DB_HOST: postgres DB_SCHEMA: public - EOS_API_ENDPOINT: "https://jungle.eosio.cr" - WAIT_HOSTS: postgres:5432, hasura:8080 + EOS_API_ENDPOINT: "${EOS_API_ENDPOINT}" + WAIT_HOSTS: postgres:"${DB_PORT}", hasura:8080 WAIT_HOSTS_TIMEOUT: 60 ports: - "3030:3030" @@ -85,21 +85,19 @@ services: dockerfile: ./Dockerfile image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations ports: - - "8088:8080" + - "8080:8080" depends_on: - postgres restart: always environment: - HASURA_GRAPHQL_DATABASE_URL: postgres://user:pass@postgres:5432/eosrate?sslmode=disable + HASURA_GRAPHQL_DATABASE_URL: "${HASURA_GRAPHQL_DATABASE_URL}" HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090 + HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}" + HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}" volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder - command: - - graphql-engine - - serve - - --enable-console frontend: container_name: eosrate_frontend @@ -113,11 +111,13 @@ services: - hapi ports: - "80:80" + environment: + REACT_APP_GRAPHQL_HTTP_URL: "${REACT_APP_GRAPHQL_HTTP_URL}" + REACT_APP_GRAPHQL_WS_URL: "${REACT_APP_GRAPHQL_WS_URL}" + REACT_APP_EOS_API_URL: "${REACT_APP_EOS_API_URL}" + REACT_APP_EOS_API_HOST: "${REACT_APP_EOS_API_HOST}" + REACT_APP_EOS_API_PORT: "${REACT_APP_EOS_API_PORT}" + REACT_APP_EOS_API_PROTOCOL: "${REACT_APP_EOS_API_PROTOCOL}" + REACT_APP_EOS_CHAIN_ID: "${REACT_APP_EOS_CHAIN_ID}" networks: default: - -volumes: - eosrate-postgres: - -networks: - default: diff --git a/makefile b/makefile index 78ee7997..db19dd2b 100644 --- a/makefile +++ b/makefile @@ -1,25 +1,67 @@ include utils/meta.mk +#COLORS +WHITE := $(shell tput -Txterm setaf 7) +BLUE := $(shell tput -Txterm setaf 6) +YELLOW := $(shell tput -Txterm setaf 3) +GREEN := $(shell tput -Txterm setaf 2) +RESET := $(shell tput -Txterm sgr0) + K8S_BUILD_DIR ?= ./build_k8s K8S_FILES := $(shell find ./kubernetes -name '*.yaml' | sed 's:./kubernetes/::g') -dev: scripts/develop.sh - ./scripts/develop.sh +stop: + @docker-compose stop -start: scripts/start.sh - ./scripts/start.sh +fresh: scripts/fresh.sh + ./scripts/fresh.sh -stop: scripts/stop.sh - ./scripts/stop.sh +start: + make start-postgres + make start-hapi + make start-hasura + make -j 3 start-hasura-cli start-logs start-frontend -flush: scripts/flush.sh - ./scripts/flush.sh +start-postgres: + @docker-compose up -d --build postgres -fresh: scripts/fresh.sh - ./scripts/fresh.sh +start-hapi: + @docker-compose up -d --build hapi + +start-hasura: + $(eval -include .env) + @until \ + docker-compose exec -T postgres pg_isready; \ + do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for postgres service"; \ + sleep 5; done; + @until \ + curl http://localhost:9090; \ + do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for hapi service"; \ + sleep 5; done; + @echo "..." + @docker-compose stop hasura + @docker-compose up -d --build hasura + +start-hasura-cli: + $(eval -include .env) + @until \ + curl http://localhost:8080; \ + do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) ..."; \ + sleep 5; done; + @echo "..." + @cd services/hasura && hasura console --endpoint http://localhost:8080 --skip-update-check --no-browser; + +start-frontend: + $(eval -include .env) + @until \ + curl -s -o /dev/null -w 'hasura status %{http_code}\n' http://localhost:8080; \ + do echo "$(BLUE)$(STAGE)-$(APP_NAME)-frontend |$(RESET) waiting for hasura service"; \ + sleep 5; done; + @cd services/frontend && yarn && yarn start | cat + @echo "done frontend start" -hasura: scripts/hasura.sh - ./scripts/hasura.sh +start-logs: + @docker-compose logs -f hapi frontend migrate: scripts/migrate.sh ./scripts/migrate.sh diff --git a/scripts/develop.sh b/scripts/develop.sh deleted file mode 100755 index f8864744..00000000 --- a/scripts/develop.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -echo "Starting local development environment..." -docker-compose up -d --build postgres hasura hapi - -# wait 10s for the docker services to start -sleep 10s - -# start the reactjs client -cd services/frontend -yarn -yarn start - -cd ../.. diff --git a/scripts/flush.sh b/scripts/flush.sh deleted file mode 100755 index a353eef2..00000000 --- a/scripts/flush.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "Flushing all docker containers and volumes" -docker-compose down -v diff --git a/scripts/hasura.sh b/scripts/hasura.sh deleted file mode 100755 index f18d43d7..00000000 --- a/scripts/hasura.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Starting up hasura console" -cd ./services/hasura -hasura console diff --git a/scripts/start.sh b/scripts/start.sh deleted file mode 100755 index b986d902..00000000 --- a/scripts/start.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "Starting docker containers" -docker-compose up -d --build postgres hasura hapi frontend diff --git a/scripts/stop.sh b/scripts/stop.sh deleted file mode 100755 index 61136ac1..00000000 --- a/scripts/stop.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "Stopping all eos-rate services.." - -docker-compose down diff --git a/services/frontend/.env.production b/services/frontend/.env.production deleted file mode 100644 index 320e1fed..00000000 --- a/services/frontend/.env.production +++ /dev/null @@ -1,8 +0,0 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql.eosrate.io/v1/graphql -REACT_APP_API_URL=https://api.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql.eosrate.io/v1/graphql -REACT_APP_EOS_API_URL=https://api.eosio.cr -REACT_APP_EOS_API_HOST=api.eosio.cr -REACT_APP_EOS_API_PORT=443 -REACT_APP_EOS_API_PROTOCOL=https -REACT_APP_EOS_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 \ No newline at end of file diff --git a/services/frontend/.env.staging b/services/frontend/.env.staging deleted file mode 100644 index 2b2a98a6..00000000 --- a/services/frontend/.env.staging +++ /dev/null @@ -1,8 +0,0 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1/graphql -REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1/graphql -REACT_APP_EOS_API_URL=https://jungle.eosio.cr -REACT_APP_EOS_API_HOST=jungle.eosio.cr -REACT_APP_EOS_API_PORT=443 -REACT_APP_EOS_API_PROTOCOL=https -REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 \ No newline at end of file diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile index d7711400..c717c682 100644 --- a/services/frontend/Dockerfile +++ b/services/frontend/Dockerfile @@ -1,6 +1,22 @@ FROM node:12-slim as builder ARG branch +ARG react_app_graphql_http_url +ARG react_app_api_url +ARG react_app_graphql_ws_url +ARG react_app_eos_api_url +ARG react_app_eos_api_host +ARG react_app_eos_api_port +ARG react_app_eos_api_protocol +ARG react_app_eos_chain_id + +ENV REACT_APP_GRAPHQL_HTTP_URL $react_app_graphql_http_url +ENV REACT_APP_GRAPHQL_WS_URL $react_app_graphql_ws_url +ENV REACT_APP_EOS_API_URL $react_app_eos_api_url +ENV REACT_APP_EOS_API_HOST $react_app_eos_api_host +ENV REACT_APP_EOS_API_PORT $react_app_eos_api_port +ENV REACT_APP_EOS_API_PROTOCOL $react_app_eos_api_protocol +ENV REACT_APP_EOS_CHAIN_ID $react_app_eos_chain_id WORKDIR /usr/src/app diff --git a/services/frontend/makefile b/services/frontend/makefile index 0e22044b..de821eb7 100644 --- a/services/frontend/makefile +++ b/services/frontend/makefile @@ -4,16 +4,16 @@ LATEST_TAG ?= latest install: ##@local Install all dependencies install: - @npm install + @yarn clean-install: ##@local Reinstalls all dependencies clean-install: @rm -Rf node_modules - @npm install + @yarn run: ##@local Run the project locally (without docker) run: node_modules - @$(SHELL_EXPORT) npm run dev + @$(SHELL_EXPORT) yarn run dev build-docker: ##@devops Build the docker image build-docker: ./Dockerfile @@ -22,6 +22,13 @@ build-docker: ./Dockerfile @docker build \ -t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION) --target server \ -t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) --target server \ + --build-arg react_app_graphql_http_url="$(REACT_APP_GRAPHQL_HTTP_URL)" \ + --build-arg react_app_graphql_ws_url="$(REACT_APP_GRAPHQL_WS_URL)" \ + --build-arg react_app_eos_api_url="$(REACT_APP_EOS_API_URL)" \ + --build-arg react_app_eos_api_host="$(REACT_APP_EOS_API_HOST)" \ + --build-arg react_app_eos_api_port="$(REACT_APP_EOS_API_PORT)" \ + --build-arg react_app_eos_api_protocol="$(REACT_APP_EOS_API_PROTOCOL)" \ + --build-arg react_app_eos_chain_id="$(REACT_APP_EOS_CHAIN_ID)" \ --build-arg branch="$(BRANCH)" \ . diff --git a/services/frontend/package.json b/services/frontend/package.json index 72a6f60f..9243692a 100644 --- a/services/frontend/package.json +++ b/services/frontend/package.json @@ -9,12 +9,9 @@ "scripts": { "precommit": "pretty-quick --staged && lint-staged", "lint": "eslint .", - "start": "env-cmd -f .env react-scripts start", - "start:staging": "env-cmd -f .env.staging react-scripts start", + "start": "env-cmd -f ../../.env react-scripts start", "prod": "serve -l 9000 --single ./build", - "build": "env-cmd -f .env react-scripts build", - "build:staging": "env-cmd -f .env.staging react-scripts build", - "build:production": "env-cmd -f .env.production react-scripts build", + "build": "react-scripts build", "test": "env-cmd -f .env react-scripts test --env=jsdom", "eject": "react-scripts eject", "now": "now --public --npm && now alias", diff --git a/services/frontend/src/services/api.js b/services/frontend/src/services/api.js index e477272b..e9c1eae0 100644 --- a/services/frontend/src/services/api.js +++ b/services/frontend/src/services/api.js @@ -1,7 +1,7 @@ import qs from 'qs' import store from '../store' -const http = method => (endpoint, body, options = {}) => { +const http = (method) => (endpoint, body, options = {}) => { const token = store.getState().session ? store.getState().session.accessToken : null @@ -26,8 +26,10 @@ const http = method => (endpoint, body, options = {}) => { } } - return fetch(`${process.env.REACT_APP_API_URL}/${endpoint}`, params) - .then(response => response.json().then(payload => ({ payload, response }))) + return fetch(`${process.env.REACT_APP_EOS_API_URL}/${endpoint}`, params) + .then((response) => + response.json().then((payload) => ({ payload, response })) + ) .then(({ response, payload }) => response.ok ? payload : Promise.reject(payload) ) diff --git a/services/hapi/makefile b/services/hapi/makefile index 8564a389..9bee732c 100644 --- a/services/hapi/makefile +++ b/services/hapi/makefile @@ -4,16 +4,16 @@ LATEST_TAG ?= latest install: ##@local Install all dependencies install: - @npm install + @yarn clean-install: ##@local Reinstalls all dependencies clean-install: @rm -Rf node_modules - @npm install + @yarn run: ##@local Run the project locally (without docker) run: node_modules - @$(SHELL_EXPORT) npm run dev + @$(SHELL_EXPORT) yarn run dev build-docker: ##@devops Build the docker image build-docker: ./Dockerfile diff --git a/services/hapi/src/index.js b/services/hapi/src/index.js index 422ee614..1f9077c3 100644 --- a/services/hapi/src/index.js +++ b/services/hapi/src/index.js @@ -9,8 +9,8 @@ const Hapi = require('@hapi/hapi') const init = async () => { const server = Hapi.server({ - port: VIRTUAL_PORT || 9090, - host: VIRTUAL_HOST || '0.0.0.0' + port: VIRTUAL_PORT, + host: VIRTUAL_HOST }) server.route({ diff --git a/services/hasura/Dockerfile b/services/hasura/Dockerfile index 42c761e8..cc44eecc 100644 --- a/services/hasura/Dockerfile +++ b/services/hasura/Dockerfile @@ -17,6 +17,4 @@ COPY migrations $HASURA_GRAPHQL_MIGRATIONS_DIR CMD graphql-engine \ serve \ - --database-url $HASURA_GRAPHQL_DATABASE_URL \ - --admin-secret $HASURA_GRAPHQL_ADMIN_SECRET \ - --unauthorized-role $HASURA_GRAPHQL_UNAUTHORIZED_ROLE + --database-url $HASURA_GRAPHQL_DATABASE_URL \ No newline at end of file From 2b7bac9c88921b8e2addc8c3a9f52edb82486910 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 5 May 2021 17:37:27 -0600 Subject: [PATCH 09/21] Fix/rate action buttons not showing (#547) * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * fix: rate buttons not showing in certains densities --- services/frontend/src/routes/block-producers/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/frontend/src/routes/block-producers/styles.js b/services/frontend/src/routes/block-producers/styles.js index ed1d93f4..59b0d44a 100644 --- a/services/frontend/src/routes/block-producers/styles.js +++ b/services/frontend/src/routes/block-producers/styles.js @@ -132,7 +132,7 @@ export default (theme) => ({ showOnlyLg: { display: 'flex', - [theme.breakpoints.down('sm')]: { + [theme.breakpoints.down('xs')]: { display: 'none' } }, From 78c923f7af7f495615f1a2eebe356d986494bf22 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Sat, 8 May 2021 15:54:19 -0600 Subject: [PATCH 10/21] Fix/hasura console config (#556) * Deploy to mainnet (#544) * avoid statefulsets update errors on actions runs refs #535. (#536) * deprecate demux service. refs #538 (#540) * add handler url from env var & other minor bug fixes (#542) * Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars * fix: update some env vars * fix: replace .env values with the previous ones Co-authored-by: Andres Gomez Co-authored-by: JustinCast * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * feat: voting tool revamp * fix: remove comments * fix: add i18n entries * fix: bug fixes * fix: hasura console config Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez --- makefile | 10 +-- .../src/components/bp-chip-avatar/styles.js | 1 + .../frontend/src/components/card/index.js | 4 +- .../frontend/src/components/card/styles.js | 7 ++- .../compare-tool/compare-graph-view.js | 9 +-- .../src/components/compare-tool/index.js | 10 ++- .../src/components/compare-tool/styles.js | 12 ++-- .../src/components/main-drawer/index.js | 2 - .../frontend/src/components/radar/index.js | 1 + services/frontend/src/language/en.json | 9 ++- services/frontend/src/language/es.json | 7 +++ .../block-producers/block-producer-rate.js | 2 +- .../bottom-sheet-selected-bps.js | 27 ++++++++ .../src/routes/block-producers/index.js | 63 +++++++++++++++---- .../src/routes/block-producers/styles.js | 19 +++++- services/frontend/src/routes/proxies/index.js | 4 +- .../src/routes/proxies/proxy-profile.js | 2 +- 17 files changed, 143 insertions(+), 46 deletions(-) create mode 100644 services/frontend/src/routes/block-producers/bottom-sheet-selected-bps.js diff --git a/makefile b/makefile index db19dd2b..9bfe3e38 100644 --- a/makefile +++ b/makefile @@ -17,10 +17,10 @@ fresh: scripts/fresh.sh ./scripts/fresh.sh start: - make start-postgres - make start-hapi - make start-hasura - make -j 3 start-hasura-cli start-logs start-frontend + make -B start-postgres + make -B start-hapi + make -B start-hasura + make -B -j 3 start-hasura-cli start-logs start-frontend start-postgres: @docker-compose up -d --build postgres @@ -49,7 +49,7 @@ start-hasura-cli: do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) ..."; \ sleep 5; done; @echo "..." - @cd services/hasura && hasura console --endpoint http://localhost:8080 --skip-update-check --no-browser; + @cd services/hasura && hasura console --endpoint http://localhost:8080 --skip-update-check; start-frontend: $(eval -include .env) diff --git a/services/frontend/src/components/bp-chip-avatar/styles.js b/services/frontend/src/components/bp-chip-avatar/styles.js index 2b03b89d..9a585829 100644 --- a/services/frontend/src/components/bp-chip-avatar/styles.js +++ b/services/frontend/src/components/bp-chip-avatar/styles.js @@ -2,6 +2,7 @@ export default (props) => ({ root: { margin: 8, color: 'white', + width: 160, backgroundColor: (props) => props.color } }) diff --git a/services/frontend/src/components/card/index.js b/services/frontend/src/components/card/index.js index b7496117..0a6f3371 100644 --- a/services/frontend/src/components/card/index.js +++ b/services/frontend/src/components/card/index.js @@ -167,7 +167,7 @@ const CardData = ({ aria-label='Add to comparison' onClick={toggleSelection(!isSelected, owner)} > - {isSelected ? 'REMOVE' : buttonLabel} + {isSelected ? t('remove') : buttonLabel} {useRateButton && ( )} diff --git a/services/frontend/src/components/card/styles.js b/services/frontend/src/components/card/styles.js index 3966a0bd..0af4ffe4 100644 --- a/services/frontend/src/components/card/styles.js +++ b/services/frontend/src/components/card/styles.js @@ -1,6 +1,7 @@ export default (theme) => ({ card: { - backgroundColor: theme.palette.surface.dark + backgroundColor: theme.palette.surface.dark, + minWidth: 320 }, title: { textDecoration: 'none', @@ -32,8 +33,8 @@ export default (theme) => ({ height: '90%' }, btnRate: { - backgroundColor: theme.palette.secondary.main, - color: '#ffffff', + backgroundColor: theme.palette.primary.main, + color: 'white', '&:hover': { backgroundColor: theme.palette.secondary.dark } diff --git a/services/frontend/src/components/compare-tool/compare-graph-view.js b/services/frontend/src/components/compare-tool/compare-graph-view.js index a88a8c26..56dc66f3 100644 --- a/services/frontend/src/components/compare-tool/compare-graph-view.js +++ b/services/frontend/src/components/compare-tool/compare-graph-view.js @@ -3,8 +3,6 @@ import PropTypes from 'prop-types' import { makeStyles } from '@material-ui/core/styles' import Grid from '@material-ui/core/Grid' import CardHeader from '@material-ui/core/CardHeader' -import CloseIcon from '@material-ui/icons/HighlightOffOutlined' -import IconButton from '@material-ui/core/IconButton' import Typography from '@material-ui/core/Typography' import Avatar from '@material-ui/core/Avatar' import LockOpenIcon from '@material-ui/icons/LockOpenOutlined' @@ -135,7 +133,6 @@ const CompareGraphView = ({ isProxy, userInfo, width, - onHandleClose, ...props }) => { const { t } = useTranslation('translations') @@ -177,9 +174,6 @@ const CompareGraphView = ({ isUser={userInfo.isUser} /> - - - ) : ( @@ -86,11 +85,20 @@ const CompareTool = ({ } label={t('compareToolCollapsedSwitch')} /> + + diff --git a/services/frontend/src/routes/block-producers/bottom-sheet-selected-bps.js b/services/frontend/src/routes/block-producers/bottom-sheet-selected-bps.js new file mode 100644 index 00000000..30e26f29 --- /dev/null +++ b/services/frontend/src/routes/block-producers/bottom-sheet-selected-bps.js @@ -0,0 +1,27 @@ +import React from 'react' +import PropTypes from 'prop-types' +import Drawer from '@material-ui/core/Drawer' +import Grid from '@material-ui/core/Grid' +import IconButton from '@material-ui/core/IconButton' +import CloseIcon from '@material-ui/icons/Close' + +const SelectedBpsBottomSheet = ({ open, setOpen, children }) => { + return ( + + + setOpen(false)}> + + + + {children} + + ) +} + +SelectedBpsBottomSheet.propTypes = { + open: PropTypes.bool, + setOpen: PropTypes.func, + children: PropTypes.node +} + +export default SelectedBpsBottomSheet diff --git a/services/frontend/src/routes/block-producers/index.js b/services/frontend/src/routes/block-producers/index.js index 97b85f0a..7731686c 100644 --- a/services/frontend/src/routes/block-producers/index.js +++ b/services/frontend/src/routes/block-producers/index.js @@ -3,6 +3,8 @@ import PropTypes from 'prop-types' import { useDispatch, useSelector } from 'react-redux' import Grid from '@material-ui/core/Grid' import Button from '@material-ui/core/Button' +import Typography from '@material-ui/core/Typography' +import ThumbUpAltIcon from '@material-ui/icons/ThumbUpAlt' import { makeStyles } from '@material-ui/core/styles' import { useTranslation } from 'react-i18next' import classNames from 'classnames' @@ -15,6 +17,8 @@ import getAverageValue from 'utils/getAverageValue' import applySortBy from 'utils/sortedBy' import styles from './styles' +import SelectedBpsBottomSheet from './bottom-sheet-selected-bps' +import { useMediaQuery } from '@material-ui/core' const useStyles = makeStyles(styles) @@ -23,7 +27,12 @@ const AllBps = ({ ual }) => { const dispatch = useDispatch() const classes = useStyles() const [currentlyVisible, setCurrentlyVisible] = useState(30) + const [openVoteDrawer, setOpenVoteDrawer] = useState(false) const { data: user } = useSelector((state) => state.user) + const isDesktop = useMediaQuery('(min-width:600px)', { + defaultMatches: false + }) + const [openDesktopVotingTool, setOpenDesktopVotingTool] = useState(isDesktop) const { list: blockProducers, selected: selectedBPs, @@ -58,6 +67,7 @@ const AllBps = ({ ual }) => { const handleOnClose = () => { handleToggleCompareTool() dispatch.blockProducers.clearSelected() + setOpenDesktopVotingTool(false) } const sendVoteBps = async (BPs) => { @@ -118,6 +128,21 @@ const AllBps = ({ ual }) => { } } + const cmprTool = () => ( + sendVoteBps(selectedBPs || [])} + userInfo={user} + message={ratingState} + onHandleClose={handleOnClose} + /> + ) + useEffect(() => { const getData = async () => { !blockProducers.length && (await dispatch.blockProducers.getBPs()) @@ -140,18 +165,7 @@ const AllBps = ({ ual }) => { return (
- sendVoteBps(selectedBPs || [])} - userInfo={user} - message={ratingState} - onHandleClose={() => handleOnClose()} - /> + {isDesktop && openDesktopVotingTool && cmprTool()} {(shownList || []).map((blockProducer) => ( { ))} + {selectedBPs && selectedBPs.length > 0 && ( + + + + )} + + {cmprTool()} +
) diff --git a/services/frontend/src/routes/block-producers/styles.js b/services/frontend/src/routes/block-producers/styles.js index 59b0d44a..3a1a4a15 100644 --- a/services/frontend/src/routes/block-producers/styles.js +++ b/services/frontend/src/routes/block-producers/styles.js @@ -1,7 +1,9 @@ export default (theme) => ({ // index style root: { - position: 'relative' + position: 'relative', + maxWidth: '100%', + margin: 'auto' }, compareToggleButton: { position: 'fixed', @@ -16,7 +18,9 @@ export default (theme) => ({ color: theme.palette.primary.main }, wrapper: { - padding: theme.spacing(3) + padding: theme.spacing(1), + maxWidth: '100%', + margin: 'auto' }, compareTool: { minHeight: 340, @@ -202,6 +206,17 @@ export default (theme) => ({ margin: 0 } }, + openBottomSheetContainer: { + position: 'fixed', + bottom: 0, + zIndex: 999, + maxWidth: '100%', + '& > button': { + backgroundColor: 'black', + color: 'white', + borderRadius: '24px 0 0 0' + } + }, links: { textDecoration: 'none', color: theme.palette.secondary.main, diff --git a/services/frontend/src/routes/proxies/index.js b/services/frontend/src/routes/proxies/index.js index bb519dd9..677a103d 100644 --- a/services/frontend/src/routes/proxies/index.js +++ b/services/frontend/src/routes/proxies/index.js @@ -117,7 +117,7 @@ const AllProxies = ({ ual }) => { owner={_get(proxy, 'owner')} title={_get(proxy, 'name')} useRateButton={false} - buttonLabel='View' + buttonLabel={t('view')} pathLink='proxies' showOptions={false} /> @@ -128,7 +128,7 @@ const AllProxies = ({ ual }) => { className={classes.loadMoreButton} onClick={() => hasMore && loadMore()} > - LOAD MORE + {t('loadMore')} ) diff --git a/services/frontend/src/routes/proxies/proxy-profile.js b/services/frontend/src/routes/proxies/proxy-profile.js index 5a1da9f5..8655123e 100644 --- a/services/frontend/src/routes/proxies/proxy-profile.js +++ b/services/frontend/src/routes/proxies/proxy-profile.js @@ -242,7 +242,7 @@ const ProxyProfile = ({ account, ual, ...props }) => { variant='subtitle1' className={classNames(classes.subTitle, classes.bpName)} > - voting ... + {t('voting')} ... )} From 1bee39c36f37eb2ecc1740f29827570fa6cb40e1 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Sat, 8 May 2021 15:55:32 -0600 Subject: [PATCH 11/21] Fix/add missing i18n entries (#554) * Deploy to mainnet (#544) * avoid statefulsets update errors on actions runs refs #535. (#536) * deprecate demux service. refs #538 (#540) * add handler url from env var & other minor bug fixes (#542) * Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars * fix: update some env vars * fix: replace .env values with the previous ones Co-authored-by: Andres Gomez Co-authored-by: JustinCast * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * feat: voting tool revamp * fix: remove comments * fix: add i18n entries * fix: bug fixes Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez From 031432b02877c48d40f6b9baaa80a15f320305ca Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 12 May 2021 18:13:24 -0600 Subject: [PATCH 12/21] docs: add env example (#565) --- .env.example | 27 +++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 28 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..b9182a67 --- /dev/null +++ b/.env.example @@ -0,0 +1,27 @@ +# POSTGRES +DB_USER=userhere +DB_PASSWORD=passhere +DB_NAME=dbnamehere +DB_PORT=dbporthere +POSTGRES_DATA=./db_data + +# HAPI +VIRTUAL_HOST=virtualhosthere +VIRTUAL_PORT=virtualporthere +EOS_API_ENDPOINT=https://jungle.eosio.cr +PROXY_INFO_CONTRACT_CODE=proxyaccount +PROXY_INFO_CONTRACT_SCOPE=proxyaccount + +# HASURA +HASURA_GRAPHQL_DATABASE_URL=dburlhere +HASURA_GRAPHQL_ADMIN_SECRET=hasurasecrethere +HASURA_GRAPHQL_UNAUTHORIZED_ROLE=rolehere + +# WEBAPP +REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8080/v1/graphql +REACT_APP_GRAPHQL_WS_URL=ws://localhost:8080/v1/graphql +REACT_APP_EOS_API_URL=https://jungle.eosio.cr +REACT_APP_EOS_API_HOST=jungle.eosio.cr +REACT_APP_EOS_API_PORT=443 +REACT_APP_EOS_API_PROTOCOL=https +REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 \ No newline at end of file diff --git a/.gitignore b/.gitignore index b2c773f1..e8d56199 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ keys # env files .env* +!.env.example # netlify cli .netlify/ From d84334dcbe17c26e96bf124e53bd62e556856d32 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 12 May 2021 18:14:01 -0600 Subject: [PATCH 13/21] fix: not able to sync proxies locally (#564) --- makefile | 1 + services/hapi/src/libs/sync-proxies.js | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/makefile b/makefile index 9bfe3e38..060b6b0d 100644 --- a/makefile +++ b/makefile @@ -13,6 +13,7 @@ K8S_FILES := $(shell find ./kubernetes -name '*.yaml' | sed 's:./kubernetes/::g' stop: @docker-compose stop +## MAKE SURE YOU HAVE INITIALIZED THE PROJECT (make start) BEFORE RUN THIS fresh: scripts/fresh.sh ./scripts/fresh.sh diff --git a/services/hapi/src/libs/sync-proxies.js b/services/hapi/src/libs/sync-proxies.js index ba023eaa..b5236b11 100644 --- a/services/hapi/src/libs/sync-proxies.js +++ b/services/hapi/src/libs/sync-proxies.js @@ -6,31 +6,31 @@ const massive = require('massive') const dbConfig = require('../config/dbConfig') -const EOS_API_ENDPOINT = process.env.EOS_API_ENDPOINT || 'https://jungle.eosio.cr' +const EOS_API_ENDPOINT = + process.env.EOS_API_ENDPOINT || 'https://jungle.eosio.cr' // gets data from blockchain const getProxiesData = async () => { const db = await massive(dbConfig) const eos = new JsonRpc(EOS_API_ENDPOINT, { fetch }) - const eosApi = EosApi({ - httpEndpoint: EOS_API_ENDPOINT, - verbose: false + const eosApi = EosApi({ + httpEndpoint: EOS_API_ENDPOINT, + verbose: false }) - const {rows : proxies} = await eos.get_table_rows({ + const { rows: proxies } = await eos.get_table_rows({ json: true, - code: 'regproxyinfo', - scope: 'regproxyinfo', + code: process.env.PROXY_INFO_CONTRACT_CODE, + scope: process.env.PROXY_INFO_CONTRACT_SCOPE, table: 'proxies', limit: 1000, reverse: false, show_payer: false }) - const getProxyAccount = async (proxy,i) => { - + const getProxyAccount = async (proxy, i) => { let account = await eosApi.getAccount({ account_name: proxy.owner }) - + if (account.voter_info.is_proxy) { proxies[i].voter_info = account.voter_info try { @@ -48,7 +48,7 @@ const getProxiesData = async () => { } } else { //proxies.splice(i, 1) - console.log(proxies[i].owner + " is not a proxy") + console.log(proxies[i].owner + ' is not a proxy') } } @@ -56,6 +56,4 @@ const getProxiesData = async () => { return proxies } - getProxiesData() - From 53d9ed6cee3dcb495c5da3c0be529655def81e70 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Wed, 12 May 2021 23:25:31 -0600 Subject: [PATCH 14/21] fix: update hasura version --- docker-compose.staging.yml | 3 +- docker-compose.yml | 3 +- services/hasura/Dockerfile | 2 +- services/hasura/metadata/actions.graphql | 26 ++++ services/hasura/metadata/actions.yaml | 15 +++ services/hasura/metadata/allow_list.yaml | 1 + services/hasura/metadata/functions.yaml | 1 + .../hasura/metadata/query_collections.yaml | 1 + services/hasura/metadata/remote_schemas.yaml | 1 + services/hasura/metadata/tables.yaml | 88 ++++++++++++ services/hasura/metadata/version.yaml | 1 + .../1548725474630_create_producers.up.sql | 6 + .../1548725474630_create_producers.up.yaml | 13 -- ...48730845804_create_producer_ratings.up.sql | 7 + ...8730845804_create_producer_ratings.up.yaml | 14 -- ...1548732282821_create_producers_list.up.sql | 10 ++ ...548732282821_create_producers_list.up.yaml | 17 --- .../1580686687967_add_ratings_table/up.sql | 2 + .../1580686687967_add_ratings_table/up.yaml | 11 -- .../down.sql | 3 + .../down.yaml | 6 - .../up.sql | 3 + .../up.yaml | 6 - .../down.sql | 3 + .../down.yaml | 6 - .../up.sql | 3 + .../up.yaml | 6 - .../1580754206808_add_extra_data/up.sql | 4 + .../1580754206808_add_extra_data/up.yaml | 7 - .../down.sql | 2 + .../down.yaml | 3 - .../up.sql | 2 + .../up.yaml | 3 - .../up.sql | 15 +++ .../up.yaml | 10 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 6 - .../down.sql | 5 + .../down.yaml | 11 -- .../up.sql | 5 + .../up.yaml | 11 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.yaml | 9 -- .../up.yaml | 35 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../up.sql | 16 +++ .../up.yaml | 11 -- .../up.sql | 17 +++ .../up.yaml | 12 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 12 -- .../down.yaml | 37 ----- .../up.yaml | 37 ----- .../down.yaml | 6 - .../up.yaml | 25 ---- .../down.yaml | 6 - .../up.yaml | 24 ---- .../down.yaml | 6 - .../up.yaml | 22 --- .../down.yaml | 6 - .../up.yaml | 17 --- .../1587692968903_save_action_perm/down.yaml | 4 - .../1587692968903_save_action_perm/up.yaml | 7 - .../down.yaml | 6 - .../up.yaml | 9 -- .../down.yaml | 45 ------- .../up.yaml | 54 -------- .../down.yaml | 58 -------- .../up.yaml | 57 -------- services/hasura/migrations/metadata.yaml | 127 ------------------ 94 files changed, 262 insertions(+), 1170 deletions(-) create mode 100644 services/hasura/metadata/actions.graphql create mode 100644 services/hasura/metadata/actions.yaml create mode 100644 services/hasura/metadata/allow_list.yaml create mode 100644 services/hasura/metadata/functions.yaml create mode 100644 services/hasura/metadata/query_collections.yaml create mode 100644 services/hasura/metadata/remote_schemas.yaml create mode 100644 services/hasura/metadata/tables.yaml create mode 100644 services/hasura/metadata/version.yaml create mode 100755 services/hasura/migrations/1548725474630_create_producers.up.sql delete mode 100644 services/hasura/migrations/1548725474630_create_producers.up.yaml create mode 100755 services/hasura/migrations/1548730845804_create_producer_ratings.up.sql delete mode 100644 services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml create mode 100755 services/hasura/migrations/1548732282821_create_producers_list.up.sql delete mode 100644 services/hasura/migrations/1548732282821_create_producers_list.up.yaml create mode 100755 services/hasura/migrations/1580686687967_add_ratings_table/up.sql delete mode 100644 services/hasura/migrations/1580686687967_add_ratings_table/up.yaml create mode 100755 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql delete mode 100644 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml create mode 100755 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql delete mode 100644 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml create mode 100755 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql delete mode 100644 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml create mode 100755 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql delete mode 100644 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml create mode 100755 services/hasura/migrations/1580754206808_add_extra_data/up.sql delete mode 100644 services/hasura/migrations/1580754206808_add_extra_data/up.yaml create mode 100755 services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql delete mode 100644 services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml create mode 100755 services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql delete mode 100644 services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml create mode 100755 services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql delete mode 100644 services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml create mode 100755 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql delete mode 100644 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml create mode 100755 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql delete mode 100644 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml create mode 100755 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql delete mode 100644 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml create mode 100755 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql delete mode 100644 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml create mode 100755 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql delete mode 100644 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml create mode 100755 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql delete mode 100644 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml create mode 100755 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql delete mode 100644 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml create mode 100755 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql delete mode 100644 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml create mode 100755 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql delete mode 100644 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml create mode 100755 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql delete mode 100644 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml delete mode 100644 services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml create mode 100755 services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql delete mode 100644 services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml create mode 100755 services/hasura/migrations/1583953599516_add_general_info_column/up.sql delete mode 100644 services/hasura/migrations/1583953599516_add_general_info_column/up.yaml create mode 100755 services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql delete mode 100644 services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml create mode 100755 services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql delete mode 100644 services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml delete mode 100644 services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml delete mode 100644 services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml delete mode 100644 services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml delete mode 100644 services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml delete mode 100644 services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml delete mode 100644 services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml delete mode 100644 services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml delete mode 100644 services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml delete mode 100644 services/hasura/migrations/1587692968903_save_action_perm/down.yaml delete mode 100644 services/hasura/migrations/1587692968903_save_action_perm/up.yaml delete mode 100644 services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml delete mode 100644 services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml delete mode 100644 services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/metadata.yaml diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index bfb48358..107dd06a 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -80,7 +80,7 @@ services: hasura: container_name: eosrate_hasura - image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations + image: hasura/graphql-engine:v1.3.3.cli-migrations-v2 ports: - "8088:8080" depends_on: @@ -94,6 +94,7 @@ services: HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090 volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder + - ./services/hasura/migrations:/hasura-metadata command: - graphql-engine - serve diff --git a/docker-compose.yml b/docker-compose.yml index 902ccdc0..81072d84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,7 +83,7 @@ services: build: context: ./services/hasura dockerfile: ./Dockerfile - image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations + image: hasura/graphql-engine:v1.3.3.cli-migrations-v2 ports: - "8080:8080" depends_on: @@ -98,6 +98,7 @@ services: volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder + - ./services/hasura/migrations:/hasura-metadata frontend: container_name: eosrate_frontend diff --git a/services/hasura/Dockerfile b/services/hasura/Dockerfile index cc44eecc..bee5c8d7 100644 --- a/services/hasura/Dockerfile +++ b/services/hasura/Dockerfile @@ -1,4 +1,4 @@ -FROM hasura/graphql-engine:v1.2.0-beta.4.cli-migrations +FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2 ARG hasura_graphql_migrations_dir diff --git a/services/hasura/metadata/actions.graphql b/services/hasura/metadata/actions.graphql new file mode 100644 index 00000000..8c4d53f6 --- /dev/null +++ b/services/hasura/metadata/actions.graphql @@ -0,0 +1,26 @@ +type Mutation { + rateProducer ( + ratingInput: RatingInput! + ): RatingOutput +} + + + + +input RatingInput { + user : String! + producer : String! +} + +type RatingOutput { + message : String! + uniq_rating : String + user : String + bp : String + ratings : jsonb +} + +type deleteUserRateOutput { + message : String! +} + diff --git a/services/hasura/metadata/actions.yaml b/services/hasura/metadata/actions.yaml new file mode 100644 index 00000000..5c44de47 --- /dev/null +++ b/services/hasura/metadata/actions.yaml @@ -0,0 +1,15 @@ +actions: +- name: rateProducer + definition: + kind: synchronous + handler: '{{HASURA_GRAPHQL_ACTION_BASE_URL}}/ratebp' + permissions: + - role: anonymous +custom_types: + enums: [] + input_objects: + - name: RatingInput + objects: + - name: RatingOutput + - name: deleteUserRateOutput + scalars: [] diff --git a/services/hasura/metadata/allow_list.yaml b/services/hasura/metadata/allow_list.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/allow_list.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/functions.yaml b/services/hasura/metadata/functions.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/functions.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/query_collections.yaml b/services/hasura/metadata/query_collections.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/query_collections.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/remote_schemas.yaml b/services/hasura/metadata/remote_schemas.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/remote_schemas.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/tables.yaml b/services/hasura/metadata/tables.yaml new file mode 100644 index 00000000..24f0875d --- /dev/null +++ b/services/hasura/metadata/tables.yaml @@ -0,0 +1,88 @@ +- table: + schema: public + name: producers + select_permissions: + - role: anonymous + permission: + columns: + - bpjson + - general_info + - owner + - system + filter: {} +- table: + schema: public + name: producers_list + select_permissions: + - role: anonymous + permission: + columns: + - owner + - bpjson + - system + - candidate_name + - total_votes + - average + - transparency + - infrastructure + - trustiness + - community + - development + - ratings_cntr + - general_info + filter: {} +- table: + schema: public + name: proxies + select_permissions: + - role: anonymous + permission: + columns: + - owner + - name + - website + - slogan + - philosophy + - background + - logo_256 + - telegram + - steemit + - twitter + - wechat + - voter_info + filter: {} +- table: + schema: public + name: ratings_stats + select_permissions: + - role: anonymous + permission: + columns: + - bp + - ratings_cntr + - average + - transparency + - infrastructure + - trustiness + - community + - development + - created_at + - updated_at + filter: {} +- table: + schema: public + name: user_ratings + select_permissions: + - role: anonymous + permission: + columns: + - ratings + - tx_data + - bp + - uniq_rating + - user + filter: {} + delete_permissions: + - role: anonymous + permission: + filter: {} diff --git a/services/hasura/metadata/version.yaml b/services/hasura/metadata/version.yaml new file mode 100644 index 00000000..22817d2a --- /dev/null +++ b/services/hasura/metadata/version.yaml @@ -0,0 +1 @@ +version: 2 diff --git a/services/hasura/migrations/1548725474630_create_producers.up.sql b/services/hasura/migrations/1548725474630_create_producers.up.sql new file mode 100755 index 00000000..20948675 --- /dev/null +++ b/services/hasura/migrations/1548725474630_create_producers.up.sql @@ -0,0 +1,6 @@ + +CREATE TABLE producers ( + owner text PRIMARY KEY, + system jsonb NOT NULL, + bpjson jsonb NOT NULL + ); \ No newline at end of file diff --git a/services/hasura/migrations/1548725474630_create_producers.up.yaml b/services/hasura/migrations/1548725474630_create_producers.up.yaml deleted file mode 100644 index e1fb3bb9..00000000 --- a/services/hasura/migrations/1548725474630_create_producers.up.yaml +++ /dev/null @@ -1,13 +0,0 @@ -- args: - cascade: true - sql: |- - CREATE TABLE producers ( - owner text PRIMARY KEY, - system jsonb NOT NULL, - bpjson jsonb NOT NULL - ); - type: run_sql -- args: - name: producers - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql b/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql new file mode 100755 index 00000000..822b1f49 --- /dev/null +++ b/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql @@ -0,0 +1,7 @@ + + CREATE TABLE producer_ratings ( + account text NOT NULL, + bp text NOT NULL, + ratings jsonb NOT NULL, + PRIMARY KEY(account, bp) + ); \ No newline at end of file diff --git a/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml b/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml deleted file mode 100644 index a075ea45..00000000 --- a/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- args: - cascade: true - sql: |2- - CREATE TABLE producer_ratings ( - account text NOT NULL, - bp text NOT NULL, - ratings jsonb NOT NULL, - PRIMARY KEY(account, bp) - ); - type: run_sql -- args: - name: producer_ratings - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1548732282821_create_producers_list.up.sql b/services/hasura/migrations/1548732282821_create_producers_list.up.sql new file mode 100755 index 00000000..3ad215ce --- /dev/null +++ b/services/hasura/migrations/1548732282821_create_producers_list.up.sql @@ -0,0 +1,10 @@ + +CREATE OR REPLACE VIEW producers_list AS + SELECT + owner, + bpjson, + system, + bpjson->'org'->>'candidate_name' AS candidate_name, + system->>'total_votes' AS total_votes + FROM + producers; \ No newline at end of file diff --git a/services/hasura/migrations/1548732282821_create_producers_list.up.yaml b/services/hasura/migrations/1548732282821_create_producers_list.up.yaml deleted file mode 100644 index 1ee86cb0..00000000 --- a/services/hasura/migrations/1548732282821_create_producers_list.up.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- args: - cascade: false - sql: |- - CREATE OR REPLACE VIEW producers_list AS - SELECT - owner, - bpjson, - system, - bpjson->'org'->>'candidate_name' AS candidate_name, - system->>'total_votes' AS total_votes - FROM - producers; - type: run_sql -- args: - name: producers_list - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1580686687967_add_ratings_table/up.sql b/services/hasura/migrations/1580686687967_add_ratings_table/up.sql new file mode 100755 index 00000000..3f986bb9 --- /dev/null +++ b/services/hasura/migrations/1580686687967_add_ratings_table/up.sql @@ -0,0 +1,2 @@ + +CREATE TABLE "public".ratings ( bp varchar(12) NOT NULL , ratings_cntr integer , average decimal , transparency decimal , infrastructure decimal , trustiness decimal , community decimal , development decimal , created_at integer , updated_at integer , CONSTRAINT pk_ratings_bp PRIMARY KEY ( bp ) ) \ No newline at end of file diff --git a/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml b/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml deleted file mode 100644 index a6a24763..00000000 --- a/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: true - sql: 'CREATE TABLE "public".ratings ( bp varchar(12) NOT NULL , ratings_cntr integer - , average decimal , transparency decimal , infrastructure decimal , trustiness - decimal , community decimal , development decimal , created_at integer , updated_at - integer , CONSTRAINT pk_ratings_bp PRIMARY KEY ( bp ) ) ' - type: run_sql -- args: - name: ratings - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql new file mode 100755 index 00000000..c5adc93c --- /dev/null +++ b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE integer; +COMMENT ON COLUMN "public"."ratings"."created_at" IS E'null' \ No newline at end of file diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml deleted file mode 100644 index f2485680..00000000 --- a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE integer; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."created_at" IS E'null' - type: run_sql diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql new file mode 100755 index 00000000..ac32c959 --- /dev/null +++ b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE int8; +COMMENT ON COLUMN "public"."ratings"."created_at" IS E'' \ No newline at end of file diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml deleted file mode 100644 index 1b7f14d4..00000000 --- a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE int8; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."created_at" IS E'' - type: run_sql diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql new file mode 100755 index 00000000..b8979dec --- /dev/null +++ b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE integer; +COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'null' \ No newline at end of file diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml deleted file mode 100644 index 95dafa86..00000000 --- a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE integer; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'null' - type: run_sql diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql new file mode 100755 index 00000000..19b78439 --- /dev/null +++ b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE int8; +COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'' \ No newline at end of file diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml deleted file mode 100644 index 848f948e..00000000 --- a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE int8; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'' - type: run_sql diff --git a/services/hasura/migrations/1580754206808_add_extra_data/up.sql b/services/hasura/migrations/1580754206808_add_extra_data/up.sql new file mode 100755 index 00000000..62cc9d8c --- /dev/null +++ b/services/hasura/migrations/1580754206808_add_extra_data/up.sql @@ -0,0 +1,4 @@ + +ALTER TABLE "public".producer_ratings ADD tx_data jsonb; +ALTER TABLE "public".producer_ratings RENAME TO user_ratings; +ALTER TABLE "public".producers ADD general_info jsonb; \ No newline at end of file diff --git a/services/hasura/migrations/1580754206808_add_extra_data/up.yaml b/services/hasura/migrations/1580754206808_add_extra_data/up.yaml deleted file mode 100644 index 2c1bde15..00000000 --- a/services/hasura/migrations/1580754206808_add_extra_data/up.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- args: - cascade: true - sql: |- - ALTER TABLE "public".producer_ratings ADD tx_data jsonb; - ALTER TABLE "public".producer_ratings RENAME TO user_ratings; - ALTER TABLE "public".producers ADD general_info jsonb; - type: run_sql diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql new file mode 100755 index 00000000..1a474a4b --- /dev/null +++ b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."ratings_stats" rename to "ratings"; \ No newline at end of file diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml deleted file mode 100644 index 116d8be9..00000000 --- a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- args: - sql: alter table "public"."ratings_stats" rename to "ratings"; - type: run_sql diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql new file mode 100755 index 00000000..c0bec4ca --- /dev/null +++ b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql @@ -0,0 +1,2 @@ + +alter table "public"."ratings" rename to "ratings_stats"; \ No newline at end of file diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml deleted file mode 100644 index d9bfd44c..00000000 --- a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- args: - sql: alter table "public"."ratings" rename to "ratings_stats"; - type: run_sql diff --git a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql new file mode 100755 index 00000000..3ae0efc7 --- /dev/null +++ b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql @@ -0,0 +1,15 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml deleted file mode 100644 index 746a6217..00000000 --- a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- args: - cascade: true - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development\n FROM (producers\n FULL JOIN ratings_stats - ON (((ratings_stats.bp)::text = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql new file mode 100755 index 00000000..15a876c7 --- /dev/null +++ b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."user_ratings" rename column "user" to "account"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml deleted file mode 100644 index 0fe6e34d..00000000 --- a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" rename column "user" to "account"; - type: run_sql diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql new file mode 100755 index 00000000..81c82994 --- /dev/null +++ b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql @@ -0,0 +1,2 @@ + +alter table "public"."user_ratings" rename column "account" to "user"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml deleted file mode 100644 index d9e94848..00000000 --- a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" rename column "account" to "user"; - type: run_sql diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql new file mode 100755 index 00000000..a4fdea7b --- /dev/null +++ b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" DROP COLUMN "uniq_rating"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml deleted file mode 100644 index f6903444..00000000 --- a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" DROP COLUMN "uniq_rating"; - type: run_sql diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql new file mode 100755 index 00000000..01d7766c --- /dev/null +++ b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ADD COLUMN "uniq_rating" text NOT NULL UNIQUE; \ No newline at end of file diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml deleted file mode 100644 index b7948cbc..00000000 --- a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ADD COLUMN "uniq_rating" text NOT NULL - UNIQUE; - type: run_sql diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql new file mode 100755 index 00000000..597dba3b --- /dev/null +++ b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql @@ -0,0 +1,5 @@ + +alter table "public"."user_ratings" drop constraint "user_ratings_pkey"; +alter table "public"."user_ratings" + add constraint "producer_ratings_pkey" + primary key ( "bp", "user" ); \ No newline at end of file diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml deleted file mode 100644 index 88ee360d..00000000 --- a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" drop constraint "user_ratings_pkey"; - type: run_sql -- args: - cascade: false - read_only: false - sql: "alter table \"public\".\"user_ratings\"\n add constraint \"producer_ratings_pkey\" - \n primary key ( \"bp\", \"user\" );" - type: run_sql diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql new file mode 100755 index 00000000..b81f0245 --- /dev/null +++ b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql @@ -0,0 +1,5 @@ + +alter table "public"."user_ratings" drop constraint "producer_ratings_pkey"; +alter table "public"."user_ratings" + add constraint "user_ratings_pkey" + primary key ( "uniq_rating" ); \ No newline at end of file diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml deleted file mode 100644 index 6f0f2252..00000000 --- a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" drop constraint "producer_ratings_pkey"; - type: run_sql -- args: - cascade: false - read_only: false - sql: "alter table \"public\".\"user_ratings\"\n add constraint \"user_ratings_pkey\" - \n primary key ( \"uniq_rating\" );" - type: run_sql diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql new file mode 100755 index 00000000..3ff7aca8 --- /dev/null +++ b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml deleted file mode 100644 index c2c0bad0..00000000 --- a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql new file mode 100755 index 00000000..de94ed49 --- /dev/null +++ b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml deleted file mode 100644 index adebfe60..00000000 --- a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql new file mode 100755 index 00000000..de94ed49 --- /dev/null +++ b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml deleted file mode 100644 index adebfe60..00000000 --- a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql new file mode 100755 index 00000000..3ff7aca8 --- /dev/null +++ b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml deleted file mode 100644 index c2c0bad0..00000000 --- a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml b/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml deleted file mode 100644 index fb7519f3..00000000 --- a/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- args: - name: rateProducer - type: drop_action -- args: - enums: [] - input_objects: [] - objects: [] - scalars: [] - type: set_custom_types diff --git a/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml b/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml deleted file mode 100644 index 1dad2b8e..00000000 --- a/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml +++ /dev/null @@ -1,35 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: arg1 - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: create_action diff --git a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 879c0250..00000000 --- a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: arg1 - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 7195b0f1..00000000 --- a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 52a9a685..00000000 --- a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index d75dc83f..00000000 --- a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://localhost:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 3931d579..00000000 --- a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://localhost:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index da760a38..00000000 --- a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 7c7c68a6..00000000 --- a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index da760a38..00000000 --- a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 7c7c68a6..00000000 --- a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 58b68d6a..00000000 --- a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql new file mode 100755 index 00000000..3f95f09f --- /dev/null +++ b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql @@ -0,0 +1,16 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml deleted file mode 100644 index f61854be..00000000 --- a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: true - read_only: false - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development,\n ratings_stats.ratings_cntr\n FROM (producers\n - \ FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1583953599516_add_general_info_column/up.sql b/services/hasura/migrations/1583953599516_add_general_info_column/up.sql new file mode 100755 index 00000000..82742e2f --- /dev/null +++ b/services/hasura/migrations/1583953599516_add_general_info_column/up.sql @@ -0,0 +1,17 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr, + producers.general_info + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml b/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml deleted file mode 100644 index 066fe0b8..00000000 --- a/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- args: - cascade: true - read_only: false - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development,\n ratings_stats.ratings_cntr,\n producers.general_info\n - \ FROM (producers\n FULL JOIN ratings_stats ON (((ratings_stats.bp)::text - = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql new file mode 100755 index 00000000..37b3e03e --- /dev/null +++ b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql @@ -0,0 +1,2 @@ + +DROP TABLE "public"."proxies"; \ No newline at end of file diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml deleted file mode 100644 index caba4db2..00000000 --- a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: DROP TABLE "public"."proxies"; - type: run_sql diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql new file mode 100755 index 00000000..3a98b6fc --- /dev/null +++ b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql @@ -0,0 +1,2 @@ + +CREATE TABLE "public"."proxies"("owner" text NOT NULL, "name" text NOT NULL, "website" text, "slogan" text, "philosophy" text, "background" text, "logo_256" text, "telegram" text, "steemit" text, "twitter" text, "wechat" text, "voter_info" jsonb NOT NULL, PRIMARY KEY ("owner") , UNIQUE ("owner"), UNIQUE ("name")); \ No newline at end of file diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml deleted file mode 100644 index 56190373..00000000 --- a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- args: - cascade: false - read_only: false - sql: CREATE TABLE "public"."proxies"("owner" text NOT NULL, "name" text NOT NULL, - "website" text, "slogan" text, "philosophy" text, "background" text, "logo_256" - text, "telegram" text, "steemit" text, "twitter" text, "wechat" text, "voter_info" - jsonb NOT NULL, PRIMARY KEY ("owner") , UNIQUE ("owner"), UNIQUE ("name")); - type: run_sql -- args: - name: proxies - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 21bb6557..00000000 --- a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index a1abc8cb..00000000 --- a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml b/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml deleted file mode 100644 index d62c1f97..00000000 --- a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: producers_list - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml b/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml deleted file mode 100644 index f1e519cf..00000000 --- a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - owner - - bpjson - - system - - candidate_name - - total_votes - - average - - transparency - - infrastructure - - trustiness - - community - - development - - ratings_cntr - - general_info - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: producers_list - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml b/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml deleted file mode 100644 index c2606de7..00000000 --- a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: proxies - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml b/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml deleted file mode 100644 index c2d974ea..00000000 --- a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - owner - - name - - website - - slogan - - philosophy - - background - - logo_256 - - telegram - - steemit - - twitter - - wechat - - voter_info - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: proxies - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml b/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml deleted file mode 100644 index b550eb82..00000000 --- a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: ratings_stats - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml b/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml deleted file mode 100644 index 2d2f43de..00000000 --- a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml +++ /dev/null @@ -1,22 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - bp - - ratings_cntr - - average - - transparency - - infrastructure - - trustiness - - community - - development - - created_at - - updated_at - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: ratings_stats - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml b/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml deleted file mode 100644 index 7e7cbd9f..00000000 --- a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: user_ratings - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml b/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml deleted file mode 100644 index ef987239..00000000 --- a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - ratings - - tx_data - - bp - - uniq_rating - - user - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: user_ratings - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692968903_save_action_perm/down.yaml b/services/hasura/migrations/1587692968903_save_action_perm/down.yaml deleted file mode 100644 index 3c7b2a9b..00000000 --- a/services/hasura/migrations/1587692968903_save_action_perm/down.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- args: - action: rateProducer - role: anonymous - type: drop_action_permission diff --git a/services/hasura/migrations/1587692968903_save_action_perm/up.yaml b/services/hasura/migrations/1587692968903_save_action_perm/up.yaml deleted file mode 100644 index bf8cd938..00000000 --- a/services/hasura/migrations/1587692968903_save_action_perm/up.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- args: - action: rateProducer - definition: - select: - filter: {} - role: anonymous - type: create_action_permission diff --git a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml b/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml deleted file mode 100644 index 817ef3bf..00000000 --- a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: user_ratings - schema: public - type: drop_delete_permission diff --git a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml b/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml deleted file mode 100644 index 0d18ba0c..00000000 --- a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- args: - permission: - backend_only: false - filter: {} - role: anonymous - table: - name: user_ratings - schema: public - type: create_delete_permission diff --git a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 2e1a545b..00000000 --- a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,45 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index ee28c6f7..00000000 --- a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,54 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - - description: null - name: uniq_rating - type: String - - description: null - name: user - type: String - - description: null - name: bp - type: String - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index f346f256..00000000 --- a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,58 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - - arguments: null - description: null - name: uniq_rating - type: String - - arguments: null - description: null - name: user - type: String - - arguments: null - description: null - name: bp - type: String - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 011268dd..00000000 --- a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,57 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - - description: null - name: uniq_rating - type: String - - description: null - name: user - type: String - - description: null - name: bp - type: String - - description: null - name: ratings - type: jsonb - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/metadata.yaml b/services/hasura/migrations/metadata.yaml deleted file mode 100644 index 7407f974..00000000 --- a/services/hasura/migrations/metadata.yaml +++ /dev/null @@ -1,127 +0,0 @@ -version: 2 -tables: - - table: - schema: public - name: producers - select_permissions: - - role: anonymous - permission: - columns: - - bpjson - - general_info - - owner - - system - filter: {} - - table: - schema: public - name: producers_list - select_permissions: - - role: anonymous - permission: - columns: - - owner - - bpjson - - system - - candidate_name - - total_votes - - average - - transparency - - infrastructure - - trustiness - - community - - development - - ratings_cntr - - general_info - filter: {} - - table: - schema: public - name: proxies - select_permissions: - - role: anonymous - permission: - columns: - - owner - - name - - website - - slogan - - philosophy - - background - - logo_256 - - telegram - - steemit - - twitter - - wechat - - voter_info - filter: {} - - table: - schema: public - name: ratings_stats - select_permissions: - - role: anonymous - permission: - columns: - - bp - - ratings_cntr - - average - - transparency - - infrastructure - - trustiness - - community - - development - - created_at - - updated_at - filter: {} - - table: - schema: public - name: user_ratings - select_permissions: - - role: anonymous - permission: - columns: - - ratings - - tx_data - - bp - - uniq_rating - - user - filter: {} - delete_permissions: - - role: anonymous - permission: - filter: {} -actions: - - name: rateProducer - definition: - handler: "{{HASURA_GRAPHQL_ACTION_BASE_URL}}/ratebp" - output_type: RatingOutput - arguments: - - name: ratingInput - type: RatingInput! - type: mutation - kind: synchronous - permissions: - - role: anonymous -custom_types: - input_objects: - - name: RatingInput - fields: - - name: user - type: String! - - name: producer - type: String! - objects: - - name: RatingOutput - fields: - - name: message - type: String! - - name: uniq_rating - type: String - - name: user - type: String - - name: bp - type: String - - name: ratings - type: jsonb - - name: deleteUserRateOutput - fields: - - name: message - type: String! From f38bdc399e3fb63f1b9922d8861aa2c16f0cc00e Mon Sep 17 00:00:00 2001 From: JustinCast Date: Thu, 13 May 2021 11:34:29 -0600 Subject: [PATCH 15/21] fix: hasura version && other minor bug fixes --- docker-compose.yml | 1 + services/frontend/.env | 9 --------- services/frontend/Dockerfile | 2 ++ services/frontend/makefile | 1 + 4 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 services/frontend/.env diff --git a/docker-compose.yml b/docker-compose.yml index 81072d84..3dfb9068 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,5 +120,6 @@ services: REACT_APP_EOS_API_PORT: "${REACT_APP_EOS_API_PORT}" REACT_APP_EOS_API_PROTOCOL: "${REACT_APP_EOS_API_PROTOCOL}" REACT_APP_EOS_CHAIN_ID: "${REACT_APP_EOS_CHAIN_ID}" + REACT_APP_BLOCK_EXPLORER: "${REACT_APP_BLOCK_EXPLORER}" networks: default: diff --git a/services/frontend/.env b/services/frontend/.env deleted file mode 100644 index a68d2899..00000000 --- a/services/frontend/.env +++ /dev/null @@ -1,9 +0,0 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1/graphql -REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql -REACT_APP_EOS_API_URL=https://jungle.eosio.cr -REACT_APP_EOS_API_HOST=jungle.eosio.cr -REACT_APP_EOS_API_PORT=443 -REACT_APP_EOS_API_PROTOCOL=https -REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 -REACT_APP_BLOCK_EXPLORER=https://jungle3.bloks.io \ No newline at end of file diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile index c717c682..be50f964 100644 --- a/services/frontend/Dockerfile +++ b/services/frontend/Dockerfile @@ -9,6 +9,7 @@ ARG react_app_eos_api_host ARG react_app_eos_api_port ARG react_app_eos_api_protocol ARG react_app_eos_chain_id +ARG react_app_block_explorer ENV REACT_APP_GRAPHQL_HTTP_URL $react_app_graphql_http_url ENV REACT_APP_GRAPHQL_WS_URL $react_app_graphql_ws_url @@ -17,6 +18,7 @@ ENV REACT_APP_EOS_API_HOST $react_app_eos_api_host ENV REACT_APP_EOS_API_PORT $react_app_eos_api_port ENV REACT_APP_EOS_API_PROTOCOL $react_app_eos_api_protocol ENV REACT_APP_EOS_CHAIN_ID $react_app_eos_chain_id +ENV REACT_APP_BLOCK_EXPLORER $react_app_block_explorer WORKDIR /usr/src/app diff --git a/services/frontend/makefile b/services/frontend/makefile index de821eb7..be2bb5d3 100644 --- a/services/frontend/makefile +++ b/services/frontend/makefile @@ -29,6 +29,7 @@ build-docker: ./Dockerfile --build-arg react_app_eos_api_port="$(REACT_APP_EOS_API_PORT)" \ --build-arg react_app_eos_api_protocol="$(REACT_APP_EOS_API_PROTOCOL)" \ --build-arg react_app_eos_chain_id="$(REACT_APP_EOS_CHAIN_ID)" \ + --build-arg REACT_APP_BLOCK_EXPLORER="$(REACT_APP_BLOCK_EXPLORER)" \ --build-arg branch="$(BRANCH)" \ . From 77e1247e60b569a47c91d577abcfcecf5aef4922 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Thu, 13 May 2021 11:43:16 -0600 Subject: [PATCH 16/21] Fix/update hasura version (#567) --- docker-compose.staging.yml | 3 +- docker-compose.yml | 4 +- services/frontend/.env | 9 -- services/frontend/Dockerfile | 2 + services/frontend/makefile | 1 + services/hasura/Dockerfile | 2 +- services/hasura/metadata/actions.graphql | 26 ++++ services/hasura/metadata/actions.yaml | 15 +++ services/hasura/metadata/allow_list.yaml | 1 + services/hasura/metadata/functions.yaml | 1 + .../hasura/metadata/query_collections.yaml | 1 + services/hasura/metadata/remote_schemas.yaml | 1 + services/hasura/metadata/tables.yaml | 88 ++++++++++++ services/hasura/metadata/version.yaml | 1 + .../1548725474630_create_producers.up.sql | 6 + .../1548725474630_create_producers.up.yaml | 13 -- ...48730845804_create_producer_ratings.up.sql | 7 + ...8730845804_create_producer_ratings.up.yaml | 14 -- ...1548732282821_create_producers_list.up.sql | 10 ++ ...548732282821_create_producers_list.up.yaml | 17 --- .../1580686687967_add_ratings_table/up.sql | 2 + .../1580686687967_add_ratings_table/up.yaml | 11 -- .../down.sql | 3 + .../down.yaml | 6 - .../up.sql | 3 + .../up.yaml | 6 - .../down.sql | 3 + .../down.yaml | 6 - .../up.sql | 3 + .../up.yaml | 6 - .../1580754206808_add_extra_data/up.sql | 4 + .../1580754206808_add_extra_data/up.yaml | 7 - .../down.sql | 2 + .../down.yaml | 3 - .../up.sql | 2 + .../up.yaml | 3 - .../up.sql | 15 +++ .../up.yaml | 10 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 6 - .../down.sql | 5 + .../down.yaml | 11 -- .../up.sql | 5 + .../up.yaml | 11 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 5 - .../down.yaml | 9 -- .../up.yaml | 35 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../down.yaml | 37 ----- .../up.yaml | 36 ----- .../up.sql | 16 +++ .../up.yaml | 11 -- .../up.sql | 17 +++ .../up.yaml | 12 -- .../down.sql | 2 + .../down.yaml | 5 - .../up.sql | 2 + .../up.yaml | 12 -- .../down.yaml | 37 ----- .../up.yaml | 37 ----- .../down.yaml | 6 - .../up.yaml | 25 ---- .../down.yaml | 6 - .../up.yaml | 24 ---- .../down.yaml | 6 - .../up.yaml | 22 --- .../down.yaml | 6 - .../up.yaml | 17 --- .../1587692968903_save_action_perm/down.yaml | 4 - .../1587692968903_save_action_perm/up.yaml | 7 - .../down.yaml | 6 - .../up.yaml | 9 -- .../down.yaml | 45 ------- .../up.yaml | 54 -------- .../down.yaml | 58 -------- .../up.yaml | 57 -------- services/hasura/migrations/metadata.yaml | 127 ------------------ 97 files changed, 266 insertions(+), 1179 deletions(-) delete mode 100644 services/frontend/.env create mode 100644 services/hasura/metadata/actions.graphql create mode 100644 services/hasura/metadata/actions.yaml create mode 100644 services/hasura/metadata/allow_list.yaml create mode 100644 services/hasura/metadata/functions.yaml create mode 100644 services/hasura/metadata/query_collections.yaml create mode 100644 services/hasura/metadata/remote_schemas.yaml create mode 100644 services/hasura/metadata/tables.yaml create mode 100644 services/hasura/metadata/version.yaml create mode 100755 services/hasura/migrations/1548725474630_create_producers.up.sql delete mode 100644 services/hasura/migrations/1548725474630_create_producers.up.yaml create mode 100755 services/hasura/migrations/1548730845804_create_producer_ratings.up.sql delete mode 100644 services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml create mode 100755 services/hasura/migrations/1548732282821_create_producers_list.up.sql delete mode 100644 services/hasura/migrations/1548732282821_create_producers_list.up.yaml create mode 100755 services/hasura/migrations/1580686687967_add_ratings_table/up.sql delete mode 100644 services/hasura/migrations/1580686687967_add_ratings_table/up.yaml create mode 100755 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql delete mode 100644 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml create mode 100755 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql delete mode 100644 services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml create mode 100755 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql delete mode 100644 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml create mode 100755 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql delete mode 100644 services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml create mode 100755 services/hasura/migrations/1580754206808_add_extra_data/up.sql delete mode 100644 services/hasura/migrations/1580754206808_add_extra_data/up.yaml create mode 100755 services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql delete mode 100644 services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml create mode 100755 services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql delete mode 100644 services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml create mode 100755 services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql delete mode 100644 services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml create mode 100755 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql delete mode 100644 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml create mode 100755 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql delete mode 100644 services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml create mode 100755 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql delete mode 100644 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml create mode 100755 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql delete mode 100644 services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml create mode 100755 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql delete mode 100644 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml create mode 100755 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql delete mode 100644 services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml create mode 100755 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql delete mode 100644 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml create mode 100755 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql delete mode 100644 services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml create mode 100755 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql delete mode 100644 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml create mode 100755 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql delete mode 100644 services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml delete mode 100644 services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml create mode 100755 services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql delete mode 100644 services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml create mode 100755 services/hasura/migrations/1583953599516_add_general_info_column/up.sql delete mode 100644 services/hasura/migrations/1583953599516_add_general_info_column/up.yaml create mode 100755 services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql delete mode 100644 services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml create mode 100755 services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql delete mode 100644 services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml delete mode 100644 services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml delete mode 100644 services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml delete mode 100644 services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml delete mode 100644 services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml delete mode 100644 services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml delete mode 100644 services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml delete mode 100644 services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml delete mode 100644 services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml delete mode 100644 services/hasura/migrations/1587692968903_save_action_perm/down.yaml delete mode 100644 services/hasura/migrations/1587692968903_save_action_perm/up.yaml delete mode 100644 services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml delete mode 100644 services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml delete mode 100644 services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml delete mode 100644 services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml delete mode 100644 services/hasura/migrations/metadata.yaml diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index bfb48358..107dd06a 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -80,7 +80,7 @@ services: hasura: container_name: eosrate_hasura - image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations + image: hasura/graphql-engine:v1.3.3.cli-migrations-v2 ports: - "8088:8080" depends_on: @@ -94,6 +94,7 @@ services: HASURA_GRAPHQL_ACTION_BASE_URL: http://hapi:9090 volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder + - ./services/hasura/migrations:/hasura-metadata command: - graphql-engine - serve diff --git a/docker-compose.yml b/docker-compose.yml index 902ccdc0..3dfb9068 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,7 +83,7 @@ services: build: context: ./services/hasura dockerfile: ./Dockerfile - image: hasura/graphql-engine:v1.2.0-beta.4.cli-migrations + image: hasura/graphql-engine:v1.3.3.cli-migrations-v2 ports: - "8080:8080" depends_on: @@ -98,6 +98,7 @@ services: volumes: - ./services/hasura/migrations:/hasura-migrations # mount hasura migrations folder + - ./services/hasura/migrations:/hasura-metadata frontend: container_name: eosrate_frontend @@ -119,5 +120,6 @@ services: REACT_APP_EOS_API_PORT: "${REACT_APP_EOS_API_PORT}" REACT_APP_EOS_API_PROTOCOL: "${REACT_APP_EOS_API_PROTOCOL}" REACT_APP_EOS_CHAIN_ID: "${REACT_APP_EOS_CHAIN_ID}" + REACT_APP_BLOCK_EXPLORER: "${REACT_APP_BLOCK_EXPLORER}" networks: default: diff --git a/services/frontend/.env b/services/frontend/.env deleted file mode 100644 index a68d2899..00000000 --- a/services/frontend/.env +++ /dev/null @@ -1,9 +0,0 @@ -REACT_APP_GRAPHQL_HTTP_URL=https://graphql-jungle.eosrate.io/v1/graphql -REACT_APP_API_URL=https://jungle.eosio.cr -REACT_APP_GRAPHQL_WS_URL=wss://graphql-jungle.eosrate.io/v1alpha1/graphql -REACT_APP_EOS_API_URL=https://jungle.eosio.cr -REACT_APP_EOS_API_HOST=jungle.eosio.cr -REACT_APP_EOS_API_PORT=443 -REACT_APP_EOS_API_PROTOCOL=https -REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 -REACT_APP_BLOCK_EXPLORER=https://jungle3.bloks.io \ No newline at end of file diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile index c717c682..be50f964 100644 --- a/services/frontend/Dockerfile +++ b/services/frontend/Dockerfile @@ -9,6 +9,7 @@ ARG react_app_eos_api_host ARG react_app_eos_api_port ARG react_app_eos_api_protocol ARG react_app_eos_chain_id +ARG react_app_block_explorer ENV REACT_APP_GRAPHQL_HTTP_URL $react_app_graphql_http_url ENV REACT_APP_GRAPHQL_WS_URL $react_app_graphql_ws_url @@ -17,6 +18,7 @@ ENV REACT_APP_EOS_API_HOST $react_app_eos_api_host ENV REACT_APP_EOS_API_PORT $react_app_eos_api_port ENV REACT_APP_EOS_API_PROTOCOL $react_app_eos_api_protocol ENV REACT_APP_EOS_CHAIN_ID $react_app_eos_chain_id +ENV REACT_APP_BLOCK_EXPLORER $react_app_block_explorer WORKDIR /usr/src/app diff --git a/services/frontend/makefile b/services/frontend/makefile index de821eb7..be2bb5d3 100644 --- a/services/frontend/makefile +++ b/services/frontend/makefile @@ -29,6 +29,7 @@ build-docker: ./Dockerfile --build-arg react_app_eos_api_port="$(REACT_APP_EOS_API_PORT)" \ --build-arg react_app_eos_api_protocol="$(REACT_APP_EOS_API_PROTOCOL)" \ --build-arg react_app_eos_chain_id="$(REACT_APP_EOS_CHAIN_ID)" \ + --build-arg REACT_APP_BLOCK_EXPLORER="$(REACT_APP_BLOCK_EXPLORER)" \ --build-arg branch="$(BRANCH)" \ . diff --git a/services/hasura/Dockerfile b/services/hasura/Dockerfile index cc44eecc..bee5c8d7 100644 --- a/services/hasura/Dockerfile +++ b/services/hasura/Dockerfile @@ -1,4 +1,4 @@ -FROM hasura/graphql-engine:v1.2.0-beta.4.cli-migrations +FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2 ARG hasura_graphql_migrations_dir diff --git a/services/hasura/metadata/actions.graphql b/services/hasura/metadata/actions.graphql new file mode 100644 index 00000000..8c4d53f6 --- /dev/null +++ b/services/hasura/metadata/actions.graphql @@ -0,0 +1,26 @@ +type Mutation { + rateProducer ( + ratingInput: RatingInput! + ): RatingOutput +} + + + + +input RatingInput { + user : String! + producer : String! +} + +type RatingOutput { + message : String! + uniq_rating : String + user : String + bp : String + ratings : jsonb +} + +type deleteUserRateOutput { + message : String! +} + diff --git a/services/hasura/metadata/actions.yaml b/services/hasura/metadata/actions.yaml new file mode 100644 index 00000000..5c44de47 --- /dev/null +++ b/services/hasura/metadata/actions.yaml @@ -0,0 +1,15 @@ +actions: +- name: rateProducer + definition: + kind: synchronous + handler: '{{HASURA_GRAPHQL_ACTION_BASE_URL}}/ratebp' + permissions: + - role: anonymous +custom_types: + enums: [] + input_objects: + - name: RatingInput + objects: + - name: RatingOutput + - name: deleteUserRateOutput + scalars: [] diff --git a/services/hasura/metadata/allow_list.yaml b/services/hasura/metadata/allow_list.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/allow_list.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/functions.yaml b/services/hasura/metadata/functions.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/functions.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/query_collections.yaml b/services/hasura/metadata/query_collections.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/query_collections.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/remote_schemas.yaml b/services/hasura/metadata/remote_schemas.yaml new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/services/hasura/metadata/remote_schemas.yaml @@ -0,0 +1 @@ +[] diff --git a/services/hasura/metadata/tables.yaml b/services/hasura/metadata/tables.yaml new file mode 100644 index 00000000..24f0875d --- /dev/null +++ b/services/hasura/metadata/tables.yaml @@ -0,0 +1,88 @@ +- table: + schema: public + name: producers + select_permissions: + - role: anonymous + permission: + columns: + - bpjson + - general_info + - owner + - system + filter: {} +- table: + schema: public + name: producers_list + select_permissions: + - role: anonymous + permission: + columns: + - owner + - bpjson + - system + - candidate_name + - total_votes + - average + - transparency + - infrastructure + - trustiness + - community + - development + - ratings_cntr + - general_info + filter: {} +- table: + schema: public + name: proxies + select_permissions: + - role: anonymous + permission: + columns: + - owner + - name + - website + - slogan + - philosophy + - background + - logo_256 + - telegram + - steemit + - twitter + - wechat + - voter_info + filter: {} +- table: + schema: public + name: ratings_stats + select_permissions: + - role: anonymous + permission: + columns: + - bp + - ratings_cntr + - average + - transparency + - infrastructure + - trustiness + - community + - development + - created_at + - updated_at + filter: {} +- table: + schema: public + name: user_ratings + select_permissions: + - role: anonymous + permission: + columns: + - ratings + - tx_data + - bp + - uniq_rating + - user + filter: {} + delete_permissions: + - role: anonymous + permission: + filter: {} diff --git a/services/hasura/metadata/version.yaml b/services/hasura/metadata/version.yaml new file mode 100644 index 00000000..22817d2a --- /dev/null +++ b/services/hasura/metadata/version.yaml @@ -0,0 +1 @@ +version: 2 diff --git a/services/hasura/migrations/1548725474630_create_producers.up.sql b/services/hasura/migrations/1548725474630_create_producers.up.sql new file mode 100755 index 00000000..20948675 --- /dev/null +++ b/services/hasura/migrations/1548725474630_create_producers.up.sql @@ -0,0 +1,6 @@ + +CREATE TABLE producers ( + owner text PRIMARY KEY, + system jsonb NOT NULL, + bpjson jsonb NOT NULL + ); \ No newline at end of file diff --git a/services/hasura/migrations/1548725474630_create_producers.up.yaml b/services/hasura/migrations/1548725474630_create_producers.up.yaml deleted file mode 100644 index e1fb3bb9..00000000 --- a/services/hasura/migrations/1548725474630_create_producers.up.yaml +++ /dev/null @@ -1,13 +0,0 @@ -- args: - cascade: true - sql: |- - CREATE TABLE producers ( - owner text PRIMARY KEY, - system jsonb NOT NULL, - bpjson jsonb NOT NULL - ); - type: run_sql -- args: - name: producers - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql b/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql new file mode 100755 index 00000000..822b1f49 --- /dev/null +++ b/services/hasura/migrations/1548730845804_create_producer_ratings.up.sql @@ -0,0 +1,7 @@ + + CREATE TABLE producer_ratings ( + account text NOT NULL, + bp text NOT NULL, + ratings jsonb NOT NULL, + PRIMARY KEY(account, bp) + ); \ No newline at end of file diff --git a/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml b/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml deleted file mode 100644 index a075ea45..00000000 --- a/services/hasura/migrations/1548730845804_create_producer_ratings.up.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- args: - cascade: true - sql: |2- - CREATE TABLE producer_ratings ( - account text NOT NULL, - bp text NOT NULL, - ratings jsonb NOT NULL, - PRIMARY KEY(account, bp) - ); - type: run_sql -- args: - name: producer_ratings - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1548732282821_create_producers_list.up.sql b/services/hasura/migrations/1548732282821_create_producers_list.up.sql new file mode 100755 index 00000000..3ad215ce --- /dev/null +++ b/services/hasura/migrations/1548732282821_create_producers_list.up.sql @@ -0,0 +1,10 @@ + +CREATE OR REPLACE VIEW producers_list AS + SELECT + owner, + bpjson, + system, + bpjson->'org'->>'candidate_name' AS candidate_name, + system->>'total_votes' AS total_votes + FROM + producers; \ No newline at end of file diff --git a/services/hasura/migrations/1548732282821_create_producers_list.up.yaml b/services/hasura/migrations/1548732282821_create_producers_list.up.yaml deleted file mode 100644 index 1ee86cb0..00000000 --- a/services/hasura/migrations/1548732282821_create_producers_list.up.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- args: - cascade: false - sql: |- - CREATE OR REPLACE VIEW producers_list AS - SELECT - owner, - bpjson, - system, - bpjson->'org'->>'candidate_name' AS candidate_name, - system->>'total_votes' AS total_votes - FROM - producers; - type: run_sql -- args: - name: producers_list - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1580686687967_add_ratings_table/up.sql b/services/hasura/migrations/1580686687967_add_ratings_table/up.sql new file mode 100755 index 00000000..3f986bb9 --- /dev/null +++ b/services/hasura/migrations/1580686687967_add_ratings_table/up.sql @@ -0,0 +1,2 @@ + +CREATE TABLE "public".ratings ( bp varchar(12) NOT NULL , ratings_cntr integer , average decimal , transparency decimal , infrastructure decimal , trustiness decimal , community decimal , development decimal , created_at integer , updated_at integer , CONSTRAINT pk_ratings_bp PRIMARY KEY ( bp ) ) \ No newline at end of file diff --git a/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml b/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml deleted file mode 100644 index a6a24763..00000000 --- a/services/hasura/migrations/1580686687967_add_ratings_table/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: true - sql: 'CREATE TABLE "public".ratings ( bp varchar(12) NOT NULL , ratings_cntr integer - , average decimal , transparency decimal , infrastructure decimal , trustiness - decimal , community decimal , development decimal , created_at integer , updated_at - integer , CONSTRAINT pk_ratings_bp PRIMARY KEY ( bp ) ) ' - type: run_sql -- args: - name: ratings - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql new file mode 100755 index 00000000..c5adc93c --- /dev/null +++ b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE integer; +COMMENT ON COLUMN "public"."ratings"."created_at" IS E'null' \ No newline at end of file diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml deleted file mode 100644 index f2485680..00000000 --- a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE integer; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."created_at" IS E'null' - type: run_sql diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql new file mode 100755 index 00000000..ac32c959 --- /dev/null +++ b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE int8; +COMMENT ON COLUMN "public"."ratings"."created_at" IS E'' \ No newline at end of file diff --git a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml b/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml deleted file mode 100644 index 1b7f14d4..00000000 --- a/services/hasura/migrations/1580688144818_alter_table_public_ratings_alter_column_created_at/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "created_at" TYPE int8; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."created_at" IS E'' - type: run_sql diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql new file mode 100755 index 00000000..b8979dec --- /dev/null +++ b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE integer; +COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'null' \ No newline at end of file diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml deleted file mode 100644 index 95dafa86..00000000 --- a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE integer; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'null' - type: run_sql diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql new file mode 100755 index 00000000..19b78439 --- /dev/null +++ b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE int8; +COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'' \ No newline at end of file diff --git a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml b/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml deleted file mode 100644 index 848f948e..00000000 --- a/services/hasura/migrations/1580688151803_alter_table_public_ratings_alter_column_updated_at/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - sql: ALTER TABLE "public"."ratings" ALTER COLUMN "updated_at" TYPE int8; - type: run_sql -- args: - sql: COMMENT ON COLUMN "public"."ratings"."updated_at" IS E'' - type: run_sql diff --git a/services/hasura/migrations/1580754206808_add_extra_data/up.sql b/services/hasura/migrations/1580754206808_add_extra_data/up.sql new file mode 100755 index 00000000..62cc9d8c --- /dev/null +++ b/services/hasura/migrations/1580754206808_add_extra_data/up.sql @@ -0,0 +1,4 @@ + +ALTER TABLE "public".producer_ratings ADD tx_data jsonb; +ALTER TABLE "public".producer_ratings RENAME TO user_ratings; +ALTER TABLE "public".producers ADD general_info jsonb; \ No newline at end of file diff --git a/services/hasura/migrations/1580754206808_add_extra_data/up.yaml b/services/hasura/migrations/1580754206808_add_extra_data/up.yaml deleted file mode 100644 index 2c1bde15..00000000 --- a/services/hasura/migrations/1580754206808_add_extra_data/up.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- args: - cascade: true - sql: |- - ALTER TABLE "public".producer_ratings ADD tx_data jsonb; - ALTER TABLE "public".producer_ratings RENAME TO user_ratings; - ALTER TABLE "public".producers ADD general_info jsonb; - type: run_sql diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql new file mode 100755 index 00000000..1a474a4b --- /dev/null +++ b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."ratings_stats" rename to "ratings"; \ No newline at end of file diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml b/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml deleted file mode 100644 index 116d8be9..00000000 --- a/services/hasura/migrations/1580754274249_rename_table_public_ratings/down.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- args: - sql: alter table "public"."ratings_stats" rename to "ratings"; - type: run_sql diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql new file mode 100755 index 00000000..c0bec4ca --- /dev/null +++ b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.sql @@ -0,0 +1,2 @@ + +alter table "public"."ratings" rename to "ratings_stats"; \ No newline at end of file diff --git a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml b/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml deleted file mode 100644 index d9bfd44c..00000000 --- a/services/hasura/migrations/1580754274249_rename_table_public_ratings/up.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- args: - sql: alter table "public"."ratings" rename to "ratings_stats"; - type: run_sql diff --git a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql new file mode 100755 index 00000000..3ae0efc7 --- /dev/null +++ b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.sql @@ -0,0 +1,15 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml b/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml deleted file mode 100644 index 746a6217..00000000 --- a/services/hasura/migrations/1581704802407_join_producer_ratings_stats/up.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- args: - cascade: true - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development\n FROM (producers\n FULL JOIN ratings_stats - ON (((ratings_stats.bp)::text = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql new file mode 100755 index 00000000..15a876c7 --- /dev/null +++ b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."user_ratings" rename column "user" to "account"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml deleted file mode 100644 index 0fe6e34d..00000000 --- a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" rename column "user" to "account"; - type: run_sql diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql new file mode 100755 index 00000000..81c82994 --- /dev/null +++ b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.sql @@ -0,0 +1,2 @@ + +alter table "public"."user_ratings" rename column "account" to "user"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml b/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml deleted file mode 100644 index d9e94848..00000000 --- a/services/hasura/migrations/1582436287385_alter_table_public_user_ratings_alter_column_account/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" rename column "account" to "user"; - type: run_sql diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql new file mode 100755 index 00000000..a4fdea7b --- /dev/null +++ b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" DROP COLUMN "uniq_rating"; \ No newline at end of file diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml deleted file mode 100644 index f6903444..00000000 --- a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" DROP COLUMN "uniq_rating"; - type: run_sql diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql new file mode 100755 index 00000000..01d7766c --- /dev/null +++ b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ADD COLUMN "uniq_rating" text NOT NULL UNIQUE; \ No newline at end of file diff --git a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml b/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml deleted file mode 100644 index b7948cbc..00000000 --- a/services/hasura/migrations/1582436803376_alter_table_public_user_ratings_add_column_uniq_rating/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ADD COLUMN "uniq_rating" text NOT NULL - UNIQUE; - type: run_sql diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql new file mode 100755 index 00000000..597dba3b --- /dev/null +++ b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.sql @@ -0,0 +1,5 @@ + +alter table "public"."user_ratings" drop constraint "user_ratings_pkey"; +alter table "public"."user_ratings" + add constraint "producer_ratings_pkey" + primary key ( "bp", "user" ); \ No newline at end of file diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml deleted file mode 100644 index 88ee360d..00000000 --- a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/down.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" drop constraint "user_ratings_pkey"; - type: run_sql -- args: - cascade: false - read_only: false - sql: "alter table \"public\".\"user_ratings\"\n add constraint \"producer_ratings_pkey\" - \n primary key ( \"bp\", \"user\" );" - type: run_sql diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql new file mode 100755 index 00000000..b81f0245 --- /dev/null +++ b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.sql @@ -0,0 +1,5 @@ + +alter table "public"."user_ratings" drop constraint "producer_ratings_pkey"; +alter table "public"."user_ratings" + add constraint "user_ratings_pkey" + primary key ( "uniq_rating" ); \ No newline at end of file diff --git a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml b/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml deleted file mode 100644 index 6f0f2252..00000000 --- a/services/hasura/migrations/1582436829131_modify_primarykey_public_user_ratings/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: false - read_only: false - sql: alter table "public"."user_ratings" drop constraint "producer_ratings_pkey"; - type: run_sql -- args: - cascade: false - read_only: false - sql: "alter table \"public\".\"user_ratings\"\n add constraint \"user_ratings_pkey\" - \n primary key ( \"uniq_rating\" );" - type: run_sql diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql new file mode 100755 index 00000000..3ff7aca8 --- /dev/null +++ b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml deleted file mode 100644 index c2c0bad0..00000000 --- a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql new file mode 100755 index 00000000..de94ed49 --- /dev/null +++ b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml b/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml deleted file mode 100644 index adebfe60..00000000 --- a/services/hasura/migrations/1582436863355_alter_table_public_user_ratings_alter_column_ratings/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql new file mode 100755 index 00000000..de94ed49 --- /dev/null +++ b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml deleted file mode 100644 index adebfe60..00000000 --- a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" DROP NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql new file mode 100755 index 00000000..3ff7aca8 --- /dev/null +++ b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; \ No newline at end of file diff --git a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml b/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml deleted file mode 100644 index c2c0bad0..00000000 --- a/services/hasura/migrations/1582437040531_alter_table_public_user_ratings_alter_column_ratings/up.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: ALTER TABLE "public"."user_ratings" ALTER COLUMN "ratings" SET NOT NULL; - type: run_sql diff --git a/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml b/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml deleted file mode 100644 index fb7519f3..00000000 --- a/services/hasura/migrations/1582950844052_create_action_rateProducer/down.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- args: - name: rateProducer - type: drop_action -- args: - enums: [] - input_objects: [] - objects: [] - scalars: [] - type: set_custom_types diff --git a/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml b/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml deleted file mode 100644 index 1dad2b8e..00000000 --- a/services/hasura/migrations/1582950844052_create_action_rateProducer/up.yaml +++ /dev/null @@ -1,35 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: arg1 - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: create_action diff --git a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 879c0250..00000000 --- a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: arg1 - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 7195b0f1..00000000 --- a/services/hasura/migrations/1582994080171_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 52a9a685..00000000 --- a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: https://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index d75dc83f..00000000 --- a/services/hasura/migrations/1582994256642_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://localhost:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 3931d579..00000000 --- a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://localhost:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index da760a38..00000000 --- a/services/hasura/migrations/1583004430995_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 7c7c68a6..00000000 --- a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index da760a38..00000000 --- a/services/hasura/migrations/1583004453318_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 7c7c68a6..00000000 --- a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: response - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 58b68d6a..00000000 --- a/services/hasura/migrations/1583004636939_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,36 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://host.docker.internal:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql new file mode 100755 index 00000000..3f95f09f --- /dev/null +++ b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.sql @@ -0,0 +1,16 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml b/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml deleted file mode 100644 index f61854be..00000000 --- a/services/hasura/migrations/1583531471259_add_ratings_cntr_column/up.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- args: - cascade: true - read_only: false - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development,\n ratings_stats.ratings_cntr\n FROM (producers\n - \ FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1583953599516_add_general_info_column/up.sql b/services/hasura/migrations/1583953599516_add_general_info_column/up.sql new file mode 100755 index 00000000..82742e2f --- /dev/null +++ b/services/hasura/migrations/1583953599516_add_general_info_column/up.sql @@ -0,0 +1,17 @@ + +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr, + producers.general_info + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner))); \ No newline at end of file diff --git a/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml b/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml deleted file mode 100644 index 066fe0b8..00000000 --- a/services/hasura/migrations/1583953599516_add_general_info_column/up.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- args: - cascade: true - read_only: false - sql: "CREATE OR REPLACE VIEW \"public\".\"producers_list\" AS \n SELECT producers.owner,\n - \ producers.bpjson,\n producers.system,\n ((producers.bpjson -> 'org'::text) - ->> 'candidate_name'::text) AS candidate_name,\n (producers.system ->> 'total_votes'::text) - AS total_votes,\n ratings_stats.average,\n ratings_stats.transparency,\n - \ ratings_stats.infrastructure,\n ratings_stats.trustiness,\n ratings_stats.community,\n - \ ratings_stats.development,\n ratings_stats.ratings_cntr,\n producers.general_info\n - \ FROM (producers\n FULL JOIN ratings_stats ON (((ratings_stats.bp)::text - = producers.owner)));" - type: run_sql diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql new file mode 100755 index 00000000..37b3e03e --- /dev/null +++ b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.sql @@ -0,0 +1,2 @@ + +DROP TABLE "public"."proxies"; \ No newline at end of file diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml b/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml deleted file mode 100644 index caba4db2..00000000 --- a/services/hasura/migrations/1584293813117_create_table_public_proxies/down.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- args: - cascade: false - read_only: false - sql: DROP TABLE "public"."proxies"; - type: run_sql diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql new file mode 100755 index 00000000..3a98b6fc --- /dev/null +++ b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.sql @@ -0,0 +1,2 @@ + +CREATE TABLE "public"."proxies"("owner" text NOT NULL, "name" text NOT NULL, "website" text, "slogan" text, "philosophy" text, "background" text, "logo_256" text, "telegram" text, "steemit" text, "twitter" text, "wechat" text, "voter_info" jsonb NOT NULL, PRIMARY KEY ("owner") , UNIQUE ("owner"), UNIQUE ("name")); \ No newline at end of file diff --git a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml b/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml deleted file mode 100644 index 56190373..00000000 --- a/services/hasura/migrations/1584293813117_create_table_public_proxies/up.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- args: - cascade: false - read_only: false - sql: CREATE TABLE "public"."proxies"("owner" text NOT NULL, "name" text NOT NULL, - "website" text, "slogan" text, "philosophy" text, "background" text, "logo_256" - text, "telegram" text, "steemit" text, "twitter" text, "wechat" text, "voter_info" - jsonb NOT NULL, PRIMARY KEY ("owner") , UNIQUE ("owner"), UNIQUE ("name")); - type: run_sql -- args: - name: proxies - schema: public - type: add_existing_table_or_view diff --git a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 21bb6557..00000000 --- a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index a1abc8cb..00000000 --- a/services/hasura/migrations/1587519806338_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,37 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - name: RatingOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml b/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml deleted file mode 100644 index d62c1f97..00000000 --- a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: producers_list - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml b/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml deleted file mode 100644 index f1e519cf..00000000 --- a/services/hasura/migrations/1587692809044_update_permission_anonymous_public_table_producers_list/up.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - owner - - bpjson - - system - - candidate_name - - total_votes - - average - - transparency - - infrastructure - - trustiness - - community - - development - - ratings_cntr - - general_info - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: producers_list - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml b/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml deleted file mode 100644 index c2606de7..00000000 --- a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: proxies - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml b/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml deleted file mode 100644 index c2d974ea..00000000 --- a/services/hasura/migrations/1587692831014_update_permission_anonymous_public_table_proxies/up.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - owner - - name - - website - - slogan - - philosophy - - background - - logo_256 - - telegram - - steemit - - twitter - - wechat - - voter_info - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: proxies - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml b/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml deleted file mode 100644 index b550eb82..00000000 --- a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: ratings_stats - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml b/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml deleted file mode 100644 index 2d2f43de..00000000 --- a/services/hasura/migrations/1587692841531_update_permission_anonymous_public_table_ratings_stats/up.yaml +++ /dev/null @@ -1,22 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - bp - - ratings_cntr - - average - - transparency - - infrastructure - - trustiness - - community - - development - - created_at - - updated_at - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: ratings_stats - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml b/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml deleted file mode 100644 index 7e7cbd9f..00000000 --- a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: user_ratings - schema: public - type: drop_select_permission diff --git a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml b/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml deleted file mode 100644 index ef987239..00000000 --- a/services/hasura/migrations/1587692864567_update_permission_anonymous_public_table_user_ratings/up.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - ratings - - tx_data - - bp - - uniq_rating - - user - computed_fields: [] - filter: {} - limit: null - role: anonymous - table: - name: user_ratings - schema: public - type: create_select_permission diff --git a/services/hasura/migrations/1587692968903_save_action_perm/down.yaml b/services/hasura/migrations/1587692968903_save_action_perm/down.yaml deleted file mode 100644 index 3c7b2a9b..00000000 --- a/services/hasura/migrations/1587692968903_save_action_perm/down.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- args: - action: rateProducer - role: anonymous - type: drop_action_permission diff --git a/services/hasura/migrations/1587692968903_save_action_perm/up.yaml b/services/hasura/migrations/1587692968903_save_action_perm/up.yaml deleted file mode 100644 index bf8cd938..00000000 --- a/services/hasura/migrations/1587692968903_save_action_perm/up.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- args: - action: rateProducer - definition: - select: - filter: {} - role: anonymous - type: create_action_permission diff --git a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml b/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml deleted file mode 100644 index 817ef3bf..00000000 --- a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: anonymous - table: - name: user_ratings - schema: public - type: drop_delete_permission diff --git a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml b/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml deleted file mode 100644 index 0d18ba0c..00000000 --- a/services/hasura/migrations/1591561533500_update_permission_anonymous_public_table_user_ratings/up.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- args: - permission: - backend_only: false - filter: {} - role: anonymous - table: - name: user_ratings - schema: public - type: create_delete_permission diff --git a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index 2e1a545b..00000000 --- a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,45 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index ee28c6f7..00000000 --- a/services/hasura/migrations/1591591375238_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,54 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - - description: null - name: uniq_rating - type: String - - description: null - name: user - type: String - - description: null - name: bp - type: String - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml b/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml deleted file mode 100644 index f346f256..00000000 --- a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/down.yaml +++ /dev/null @@ -1,58 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - - arguments: null - description: null - name: uniq_rating - type: String - - arguments: null - description: null - name: user - type: String - - arguments: null - description: null - name: bp - type: String - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml b/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml deleted file mode 100644 index 011268dd..00000000 --- a/services/hasura/migrations/1591592964244_modify_action_rateProducer_to_rateProducer/up.yaml +++ /dev/null @@ -1,57 +0,0 @@ -- args: - enums: [] - input_objects: - - description: null - fields: - - description: null - name: user - type: String! - - description: null - name: producer - type: String! - name: RatingInput - objects: - - description: null - fields: - - description: null - name: message - type: String! - - description: null - name: uniq_rating - type: String - - description: null - name: user - type: String - - description: null - name: bp - type: String - - description: null - name: ratings - type: jsonb - name: RatingOutput - relationships: null - - description: null - fields: - - arguments: null - description: null - name: message - type: String! - name: deleteUserRateOutput - relationships: null - scalars: [] - type: set_custom_types -- args: - comment: null - definition: - arguments: - - description: null - name: ratingInput - type: RatingInput! - forward_client_headers: false - handler: http://hapi:3005/ratebp - headers: [] - kind: synchronous - output_type: RatingOutput - type: mutation - name: rateProducer - type: update_action diff --git a/services/hasura/migrations/metadata.yaml b/services/hasura/migrations/metadata.yaml deleted file mode 100644 index 7407f974..00000000 --- a/services/hasura/migrations/metadata.yaml +++ /dev/null @@ -1,127 +0,0 @@ -version: 2 -tables: - - table: - schema: public - name: producers - select_permissions: - - role: anonymous - permission: - columns: - - bpjson - - general_info - - owner - - system - filter: {} - - table: - schema: public - name: producers_list - select_permissions: - - role: anonymous - permission: - columns: - - owner - - bpjson - - system - - candidate_name - - total_votes - - average - - transparency - - infrastructure - - trustiness - - community - - development - - ratings_cntr - - general_info - filter: {} - - table: - schema: public - name: proxies - select_permissions: - - role: anonymous - permission: - columns: - - owner - - name - - website - - slogan - - philosophy - - background - - logo_256 - - telegram - - steemit - - twitter - - wechat - - voter_info - filter: {} - - table: - schema: public - name: ratings_stats - select_permissions: - - role: anonymous - permission: - columns: - - bp - - ratings_cntr - - average - - transparency - - infrastructure - - trustiness - - community - - development - - created_at - - updated_at - filter: {} - - table: - schema: public - name: user_ratings - select_permissions: - - role: anonymous - permission: - columns: - - ratings - - tx_data - - bp - - uniq_rating - - user - filter: {} - delete_permissions: - - role: anonymous - permission: - filter: {} -actions: - - name: rateProducer - definition: - handler: "{{HASURA_GRAPHQL_ACTION_BASE_URL}}/ratebp" - output_type: RatingOutput - arguments: - - name: ratingInput - type: RatingInput! - type: mutation - kind: synchronous - permissions: - - role: anonymous -custom_types: - input_objects: - - name: RatingInput - fields: - - name: user - type: String! - - name: producer - type: String! - objects: - - name: RatingOutput - fields: - - name: message - type: String! - - name: uniq_rating - type: String - - name: user - type: String - - name: bp - type: String - - name: ratings - type: jsonb - - name: deleteUserRateOutput - fields: - - name: message - type: String! From 97bddc2788be4b5388a476aa7a63af516e341a1f Mon Sep 17 00:00:00 2001 From: JustinCast Date: Thu, 13 May 2021 13:22:52 -0600 Subject: [PATCH 17/21] fix: remove build:staging statement --- services/frontend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile index be50f964..e91c0dbe 100644 --- a/services/frontend/Dockerfile +++ b/services/frontend/Dockerfile @@ -32,7 +32,7 @@ COPY . . ENV GENERATE_SOURCEMAP false -RUN yarn build:"$branch" +RUN yarn build FROM nginx:1.16.1-alpine as server From 5d919852a682ffc5105d46b888fc8b36b0be2090 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Thu, 13 May 2021 13:35:50 -0600 Subject: [PATCH 18/21] latest changes --- .gitignore | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 12d57bd9..180f4a5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,4 @@ -# Compiled codes -build/ -dist/ -*.wast -# IDE's .vscode .idea *.iml @@ -23,11 +18,15 @@ temp .eslintcache # database data -.dbdata/ +db_data # wallet keys keys +# env files +.env* +!.env.example + # netlify cli .netlify/ @@ -35,4 +34,4 @@ keys __docs build_k8s/ -ssl/ +ssl/ \ No newline at end of file From a358f4b733b033b5148111753f6fedc211f1f415 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Fri, 14 May 2021 15:28:59 -0600 Subject: [PATCH 19/21] fix: add missing env web app entries --- .github/workflows/push-master-environment.yaml | 8 ++++++++ .github/workflows/push-staging-environment.yaml | 8 ++++++++ services/frontend/src/routes/block-producers/index.js | 1 - 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index e9c9fa09..6ddd3edd 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -57,6 +57,14 @@ jobs: INGRESS_HOST: eosrate.io INGRESS_GRAPHQL_HOST: graphql.eosrate.io # webapp + REACT_APP_GRAPHQL_HTTP_URL: https://graphql.eosrate.io/v1/graphql + REACT_APP_GRAPHQL_WS_URL: ws://graphql.eosrate.io/v1/graphql + REACT_APP_EOS_API_URL: https://api.eosio.cr + REACT_APP_EOS_API_HOST: api.eosio.cr + REACT_APP_EOS_API_PORT: 443 + REACT_APP_EOS_API_PROTOCOL: https + REACT_APP_EOS_CHAIN_ID: aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 + REACT_APP_BLOCK_EXPLORER: https://bloks.io # postgres DATABASE_DIRECTORY: database DB_NAME: ${{ secrets.DB_NAME }} diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index a3e50725..2f03e05f 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -57,6 +57,14 @@ jobs: INGRESS_HOST: jungle.eosrate.io INGRESS_GRAPHQL_HOST: graphql-jungle.eosrate.io # webapp + REACT_APP_GRAPHQL_HTTP_URL: https://graphql-jungle.eosrate.io/v1/graphql + REACT_APP_GRAPHQL_WS_URL: ws://localhost:8080/v1/graphql + REACT_APP_EOS_API_URL: https://jungle.eosio.cr + REACT_APP_EOS_API_HOST: jungle.eosio.cr + REACT_APP_EOS_API_PORT: 443 + REACT_APP_EOS_API_PROTOCOL: https + REACT_APP_EOS_CHAIN_ID: 2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 + REACT_APP_BLOCK_EXPLORER: https://jungle3.bloks.io # postgres DATABASE_DIRECTORY: database DB_NAME: ${{ secrets.DB_NAME }} diff --git a/services/frontend/src/routes/block-producers/index.js b/services/frontend/src/routes/block-producers/index.js index 7731686c..e20d65ef 100644 --- a/services/frontend/src/routes/block-producers/index.js +++ b/services/frontend/src/routes/block-producers/index.js @@ -208,7 +208,6 @@ const AllBps = ({ ual }) => { {selectedBPs && selectedBPs.length > 0 && ( From 0848d07d3bcc09b095f9fcfbcb320a458757fa70 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Fri, 14 May 2021 15:42:53 -0600 Subject: [PATCH 20/21] fix: change localhost var value --- .github/workflows/push-staging-environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index 2f03e05f..43590b41 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -58,7 +58,7 @@ jobs: INGRESS_GRAPHQL_HOST: graphql-jungle.eosrate.io # webapp REACT_APP_GRAPHQL_HTTP_URL: https://graphql-jungle.eosrate.io/v1/graphql - REACT_APP_GRAPHQL_WS_URL: ws://localhost:8080/v1/graphql + REACT_APP_GRAPHQL_WS_URL: ws://graphql-jungle.eosrate.io/v1/graphql REACT_APP_EOS_API_URL: https://jungle.eosio.cr REACT_APP_EOS_API_HOST: jungle.eosio.cr REACT_APP_EOS_API_PORT: 443 From 7f8da9aaa11dc882af107344cd7efd2a20cc3b34 Mon Sep 17 00:00:00 2001 From: JustinCast Date: Fri, 14 May 2021 16:15:59 -0600 Subject: [PATCH 21/21] fix: add missing workflow env vars (#573) --- .github/workflows/push-master-environment.yaml | 9 +++++++++ .github/workflows/push-staging-environment.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index 6ddd3edd..52d945c1 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -42,6 +42,15 @@ jobs: DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} BRANCH: production NAMESPACE: mainnet-eosrate + # webapp + REACT_APP_GRAPHQL_HTTP_URL: https://graphql.eosrate.io/v1/graphql + REACT_APP_GRAPHQL_WS_URL: ws://graphql.eosrate.io/v1/graphql + REACT_APP_EOS_API_URL: https://api.eosio.cr + REACT_APP_EOS_API_HOST: api.eosio.cr + REACT_APP_EOS_API_PORT: 443 + REACT_APP_EOS_API_PROTOCOL: https + REACT_APP_EOS_CHAIN_ID: aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 + REACT_APP_BLOCK_EXPLORER: https://bloks.io - name: Build kubernetes files id: build_kubernetes_files diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index 43590b41..83084718 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -42,6 +42,15 @@ jobs: DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} BRANCH: staging NAMESPACE: jungle-eosrate + # webapp + REACT_APP_GRAPHQL_HTTP_URL: https://graphql-jungle.eosrate.io/v1/graphql + REACT_APP_GRAPHQL_WS_URL: ws://graphql-jungle.eosrate.io/v1/graphql + REACT_APP_EOS_API_URL: https://jungle.eosio.cr + REACT_APP_EOS_API_HOST: jungle.eosio.cr + REACT_APP_EOS_API_PORT: 443 + REACT_APP_EOS_API_PROTOCOL: https + REACT_APP_EOS_CHAIN_ID: 2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 + REACT_APP_BLOCK_EXPLORER: https://jungle3.bloks.io - name: Build kubernetes files id: build_kubernetes_files