From 93e640462387412854ea0b62c4807b8ecdbd7323 Mon Sep 17 00:00:00 2001 From: Giovanni Gargiulo Date: Wed, 1 Nov 2023 13:21:59 +0000 Subject: [PATCH] Feat/add voting verification docs (#483) * chore: initial commit docs verification app * chore: complete configuration for preprod * chore: added details in the readme --- README.md | 4 ++ VOTE_VERIFICATION.md | 73 ++++++++++++++++++++++++++++ docker-compose-vote-verification.yml | 31 ++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 VOTE_VERIFICATION.md create mode 100644 docker-compose-vote-verification.yml diff --git a/README.md b/README.md index 834997f2e..519bd2d5f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ cd cf-ballot-app/backend-services/voting-verification-app this will launch voting-verification-app on port: 9092 by default. +### Running Vote Verification + +Instructions on how to run the `Vote Verification` app are located [here](./VOTE_VERIFICATION.md) + ### User verification app on port ```bash export AWS_SNS_ACCESS_KEY_ID=... diff --git a/VOTE_VERIFICATION.md b/VOTE_VERIFICATION.md new file mode 100644 index 000000000..5ab59c84b --- /dev/null +++ b/VOTE_VERIFICATION.md @@ -0,0 +1,73 @@ +# Vote Verification + +The Vote Verification application allows users to autonomously verify their vote is on correctly persisted on-chain. + +In order to run the Vote Verification app, it is required to run three components: + +1. ledger-follower-app +2. voting-verification-app +3. verification-ui + +### Ledger Follower App + +The Ledger Follower app is a service the crawls the blockchain looking for relevant information. In this case votes and +voting events. + +### Voting Verification App + +The Voting Verification app is a service that leverages the Ledger Follower app to verify votes for a particular voting event. + +### Verification UI + +The verification UI is a user-friendly front end app that allows users to quickly verify their vote receipts. + +## Running the Vote Verification app + +There are multiple ways of running the Vote Verification stack, but the quickest and more concise one is definitely via +[docker compose](https://docs.docker.com/compose/) + +You can install docker compose [here](https://docs.docker.com/compose/install/) + +In order to run the stack is sufficient to check-out the github project and execute: + +`docker compose -f docker-compose-vote-verification.yml up -d` + +It is possible to quickly visualise the services status by running + +`docker ps -a` + +And it should look something similar to: + +```bash +docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +6049aee2f6db cf-voting-app-verification-ui "/docker-entrypoint.…" 10 seconds ago Up 9 seconds 80/tcp, 0.0.0.0:8080->8080/tcp cf-voting-app-verification-ui-1 +a0528218c570 pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/voting-ledger-follower-app:v0.2.74-1-g33bffc1b "java -jar app.jar" 10 seconds ago Up 9 seconds cf-voting-app-follower-api-1 +f43fd3af49db pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/voting-verification-app:v0.2.74-1-g33bffc1b "/docker-entrypoint.…" 10 seconds ago Up 9 seconds 80/tcp, 0.0.0.0:9092->9092/tcp cf-voting-app-verification-app-1 +``` + +Logs can be checked by running: + +`docker logs -f ` + +An example is + +`docker logs -f cf-voting-app-follower-api-1` + +# Accessing the UI + +Now that everything is running, you can access the voting app in your browser by visiting http://localhost:8080 + +# Event Specific Configuring + +It is possible to customise the Vote Verification app with a specific event by configuring the following parameters. + +Event specific values will be disclosed by the team close to the start of the voting event. + +* `CARDANO_NETWORK=PREPROD` the network on which the event is setup, it can be `MAIN`, `PREPROD` or `PREVIEW` +* `ORGANISER_STAKE_ADDRESS` it's the stake address of the admin wallet used to setup and run the event. +* A preprod example is `stake_test1uqwcz0754wwpuhm6xhdpda6u9enyahaj5ynlc9ay5l4mlms4pyqyg` +* `BIND_ON_EVENT_IDS` it's the id of the event. Some preprod events are `CF_SUMMIT_2023_025E` or `CIP-1694_Pre_Ratification_3316` +* `CARDANO_NODE_PROTOCOL_MAGIC` it's a network specific id required to ensure follower app is connected to the right network +* `YACI_STORE_CARDANO_SYNC_START_BLOCK_HASH` it's the hash of the block from when the follower should start syncing. Preprod eg. `3337e297121fda1262372c28de3d917bd2a60bb1e3c6326e3b7e832eb8017615` +* `YACI_STORE_CARDANO_SYNC_START_SLOT` it's the slot number of the block at point above. Eg. 38748711 diff --git a/docker-compose-vote-verification.yml b/docker-compose-vote-verification.yml new file mode 100644 index 000000000..5febae63a --- /dev/null +++ b/docker-compose-vote-verification.yml @@ -0,0 +1,31 @@ +version: '3.8' +services: + follower-api: + image: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/voting-ledger-follower-app:v0.2.74-1-g33bffc1b + restart: always + environment: + - SPRING_PROFILES_ACTIVE=prod + - CORS_ALLOWED_ORIGINS:http://localhost:8080 + - CARDANO_NETWORK=PREPROD + - ORGANISER_STAKE_ADDRESS=stake_test1uqwcz0754wwpuhm6xhdpda6u9enyahaj5ynlc9ay5l4mlms4pyqyg + - BIND_ON_EVENT_IDS=CF_SUMMIT_2023_025E,CIP-1694_Pre_Ratification_3316,FRUITS_CF62 + - CARDANO_NODE_PROTOCOL_MAGIC=1 + - YACI_STORE_CARDANO_SYNC_START_BLOCK_HASH=3337e297121fda1262372c28de3d917bd2a60bb1e3c6326e3b7e832eb8017615 + - YACI_STORE_CARDANO_SYNC_START_SLOT=38748711 + - '9090:9090' + verification-app: + image: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/voting-verification-app:v0.2.74-1-g33bffc1b + restart: always + environment: + - LEDGER_FOLLOWER_APP_URL=http://follower-api:9090 + ports: + - '9092:9092' + verification-ui: + build: + context: ui/verification-app + args: + REACT_APP_VOTING_VERIFICATION_APP_SERVER_URL: http://verification-app:9092 + REACT_APP_TARGET_NETWORK: preprod + restart: always + ports: + - '8080:8080'