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-app
Then cd
into the directory that was created.
yarn build
Tip
To overwrite circuit keys, delete .wasm
, .zkey
and .vkey.json
objects in packages/circuits/zksnarkBuild
and run:
yarn circuits buildsnark
yarn contracts hardhat node
in new terminal window, from root:
yarn contracts deploy
yarn relay start
in new terminal window, from root:
yarn frontend start
It will be running at: http://localhost:3000/
yarn lint:fix
yarn lint:check
- Edit the
packages/contracts/.env
afteryarn build
. - Get your
ETH_PROVIDER_URL
from infura, alchemy, or other provider services. - Get your
PRIVATE_KEY
and paste it in.env
starting 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_KEY
0x... ETH_PROVIDER_URL
https://... APP_ADDRESS
0x... UNIREP_ADDRESS
0x... 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.app
as 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 SERVER
https://{RELAY_APP_NAME}.vercel.app
and leave other settings as default.
-
Deploy the frontend, you will get a
https://{FRONTEND_APP_NAME}.vercel.app
app!
-
This project is supported by Privacy & Scaling Explorations and the Ethereum Foundation. See more projects on: https://pse.dev/projects.