From be31f468963efecd01486c428614ca75c34ce02f Mon Sep 17 00:00:00 2001 From: Beniamin Date: Mon, 20 May 2024 08:23:34 +0300 Subject: [PATCH] Fix --- .github/workflows/docker.yaml | 4 ++- configs/config.go | 2 +- deployments/proposal_state_service/Dockerfile | 27 ++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 4a91f76..9125506 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -51,8 +51,10 @@ jobs: LOKI_URL=${{ secrets.LOKI_URL }} DB_URL=${{ secrets.DB_URL }} QUORUM=${{ vars.QUORUM }} - MIN_YES_PERCENTAGE=${{ vars.MIN_YES_PERCENTAGE }} + MAX_REQUIRED_SEEDERS_COUNT=${{ vars.MAX_REQUIRED_SEEDERS_COUNT }} YES_VOTES_TO_OVERCOME_NO=${{ vars.YES_VOTES_TO_OVERCOME_NO }} + MIN_YES_VOTES_PERCENTAGE=${{ vars.MIN_YES_VOTES_PERCENTAGE }} + MIN_REQUIRED_YES_VOTES=${{ vars.MIN_REQUIRED_YES_VOTES }} TELEGRAM_ACCESS_GOVERNANCE_BOT_TOKEN=${{ secrets.TELEGRAM_ACCESS_GOVERNANCE_BOT_TOKEN }} MEMBERS_CHAT_ID=${{ vars.MEMBERS_CHAT_ID }} SEEDERS_CHAT_ID=${{ vars.SEEDERS_CHAT_ID }} diff --git a/configs/config.go b/configs/config.go index 2535ca2..bfe660d 100644 --- a/configs/config.go +++ b/configs/config.go @@ -42,7 +42,7 @@ type ProposalStateServiceConfig struct { Quorum float64 `env:"QUORUM"` // 30% initial parameter for quorum MaxRequiredSeedersCount float64 `env:"MAX_REQUIRED_SEEDERS_COUNT"` // But not more than 10 votes MinYesVotesPercentage float64 `env:"MIN_YES_VOTES_PERCENTAGE"` // Minimum 10% of votes should be "Yes" - MinRequiredYesVotes float64 `env:"MIN_REQUIRED_YE_VOTES"` // But not less than 3 + MinRequiredYesVotes float64 `env:"MIN_REQUIRED_YES_VOTES"` // But not less than 3 YesVotesToOvercomeNo float64 `env:"YES_VOTES_TO_OVERCOME_NO"` // 50% "yes" votes to overcome one "No vote" } diff --git a/deployments/proposal_state_service/Dockerfile b/deployments/proposal_state_service/Dockerfile index e4424bd..547f799 100644 --- a/deployments/proposal_state_service/Dockerfile +++ b/deployments/proposal_state_service/Dockerfile @@ -3,27 +3,36 @@ FROM golang:1.21 ARG ENVIRONMENT ENV ENVIRONMENT=$ENVIRONMENT -ARG INITIAL_SEEDERS -ENV INITIAL_SEEDERS=$INITIAL_SEEDERS - -ARG VOTING_DURATION_DAYS -ENV VOTING_DURATION_DAYS=$VOTING_DURATION_DAYS - ARG LOKI_URL ENV LOKI_URL=$LOKI_URL ARG DB_URL ENV DB_URL=$DB_URL +ARG QUORUM +ENV QUORUM=$QUORUM + +ARG MAX_REQUIRED_SEEDERS_COUNT +ENV MAX_REQUIRED_SEEDERS_COUNT=$MAX_REQUIRED_SEEDERS_COUNT + +ARG YES_VOTES_TO_OVERCOME_NO +ENV YES_VOTES_TO_OVERCOME_NO=$YES_VOTES_TO_OVERCOME_NO + +ARG MIN_YES_VOTES_PERCENTAGE +ENV MIN_YES_VOTES_PERCENTAGE=$MIN_YES_VOTES_PERCENTAGE + +ARG MIN_REQUIRED_YES_VOTES +ENV MIN_REQUIRED_YES_VOTES=$MIN_REQUIRED_YES_VOTES + ARG TELEGRAM_ACCESS_GOVERNANCE_BOT_TOKEN ENV TELEGRAM_ACCESS_GOVERNANCE_BOT_TOKEN=$TELEGRAM_ACCESS_GOVERNANCE_BOT_TOKEN -ARG TELEGRAM_VOTE_BOT_TOKEN -ENV TELEGRAM_VOTE_BOT_TOKEN=$TELEGRAM_VOTE_BOT_TOKEN - ARG MEMBERS_CHAT_ID ENV MEMBERS_CHAT_ID=$MEMBERS_CHAT_ID +ARG SEEDERS_CHAT_ID +ENV SEEDERS_CHAT_ID=$SEEDERS_CHAT_ID + WORKDIR /opt/src COPY ./go.mod .