-
Download the zk circuits into
./circuits
by runningdl_circuits.sh
. This will download the latest files fromhttps://iden3-circuits-bucket.s3.eu-west-1.amazonaws.com/latest.zip
./dl_circuits.sh
-
Copy over the
.env.example
into.env
You'll need to fill inRPC_URL
andWALLET_KEY
with your own endpoint and key respectively. The default env vars assume you will be using the Polygon Amoy network.cp .env.example .env
example.env
# reverse hash service url RHS_URL="https://rhs-staging.polygonid.me" # state v2 contract address in the amoy network CONTRACT_ADDRESS="0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124" # path to the circuits folder CIRCUITS_PATH="./circuits" # url to polygon amoy network rpc node RPC_URL="" # key in hex format with matic balance WALLET_KEY="" # MongoDB connection string, uses in memory Mongo server if not specified MONGO_DB_CONNECTION=""
-
Install dependencies
npm i
You can run each example function independently:
npm run start -- [function]
The [function] should be replaced with one of the following options:
- identityCreation
- issueCredential
- transitState
- transitStateThirdPartyDID
- generateProofs
- handleAuthRequest
- handleAuthRequestWithProfiles
- handleAuthRequestNoIssuerStateTransition
- generateProofsMongo
- handleAuthRequestMongo
To run all examples
npm run start
js-sdk-examples is part of the 0xPolygonID project copyright 2024 ZKID Labs AG
This project is licensed under either of
at your option.