Skip to content

Commit

Permalink
Merge pull request 0xPolygonID#25 from 0xPolygonID/test/amoy
Browse files Browse the repository at this point in the history
examples on amoy
  • Loading branch information
vmidyllic authored Apr 9, 2024
2 parents 1816dc7 + 6b911bb commit ffd0baf
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 95 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# reverse hash service url
RHS_URL="https://rhs-staging.polygonid.me"
# state v2 contract address in the mumbai network
CONTRACT_ADDRESS="0x134B1BE34911E39A8397ec6289782989729807a4"
# state v2 contract address in the amoy network
CONTRACT_ADDRESS="0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
# path to the circuits folder
CIRCUITS_PATH="./circuits"
# key in hex format with matic balance
WALLET_KEY=""
# MongoDB connection string, uses in memory Mongo server if not specified
MONGO_DB_CONNECTION=""
# third part yurl to polygon mumbai network rpc node
# third part yurl to polygon amoy network rpc node
THIRD_PARTY_RPC_URL=""
# third party contract address in the linea test network
THIRD_PARTY_CONTRACT_ADDRESS=""
Expand Down
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```

2. Copy over the `.env.example` into `.env`
You'll need to fill in `RPC_URL` and `WALLET_KEY` with your own endpoint and key respectively. The default env vars assume you will be using the Polygon Mumbai network.
You'll need to fill in `RPC_URL` and `WALLET_KEY` with your own endpoint and key respectively. The default env vars assume you will be using the Polygon Amoy network.
```bash
cp .env.example .env
Expand All @@ -20,11 +20,11 @@
```bash
# reverse hash service url
RHS_URL="https://rhs-staging.polygonid.me"
# state v2 contract address in the mumbai network
CONTRACT_ADDRESS="0x134B1BE34911E39A8397ec6289782989729807a4"
# state v2 contract address in the amoy network
CONTRACT_ADDRESS="0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
# path to the circuits folder
CIRCUITS_PATH="./circuits"
# url to polygon mumbai network rpc node
# url to polygon amoy network rpc node
RPC_URL=""
# key in hex format with matic balance
WALLET_KEY=""
Expand Down
11 changes: 5 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const defaultNetworkConnection = {
};

export const defaultIdentityCreationOptions: IdentityCreationOptions = {
method: core.DidMethod.Iden3,
method: core.DidMethod.PolygonId,
blockchain: core.Blockchain.Polygon,
networkId: core.NetworkId.Mumbai,
networkId: core.NetworkId.Amoy,
revocationOpts: {
type: CredentialStatusType.Iden3ReverseSparseMerkleTreeProof,
id: rhsUrl
Expand Down Expand Up @@ -221,15 +221,15 @@ async function transitStateThirdPartyDID() {
methodByte: 0b1000_0001,
blockchain: 'linea',
network: 'test',
networkFlag: 0b01000000 | 0b00000001,
chainId: 11155111
networkFlag: 0b01000001 | 0b00000001,
chainId: 11155112
});

core.registerDidMethodNetwork({
method: 'iden3',
blockchain: 'linea',
network: 'test',
networkFlag: 0b11000000 | 0b00000011
networkFlag: 0b11000001 | 0b00000011
});

const { dataStorage, credentialWallet, identityWallet } = await initInMemoryDataStorageAndWallets(
Expand Down Expand Up @@ -1059,7 +1059,6 @@ async function main(choice: string) {
await identityCreation();
await issueCredential();
await transitState();
await transitStateThirdPartyDID();
await generateProofs();
await handleAuthRequest();
await handleAuthRequestWithProfiles();
Expand Down
Loading

0 comments on commit ffd0baf

Please sign in to comment.