-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert project to monorepo and add coordinator service
- Loading branch information
Showing
282 changed files
with
46,767 additions
and
12,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
node_modules | ||
dist | ||
.next | ||
coverage | ||
build | ||
typechain-types | ||
.eslintrc.js | ||
commitlint.config.js | ||
subgraph/generated | ||
public/mockServiceWorker.js | ||
zkeys | ||
playwright-report | ||
test-results | ||
next.config.js | ||
interface/playwright.config.ts | ||
interface/playwright/fixtures.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
tasks="maci-coordinator" | ||
for task in $tasks; do | ||
maci_coordinator_revision=$(aws ecs describe-task-definition --task-definition $task --query "taskDefinition.revision") | ||
aws ecs update-service --cluster maci-coordinator --service $task --force-new-deployment --task-definition $task:$maci_coordinator_revision | ||
done | ||
|
||
for loop in {1..3}; do | ||
[ "$loop" -eq 3 ] && exit 1 | ||
aws ecs wait services-stable --cluster maci-coordinator --services $tasks && break || continue | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Coordinator | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
env: | ||
COORDINATOR_RPC_URL: "http://localhost:8545" | ||
COORDINATOR_PUBLIC_KEY_PATH: "./pub.key" | ||
COORDINATOR_PRIVATE_KEY_PATH: "./priv.key" | ||
COORDINATOR_TALLY_ZKEY_NAME: "TallyVotes_10-1-2_test" | ||
COORDINATOR_MESSAGE_PROCESS_ZKEY_NAME: "ProcessMessages_10-2-1-2_test" | ||
COORDINATOR_ZKEY_PATH: "./zkeys/" | ||
COORDINATOR_RAPIDSNARK_EXE: "~/rapidsnark/build/prover" | ||
SUBGRAPH_FOLDER: "../subgraph" | ||
SUBGRAPH_NAME: ${{ vars.SUBGRAPH_NAME }} | ||
SUBGRAPH_PROVIDER_URL: ${{ vars.SUBGRAPH_PROVIDER_URL }} | ||
SUBGRAPH_DEPLOY_KEY: ${{ secrets.SUBGRAPH_DEPLOY_KEY }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --yes \ | ||
build-essential \ | ||
libgmp-dev \ | ||
libsodium-dev \ | ||
nasm \ | ||
nlohmann-json3-dev | ||
- name: Install | ||
run: | | ||
pnpm install --frozen-lockfile --prefer-offline | ||
- name: Build | ||
run: | | ||
pnpm run build | ||
- name: Run hardhat | ||
run: | | ||
pnpm run hardhat & | ||
sleep 5 | ||
working-directory: packages/coordinator | ||
|
||
- name: Download rapidsnark (1c137) | ||
run: | | ||
mkdir -p ~/rapidsnark/build | ||
wget -qO ~/rapidsnark/build/prover https://maci-devops-zkeys.s3.ap-northeast-2.amazonaws.com/rapidsnark-linux-amd64-1c137 | ||
chmod +x ~/rapidsnark/build/prover | ||
- name: Download circom Binary v2.1.6 | ||
run: | | ||
wget -qO ${{ github.workspace }}/circom https://github.com/iden3/circom/releases/download/v2.1.6/circom-linux-amd64 | ||
chmod +x ${{ github.workspace }}/circom | ||
sudo mv ${{ github.workspace }}/circom /bin/circom | ||
- name: Download zkeys | ||
run: | | ||
pnpm download-zkeys-coordinator:test | ||
- name: Generate keypair | ||
run: | | ||
pnpm generate-keypair | ||
working-directory: packages/coordinator | ||
|
||
- name: Test | ||
run: pnpm run test | ||
working-directory: packages/coordinator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CoordinatorDeploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::490752553772:role/maci-coordinator-ecs-deploy-slc | ||
role-duration-seconds: 2700 | ||
aws-region: eu-central-1 | ||
|
||
- name: Build and Push images to ECR | ||
run: | | ||
.github/scripts/build.sh ${{ secrets.COORDINATOR_RPC_URL }} ${{ secrets.COORDINATOR_ADDRESSES }} ${{ secrets.COORDINATOR_ALLOWED_ORIGINS }} | ||
- name: Create Deployment | ||
run: | | ||
.github/scripts/deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pnpm exec lint-staged && pnpm run types | ||
pnpm lint && pnpm run types |
Oops, something went wrong.