issuer-node icon indicating copy to clipboard operation
issuer-node copied to clipboard

Getting Errors while publishing did on chain using ethereum network and sepolia chain.

Open varshney565 opened this issue 2 years ago • 10 comments

WHAT I HAVE DONE

I have filled the env file with suitable parameters including setting the Ethereum node URL,Ethereum contract address, ISSUER_API_IDENTITY_METHOD=polygonid,ISSUER_API_IDENTITY_BLOCKCHAIN=eth,ISSUER_API_IDENTITY_NETWORK=sepolia(as I am using sepolia network) ISSUER_API_UI_KEY_TYPE=ETH. after that i have run the rhs service locally as mentioned in the polygonid docs about rhs. after that I have done make up and set up the vault and generate the issuer_did and does make run.

ISSUE THAT I AM FACING

I am getting the below error while publishing the id to on chain and generating the claim, PUBLISHING DID ON CHAIN p1 GENERATING THE CLAIM, p2 WHAT IT IS SHOWING ON ALCHEMY ABOUT PUBLISHING DID ON CHAIN. a1

varshney565 avatar Apr 26 '24 05:04 varshney565

yes i am getting exactly the same issue @martinsaporiti

DSHIVAAY-23 avatar Apr 26 '24 06:04 DSHIVAAY-23

Hi, ISSUER_API_IDENTITY METHOD, ISSUER_API_IDENTITY BLOCKCHAIN, ISSUER_API_IDENTITY_NETWORK variables are not used when you run the core API (running on port 3001). The command make run runs the core API. So if you are running the core API and you want to use ETH identity you have to:

  • Create an identity like this (example for amoy network):
# endpoint: HTTP://localhost:3001/v1/identities
# body:
{
    "didMetadata":{
        "method": "polygonid",
        "blockchain":"polygon",
        "network": "amoy",
        "type": "ETH"
    }
}

as result fo this you should have:

{
    "address": "c2092ca2b69d332501f44ffc26394dad1ec7af6a",
    "identifier": "did:polygonid:polygon:amoy:2qQ68JkRcf3ykwsHqB46fRPpdV9P1abkCjaHCEhSYF",
    "state": {
        "createdAt": "2024-04-26T11:31:10.546607Z",
        "modifiedAt": "2024-04-26T11:31:10.546607Z",
        "state": "0000000000000000000000000000000000000000000000000000000000000000",
        "status": "confirmed"
    }
}
  • Send funds to the address c2092ca2b69d332501f44ffc26394dad1ec7af6a
  • Publish the state
  • Create a credential using did:polygonid:polygon:amoy:2qQ68JkRcf3ykwsHqB46fRPpdV9P1abkCjaHCEhSYF Sample:
http://localhost:3001/v1/did:polygonid:polygon:amoy:2qQ68JkRcf3ykwsHqB46fRPpdV9P1abkCjaHCEhSYF/claims

{
    "credentialSchema":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json",
    "type": "KYCAgeCredential",
    "credentialSubject": {
        "id": "did:polygonid:polygon:amoy:2qRsnkYbUHM3Cwx3WAowTjyUmH65zhhLmj88uGAfMM",
        "birthday": 19960424,
        "documentType": 2
    },
    "expiration": 202511092354
}

If you want to use the sepolia network you must have published the State Contract on that network.

martinsaporiti avatar Apr 26 '24 11:04 martinsaporiti

I am sharing with you the screen recording of the flow in which I am getting the error doing the same thing as you are doing.

https://github.com/0xPolygonID/issuer-node/assets/87566789/49b341d5-0610-4fd3-a19d-6341b6b18171

varshney565 avatar Apr 26 '24 12:04 varshney565

Yeap, it seems to be right. Have you changed the ISSUER_ETHEREUM_CONTRACT_ADDRESS with your state contract in Sepolia?

martinsaporiti avatar Apr 26 '24 13:04 martinsaporiti

@varshney565 thank you for the issue. Wait for this PR to be added to the main branch, or add this line and deploy the state contract again. It should help.

ilya-korotya avatar Apr 26 '24 17:04 ilya-korotya

i am also facing the same issue.

ghost avatar Apr 29 '24 05:04 ghost

Yeap, it seems to be right. Have you changed the ISSUER_ETHEREUM_CONTRACT_ADDRESS with your state contract in Sepolia?

yes i have changed that address

varshney565 avatar Apr 29 '24 05:04 varshney565

Hi @varshney565 @saiharish-1029 @DSHIVAAY-23. Could you please try redeploying the state contract again? But first of all, pull the latest changes for the contract repository.

ilya-korotya avatar Apr 29 '24 12:04 ilya-korotya

Hi @ilya-korotya yes we have redeployed the state contract and its working fine now we are not getting that error , Thankyou for support

DSHIVAAY-23 avatar Apr 29 '24 12:04 DSHIVAAY-23

@varshney565 @saiharish-1029 @DSHIVAAY-23. I'm going to close the issue because it's resolved. Feel free to open it again.

ilya-korotya avatar Apr 29 '24 15:04 ilya-korotya