-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9fb8e2
commit b2a35a2
Showing
6 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const KnownDidRegistries = [ | ||
{ | ||
name: 'DCC Pilot Registry', | ||
url: 'https://digitalcredentials.github.io/issuer-registry/registry.json', | ||
}, | ||
{ | ||
name: 'DCC Sandbox Registry', | ||
url: 'https://digitalcredentials.github.io/sandbox-registry/registry.json', | ||
}, | ||
{ | ||
name: 'DCC Community Registry', | ||
url: 'https://digitalcredentials.github.io/community-registry/registry.json', | ||
}, | ||
{ | ||
name: 'DCC Registry', | ||
url: 'https://digitalcredentials.github.io/dcc-registry/registry.json', | ||
}, | ||
{ | ||
name: 'My Skills Registry', | ||
url: 'https://sandbox-issuer.myskillspocket.com/registry.json', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { RegistryClient } from '@digitalcredentials/issuer-registry-client'; | ||
import { KnownDidRegistries } from 'data/knownRegistries'; | ||
|
||
/** | ||
* Loads remote Known Issuer / Known Verifier DID registries from config. | ||
*/ | ||
async function loadKnownDidRegistries({ | ||
client, | ||
}: { | ||
client: RegistryClient; | ||
}) { | ||
await client.load({ config: KnownDidRegistries }); | ||
// Now available for usage through the cachedRegistryClient. | ||
} | ||
|
||
// Cache for storing the data | ||
let didRegistryClient: RegistryClient = new RegistryClient(); | ||
|
||
// Function to fetch and cache the data | ||
async function fetchRegistries() { | ||
try { | ||
await loadKnownDidRegistries({ client: didRegistryClient }); | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
} | ||
} | ||
export async function getCachedRegistryClient(){ | ||
await fetchRegistries(); | ||
return didRegistryClient; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters