Skip to content

Commit

Permalink
feat: adding amoy support (#645)
Browse files Browse the repository at this point in the history
* feat: adding amoy support

* docs: adding new contracts
  • Loading branch information
javip97 authored Apr 8, 2024
1 parent e1e2edd commit 3e13c17
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .env-api.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ISSUER_API_UI_ISSUER_DID=<Issuer DID>
ISSUER_API_UI_SCHEMA_CACHE=false
ISSUER_API_IDENTITY_METHOD=polygonid
ISSUER_API_IDENTITY_BLOCKCHAIN=polygon
ISSUER_API_IDENTITY_NETWORK=mumbai
ISSUER_API_IDENTITY_NETWORK=amoy
ISSUER_API_UI_KEY_TYPE=BJJ
ISSUER_API_ENVIRONMENT=local
ISSUER_CUSTOM_DID_METHODS='[{"blockchain":"linea","network":"testnet","networkFlag":"0b01000001","chainID":59140}]'
9 changes: 4 additions & 5 deletions .env-issuer.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ISSUER_KEY_STORE_PLUGIN_IDEN3_MOUNT_PATH=iden3


ISSUER_ETHEREUM_URL=<Ethereum URL of the Issuer>
ISSUER_ETHEREUM_CONTRACT_ADDRESS=0x134B1BE34911E39A8397ec6289782989729807a4
ISSUER_ETHEREUM_CONTRACT_ADDRESS=0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124
ISSUER_ETHEREUM_DEFAULT_GAS_LIMIT=600000
ISSUER_ETHEREUM_CONFIRMATION_TIME_OUT=600s
ISSUER_ETHEREUM_CONFIRMATION_BLOCK_COUNT=5
Expand All @@ -27,8 +27,7 @@ ISSUER_ETHEREUM_MAX_GAS_PRICE=1000000
ISSUER_ETHEREUM_RPC_RESPONSE_TIMEOUT=5s
ISSUER_ETHEREUM_WAIT_RECEIPT_CYCLE_TIME=30s
ISSUER_ETHEREUM_WAIT_BLOCK_CYCLE_TIME=30s
ISSUER_ETHEREUM_RESOLVER_PREFIX=polygon:mumbai
ISSUER_ETHEREUM_INTERNAL_TRANSFER_AMOUNT_WEI=1000000000000000000
ISSUER_ETHEREUM_RESOLVER_PREFIX=polygon:amoy
ISSUER_ETHEREUM_TRANSFER_ACCOUNT_KEY_PATH=pbkey

ISSUER_PROVER_SERVER_URL=http://localhost:8002
Expand All @@ -42,8 +41,8 @@ ISSUER_VAULT_USERPASS_AUTH_ENABLED=false
ISSUER_VAULT_USERPASS_AUTH_PASSWORD=password


ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=<supported-onchain-revocation-contract>
ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0x3d3763eC0a50CE1AdF83d0b5D99FBE0e3fEB43fb
ISSUER_CREDENTIAL_STATUS_RHS_URL=http://localhost:3001
ISSUER_CREDENTIAL_STATUS_PUBLISHING_KEY_PATH=pbkey
ISSUER_CREDENTIAL_STATUS_RHS_MODE=None
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=<80001 | 137>
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=<80002 | 80001 | 137>
2 changes: 1 addition & 1 deletion .env-ui.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISSUER_UI_AUTH_USERNAME=user-ui
ISSUER_UI_AUTH_PASSWORD=password-ui
ISSUER_UI_BLOCK_EXPLORER_URL=https://mumbai.polygonscan.com
ISSUER_UI_BLOCK_EXPLORER_URL=https://www.oklink.com/amoy
ISSUER_UI_BUILD_TAG=
ISSUER_UI_WARNING_MESSAGE=
ISSUER_UI_IPFS_GATEWAY_URL=https://ipfs.io
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Streamline the **Verifiable Credentials issuance** process with the user-friendl
- [Docker Engine](https://docs.docker.com/engine/) `1.27+`
- Makefile toolchain `GNU Make 3.81`
- Publicly accessible URL - The issuer node API must be publicly reachable. Please make sure you properly configure your proxy or use a tool like [Localtunnel](https://theboroer.github.io/localtunnel-www/) for testing purposes.
- Polygon Mumbai or Main RPC - You can get one in any of the providers of this list
- Polygon Amoy or Main RPC - You can get one in any of the providers of this list
- [Chainstack](https://chainstack.com/)
- [Ankr](https://ankr.com/)
- [QuickNode](https://quicknode.com/)
Expand All @@ -54,7 +54,7 @@ Streamline the **Verifiable Credentials issuance** process with the user-friendl
In this section we will cover the installation of the Issuer Node API.

> [!NOTE]
> This Quick Installation Guide is prepared for Polygon Mumbai (Testnet) both for the state contract and issuer dids. If you want to deploy the node with Polygon Main configuration, please visit our [advanced Issuer Node configuration guide](https://devs.polygonid.com/docs/issuer/issuer-configuration/)).
> This Quick Installation Guide is prepared for Polygon Amoy (Testnet) both for the state contract and issuer dids. If you want to deploy the node with Polygon Main configuration, please visit our [advanced Issuer Node configuration guide](https://devs.polygonid.com/docs/issuer/issuer-configuration/)).

#### Deploy Issuer Node Infrastructure
Expand Down Expand Up @@ -84,7 +84,7 @@ In this section we will cover the installation of the Issuer Node API.
make add-vault-token
```

5. Write the private key in the vault. This step is needed in order to be able to transit the issuer's state. To perform that action the given account has to be funded. For Mumbai network you can request some testing Matic [here](https://mumbaifaucet.com/).
5. Write the private key in the vault. This step is needed in order to be able to transit the issuer's state. To perform that action the given account has to be funded. For Amoy network you can request some testing Matic [here](https://www.alchemy.com/faucets/polygon-amoy).
```bash
make private_key=<YOUR_WALLET_PRIVATE_KEY> add-private-key
Expand Down
4 changes: 2 additions & 2 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ paths:
name: subject
schema:
type: string
description: Filter per subject. Example - did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ
description: Filter per subject. Example - did:polygonid:polygon:amoy:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ
- in: query
name: revoked
schema:
Expand Down Expand Up @@ -519,7 +519,7 @@ components:
network:
type: string
x-omitempty: false
example: "mumbai"
example: "amoy"
type:
type: string
x-omitempty: false
Expand Down
12 changes: 6 additions & 6 deletions api_ui/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ paths:
name: did
schema:
type: string
example: did:polygonid:polygon:mumbai:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
example: did:polygonid:polygon:amoy:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
- in: query
name: status
schema:
Expand Down Expand Up @@ -1085,7 +1085,7 @@ components:
example: [ ]
from:
type: string
example: did:polygonid:polygon:mumbai:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
example: did:polygonid:polygon:amoy:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe

QrCodeLinkShortResponse:
type: object
Expand Down Expand Up @@ -1283,10 +1283,10 @@ components:
example:
birthday: 19960424
documentType: 2
id: "did:polygonid:polygon:mumbai:2qDDDKmo436EZGCBAvkqZjADYoNRJszkG7UymZeCHQ"
id: "did:polygonid:polygon:amoy:2qDDDKmo436EZGCBAvkqZjADYoNRJszkG7UymZeCHQ"
userID:
type: string
example: did:polygonid:polygon:mumbai:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
example: did:polygonid:polygon:amoy:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
refreshService:
$ref: '#/components/schemas/RefreshService'
displayMethod:
Expand Down Expand Up @@ -1493,11 +1493,11 @@ components:
userID:
type: string
x-omitempty: false
example: did:polygonid:polygon:mumbai:2qMZrfBsXuGFTwSqkqYki78zF3pe1vtXoqH4yRLsfs
example: did:polygonid:polygon:amoy:2qMZrfBsXuGFTwSqkqYki78zF3pe1vtXoqH4yRLsfs
issuerID:
type: string
x-omitempty: false
example: did:polygonid:polygon:mumbai:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
example: did:polygonid:polygon:amoy:2qFpPHotk6oyaX1fcrpQFT4BMnmg8YszUwxYtaoGoe
createdAt:
$ref: '#/components/schemas/TimeUTC'
credentials:
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/alicebob/miniredis/v2 v2.31.1
github.com/deepmap/oapi-codegen v1.16.2
github.com/ethereum/go-ethereum v1.13.13
github.com/ethereum/go-ethereum v1.13.14
github.com/getkin/kin-openapi v0.123.0
github.com/go-chi/chi/v5 v5.0.11
github.com/go-chi/cors v1.2.1
Expand All @@ -20,7 +20,7 @@ require (
github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20231006071010-f511d08ca36f
github.com/iden3/go-circuits/v2 v2.0.1
github.com/iden3/go-iden3-auth/v2 v2.1.0
github.com/iden3/go-iden3-core/v2 v2.0.4
github.com/iden3/go-iden3-core/v2 v2.1.0
github.com/iden3/go-iden3-crypto v0.0.16
github.com/iden3/go-jwz/v2 v2.0.1
github.com/iden3/go-merkletree-sql/db/pgx/v2 v2.0.5
Expand Down Expand Up @@ -50,8 +50,8 @@ require (
github.com/pressly/goose/v3 v3.17.0
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.19.0
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
golang.org/x/crypto v0.22.0
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0
)

require github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
Expand Down Expand Up @@ -112,12 +112,12 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dchest/blake512 v1.0.0 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.1 // indirect
github.com/ettle/strcase v0.2.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
Expand Down Expand Up @@ -324,13 +324,13 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/tools v0.20.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading

0 comments on commit 3e13c17

Please sign in to comment.