Closed JohnKHW closed 8 months ago
I noticed that you are setting the identifier of the DID to be the REGISTRY_ADDRESS. This is not correct. The identifier must correspond to the PRIVATE_KEY, at least initially. The identifier must be either the public key corresponding to the private key, or the equivalent ethereum address. This is most likely the cause of the failure.
this.did = new EthrDID({
identifier: REGISTRY_ADDRESS, /// !!! this identifier must be either the public key or the ethereum address corresponding to the PRIVATE_KEY
privateKey: PRIVATE_KEY,
rpcUrl: NODE_URL,
registry: REGISTRY_ADDRESS,
chainNameOrId: 'private',
});
Then, in your resolver configuration, you should either use the networks
param, or the single network configuration, and it's wise to specify the chainID in the configuration as well.
getResolver({
rpcUrl: NODE_URL,
registry: REGISTRY_ADDRESS,
chainId: <your hardhat chain ID here>, // add this
name: 'private' // add this
// no longer need to add `networks`
}),
Alternatively, you can specify only the networks
, with a single entry:
getResolver({
networks: [{
rpcUrl: NODE_URL,
registry: REGISTRY_ADDRESS,
chainId: <your hardhat chain ID here>, // add this
name: 'private' // add this
]}),
Got it, I successed to run the code, thank you
Prerequisites
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION if you're sure you checked all the boxes.
Current Behavior
The current behavior is using the the example code from README.md, but the network is the hardhat local network
What is the current behavior?
Expected Behavior
Return JWT code after issue VC
verifyCredential should be able to return decoded JWT.
Please describe the behavior you are expecting
Failure Information
Error: invalid_signature: no matching public key found
Please help provide information about the failure.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Environment Details
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs/Screenshots