- Install Node.js version 14
$ nvm install 14
-
Install firebase tools
$ npm i -g firebase-tools
-
Save the Firebase configuration obtained from Firebase console as
config/firebaseConfig.js
. The content should look something like:// For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "...", authDomain: "...", databaseURL: "...", projectId: "...", storageBucket: "...", messagingSenderId: "...", appId: "...", measurementId: "...", }
-
Similarly save the Firebase private key file from Firebase console as
config/serviceAccountPrvkey.json
. The content should look something like:{ "type": "service_account", "project_id": "zkcream", "private_key_id": "...", "private_key": "...", "client_email": "...", "client_id": "...", "auth_uri": "...", "token_uri": "...", "auth_provider_x509_cert_url": "...", "client_x509_cert_url": "..." }
-
In repository root directory, run:
$ ./deploy-firebase-config.sh
-
Create OAuth application in GitHub and using the id and secret, set up Firebase GitHub authentication.
-
Login to firebase (if haven't logged in yet)
$ firebase login
-
Install gstool (https://cloud.google.com/storage/docs/gsutil_install?hl=ja#deb)
-
Set up CORS for the default bucket e.g.
$ gsutil cors set cors.json gs://zkcream.appspot.com
Refer to admin package
-
Install dependencies
$ npx lerna bootstrap
-
Update ceremony config file
packages/client/config/default.ts
-
build client and deploy
$ cd packages/client $ npm run build $ npm run deploy
Open https://[project id].web.app
in browser
A slightly modified version of Snarkjs 0.4.6 that can run zkey functions on web browsers is included