This is a demo app of a unirep attester. In this demo app, users can request data from the example attester. After transition, users can prove how much data they have.
Learn more about how to build with create-unirep-app!
npx create-unirep-appThen cd into the directory that was created.
yarn buildTip
To overwrite circuit keys, delete .wasm, .zkey and .vkey.json objects in packages/circuits/zksnarkBuild and run:
yarn circuits buildsnarkyarn contracts hardhat nodein new terminal window, from root:
yarn contracts deployyarn relay startin new terminal window, from root:
yarn frontend startIt will be running at: http://localhost:3000/
yarn lint:fixyarn lint:check- Edit the
packages/contracts/.envafteryarn build. - Get your
ETH_PROVIDER_URLfrom infura, alchemy, or other provider services. - Get your
PRIVATE_KEYand paste it in.envstarting with0x. - Run
from root directory
yarn contracts deploy --network custom
Vercel is a Frontend Cloud. You can easily deploy the frontend and relay service with Vercel.
Caution
It will be a serverless relay. Learn more about serverless functions.
-
Deploy serverless relay:
-
Go to Settings > Environment Variables
setkey value PRIVATE_KEY0x... ETH_PROVIDER_URLhttps://... APP_ADDRESS0x... UNIREP_ADDRESS0x... from
packages/relay/.env -
Go to Deployments, choose the deployment and click ...
Click Redeploy -
Redeploy the relay, you will get a
https://{RELAY_APP_NAME}.vercel.appas the relay server. -
View demo: https://create-unirep-app-relay.vercel.app/
-
Deploy frontend:
-
Go to vercel dashboard and click Add New... > Project
-
Choose the same repo as you created before.
-
Set
Framework Preset:Create React App
Build Command:yarn build
Output Directory:packages/frontend/build
Environment Variables:key value SERVERhttps://{RELAY_APP_NAME}.vercel.appand leave other settings as default.
-
Deploy the frontend, you will get a
https://{FRONTEND_APP_NAME}.vercel.appapp!
-
This project is supported by Privacy & Scaling Explorations and the Ethereum Foundation. See more projects on: https://pse.dev/projects.