Skip to content

Commit

Permalink
chore: update step 2 of react native tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
nickreynolds committed Apr 3, 2024
1 parent 19b3714 commit 857000a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/react_native_tutorials/react_native_2_resolve_dids.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ and/or encryption, what service endpoints can be used with them, etc.
DID resolution depends on the DID method being used. This means that the ability to resolve various DID types, we have
to find implementations of these DID method drivers and use them.
There are lots of DID methods out there, and the choice of DID method to use is out of scope for this guide. But, since
we already saw how to create `did:ethr` identifiers, let's see how to also resolve them to get the DID documents.
we already saw how to create `did:peer` identifiers, let's see how to also resolve them to get the DID documents.

## Installation

The veramo list of "core" packages contains a DID resolver plugin. This plugin is an aggregator of multiple DID method
drivers. Let's install that plugin as well as a DID resolver for `did:ethr`. And to see how multiple DID methods can be
supported, let's also add support for resolving `did:web`.

`npm install @veramo/did-resolver ethr-did-resolver web-did-resolver cross-fetch`
`npm install @veramo/did-resolver web-did-resolver cross-fetch`

## Setup

Expand All @@ -44,8 +44,8 @@ import { IResolver } from '@veramo/core'
// This plugin implements `IResolver`
import { DIDResolverPlugin } from '@veramo/did-resolver'

// the did:ethr resolver package
import { getResolver as ethrDidResolver } from 'ethr-did-resolver'
// the did:peer resolver package
import { getResolver as peerDidResolver } from '@veramo/did-provider-peer'
// the did:web resolver package
import { getResolver as webDidResolver } from 'web-did-resolver'
```
Expand All @@ -65,7 +65,7 @@ export const agent = createAgent<IDIDManager & IKeyManager & IDataStore & IDataS
// ... previously added plugins
//
new DIDResolverPlugin({
...ethrDidResolver({ infuraProjectId: INFURA_PROJECT_ID }), // and set it up to support `did:ethr`
...peerDidResolver(), // and set it up to support `did:peer`
...webDidResolver(), // and `did:web`
}),
],
Expand Down

0 comments on commit 857000a

Please sign in to comment.